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
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  bool Flush();
47 
48  bool OpenFile(const QString& filePath, const QString& xslFilePath);
49 
50  // reimplemented (iser::IArchive)
51  virtual bool IsTagSkippingSupported() const;
52  virtual bool BeginTag(const iser::CArchiveTag& tag);
53  virtual bool BeginMultiTag(const iser::CArchiveTag& tag, const iser::CArchiveTag& subTag, int& count);
54  virtual bool EndTag(const iser::CArchiveTag& tag);
55  virtual bool Process(QString& value);
56  using BaseClass::Process;
57 
58 protected:
59  bool WriteStringNode(const QString& text);
60 
61  // reimplemented (iser::CTextWriteArchiveBase)
62  bool WriteTextNode(const QByteArray& text);
63 
64  virtual bool SendLogMessage(
65  istd::IInformationProvider::InformationCategory category,
66  int id,
67  const QString& message,
68  const QString& messageSource,
69  int flags = 0) const
70  {
71  return iser::CWriteArchiveBase::SendLogMessage(category, id, message, messageSource, flags);
72  }
73 private:
75 
76  QDomDocument m_document;
77  QDomElement m_currentParent;
78 
79  QFile m_file;
80  QString m_xslFilePath;
81 
82  bool m_serializeHeader;
83  iser::CArchiveTag m_rootTag;
84 
85  bool m_isSeparatorNeeded;
86 };
87 
88 
89 } // namespace iqtex
90 
91 
92 #endif // !iqtex_CXslTransformationWriteArchive_included
93 
94 
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.
virtual bool Process(QString &value)
bool WriteStringNode(const QString &text)
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 Process(bool &value)=0
virtual bool IsTagSkippingSupported() const
virtual bool BeginMultiTag(const iser::CArchiveTag &tag, const iser::CArchiveTag &subTag, int &count)
virtual bool EndTag(const iser::CArchiveTag &tag)
bool WriteTextNode(const QByteArray &text)

© 2007-2017 Witold Gantzke and Kirill Lepskiy