CXslTransformationWriteArchive.h
Go to the documentation of this file.
1 #ifndef iqtex_CXslTransformationWriteArchive_included
2 #define iqtex_CXslTransformationWriteArchive_included
3 
4 
5 // Qt includes
6 #include <QtCore/QFile>
7 #include <QtCore/QBuffer>
8 #include <QtXml/QDomDocument>
9 #include <QtXml/QDomNode>
10 
11 // ACF includes
12 #include "iser/CWriteArchiveBase.h"
13 #include "ifile/CFileArchiveInfo.h"
15 
16 #include "iqtex/iqtex.h"
17 
18 
19 namespace iqtex
20 {
21 
22 
33 {
34 public:
37 
39  const QString& filePath = "",
40  const QString& xslFilePath = "",
41  const iser::IVersionInfo* versionInfoPtr = NULL,
42  bool serializeHeader = true,
43  const iser::CArchiveTag& rootTag = s_acfRootTag);
45 
46 
47 
48  bool Flush();
49 
50  bool OpenFile(const QString& filePath, const QString& xslFilePath);
51 
52  // reimplemented (iser::IArchive)
53  virtual bool IsTagSkippingSupported() const;
54  virtual bool BeginTag(const iser::CArchiveTag& tag);
55  virtual bool BeginMultiTag(const iser::CArchiveTag& tag, const iser::CArchiveTag& subTag, int& count);
56  virtual bool EndTag(const iser::CArchiveTag& tag);
57  virtual bool Process(bool& value);
58  virtual bool Process(char& value);
59  virtual bool Process(quint8& value);
60  virtual bool Process(qint8& value);
61  virtual bool Process(quint16& value);
62  virtual bool Process(qint16& value);
63  virtual bool Process(quint32& value);
64  virtual bool Process(qint32& value);
65  virtual bool Process(quint64& value);
66  virtual bool Process(qint64& value);
67  virtual bool Process(float& value);
68  virtual bool Process(double& value);
69  virtual bool Process(QByteArray& value);
70  virtual bool Process(QString& value);
71  virtual bool ProcessData(void* dataPtr, int size);
72 
73 protected:
77  bool PushTextNode(const QString& text);
78 
79  virtual bool SendLogMessage(
80  istd::IInformationProvider::InformationCategory category,
81  int id,
82  const QString& message,
83  const QString& messageSource,
84  int flags = 0) const
85  {
86  return iser::CWriteArchiveBase::SendLogMessage(category, id, message, messageSource, flags);
87  }
88 private:
90 
91  QDomDocument m_document;
92  QDomElement m_currentParent;
93 
94  QFile m_file;
95  QString m_xslFilePath;
96 
97  bool m_serializeHeader;
98  iser::CArchiveTag m_rootTag;
99 
100  bool m_isSeparatorNeeded;
101 };
102 
103 
104 } // namespace iqtex
105 
106 
107 #endif // !iqtex_CXslTransformationWriteArchive_included
108 
109 
virtual bool SendLogMessage(istd::IInformationProvider::InformationCategory category, int id, const QString &message, const QString &messageSource, int flags=0) const
virtual bool BeginTag(const iser::CArchiveTag &tag)
Qt-based implementation of archive for writing in XML format.
bool OpenFile(const QString &filePath, const QString &xslFilePath)
CXslTransformationWriteArchive(const QString &filePath="", const QString &xslFilePath="", const iser::IVersionInfo *versionInfoPtr=NULL, bool serializeHeader=true, const iser::CArchiveTag &rootTag=s_acfRootTag)
virtual bool IsTagSkippingSupported() const
virtual bool Process(bool &value)
virtual bool BeginMultiTag(const iser::CArchiveTag &tag, const iser::CArchiveTag &subTag, int &count)
virtual bool EndTag(const iser::CArchiveTag &tag)
virtual bool ProcessData(void *dataPtr, int size)
bool PushTextNode(const QString &text)
Find the next text node and move the current node to the next sibling.

© 2007-2011 Witold Gantzke and Kirill Lepskiy