1 #ifndef OPTIONSTREEWRITER_H 2 #define OPTIONSTREEWRITER_H 3 4 #include "atomicxmlfile/atomicxmlfile.h" 5 6 #include <QVariant> 7 8 class OptionsTree; 9 class VariantTree; 10 11 class OptionsTreeWriter : public AtomicXmlFileWriter 12 { 13 public: 14 OptionsTreeWriter(const OptionsTree*); 15 16 void setName(const QString& configName); 17 void setNameSpace(const QString& configNS); 18 void setVersion(const QString& configVersion); 19 20 // reimplemented 21 virtual bool write(QIODevice* device); 22 23 protected: 24 void writeTree(const VariantTree* tree); 25 void writeVariant(const QVariant& variant); 26 void writeUnknown(const QString& unknown); 27 void readUnknownTree(QXmlStreamReader* reader); 28 29 private: 30 const OptionsTree* options_; 31 QString configName_; 32 QString configNS_; 33 QString configVersion_; 34 }; 35 36 #endif 37