CCompactXmlWriteArchiveBase.h
Go to the documentation of this file.
1 #ifndef iser_CCompactXmlWriteArchiveBase_included
2 #define iser_CCompactXmlWriteArchiveBase_included
3 
4 
5 // Qt includes
6 #include <QtXml/QDomDocument>
7 #include <QtXml/QDomNode>
8 #include <QtCore/QXmlStreamWriter>
9 #include <QtCore/QFile>
10 
11 // ACF includes
14 
15 #include <iser/iser.h>
16 
17 
18 namespace iser
19 {
20 
21 
28 {
29 public:
31 
33 
34  // reimplemented (iser::IArchive)
35  virtual bool IsTagSkippingSupported() const;
36  virtual bool BeginTag(const iser::CArchiveTag& tag);
37  virtual bool BeginMultiTag(const iser::CArchiveTag& tag, const iser::CArchiveTag& subTag, int& count);
38  virtual bool EndTag(const iser::CArchiveTag& tag);
39  virtual bool Process(QString& value);
40  using BaseClass::Process;
41 
42 protected:
44  const iser::IVersionInfo* versionInfoPtr,
45  bool serializeHeader,
46  const iser::CArchiveTag& rootTag);
47  bool InitArchive(QIODevice* devicePtr);
48  bool Flush();
49 
50  bool WriteStringNode(const QString& text);
51 
52  // reimplemented (iser::CTextWriteArchiveBase)
53  virtual bool WriteTextNode(const QByteArray& text);
54 
55  QXmlStreamWriter m_xmlWriter;
56 
57 private:
58  QByteArray m_currentAttribute;
59 
60  bool m_serializeHeader;
61  iser::CArchiveTag m_rootTag;
62 
63  bool m_isSeparatorNeeded; // idicate that separator must be added before something is outputted
64  bool m_allowAttribute; // indicate if attribute outputting is allowed now
65 
66  QList<const iser::CArchiveTag*> m_tagsStack;
67 };
68 
69 
70 } // namespace iser
71 
72 
73 #endif // !iser_CCompactXmlWriteArchiveBase_included
74 
75 
virtual bool Process(QString &value)
Process primitive type.
Provides access to version information.
Definition: IVersionInfo.h:22
bool InitArchive(QIODevice *devicePtr)
bool WriteStringNode(const QString &text)
virtual bool EndTag(const iser::CArchiveTag &tag)
End of archive tag.
CCompactXmlWriteArchiveBase(const iser::IVersionInfo *versionInfoPtr, bool serializeHeader, const iser::CArchiveTag &rootTag)
virtual bool BeginTag(const iser::CArchiveTag &tag)
Begin of archive tag.
Base class of compact XML write archive.
Base class for all XML implementations for ACF documents.
virtual bool WriteTextNode(const QByteArray &text)
Write single unformatted text node.
Process tag used to group data in archive stream.
Definition: CArchiveTag.h:21
virtual bool Process(bool &value)
Process primitive type.
Common archive implementation of text-based storing archives.
virtual bool IsTagSkippingSupported() const
Check if skiping to the end of tag on EndTag is supported.
virtual bool BeginMultiTag(const iser::CArchiveTag &tag, const iser::CArchiveTag &subTag, int &count)
Begin of archive tag containing set of subelements of the same type.

© 2007-2017 Witold Gantzke and Kirill Lepskiy