CCompactXmlReadArchiveBase.h
Go to the documentation of this file.
1 #ifndef iser_CCompactXmlReadArchiveBase_included
2 #define iser_CCompactXmlReadArchiveBase_included
3 
4 
5 // Qt includes
6 #include <QtXml/QDomDocument>
7 #include <QtXml/QDomNode>
8 
9 // ACF includes
12 
13 #include <iser/iser.h>
14 
15 
16 namespace iser
17 {
18 
19 
26 {
27 public:
29  bool serializeHeader = true,
30  const iser::CArchiveTag& rootTag = s_acfRootTag);
31 
32  // reimplemented (iser::IArchive)
33  virtual bool IsTagSkippingSupported() const;
34  virtual bool BeginTag(const iser::CArchiveTag& tag);
35  virtual bool BeginMultiTag(const iser::CArchiveTag& tag, const iser::CArchiveTag& subTag, int& count);
36  virtual bool EndTag(const iser::CArchiveTag& tag);
37  virtual bool Process(QString& value);
38  using BaseClass::Process;
39 
40 protected:
41  bool ReadStringNode(QString& text);
42 
43  bool SetContent(QIODevice* devicePtr);
44 
45  // reimplemented (iser::CTextReadArchiveBase)
46  virtual bool ReadTextNode(QByteArray& text);
47 
48  virtual void DecorateMessage(
50  int id,
51  int flags,
52  QString& message,
53  QString& messageSource) const;
54 
55  QDomDocument m_document;
56  QDomElement m_currentParent;
57 
58 private:
59  QByteArray m_currentAttribute;
60 
61  bool m_serializeHeader;
62  iser::CArchiveTag m_rootTag;
63 
64  bool m_isNewFormat; // idicate that new format is enabled
65  bool m_allowAttribute; // indicate if attribute outputting is allowed now
66 
67  typedef QList<const iser::CArchiveTag*> TagsList;
68  TagsList m_tagsStack;
69 };
70 
71 
72 } // namespace iser
73 
74 
75 #endif // !iser_CCompactXmlReadArchiveBase_included
76 
77 
virtual bool ReadTextNode(QByteArray &text)
Read single unformatted text node.
bool ReadStringNode(QString &text)
static CArchiveTag s_acfRootTag
Definition: CArchiveBase.h:35
bool SetContent(QIODevice *devicePtr)
virtual bool Process(bool &value)=0
Process primitive type.
virtual void DecorateMessage(istd::IInformationProvider::InformationCategory category, int id, int flags, QString &message, QString &messageSource) const
Decorate message parts before outputting.
Common archive implementation of text-based reading archives.
InformationCategory
Category of information.
CCompactXmlReadArchiveBase(bool serializeHeader=true, const iser::CArchiveTag &rootTag=s_acfRootTag)
Base class for all XML implementations for ACF documents.
Qt-based implementation of archive reading from XML file.
virtual bool Process(QString &value)
Process primitive type.
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.
Process tag used to group data in archive stream.
Definition: CArchiveTag.h:21
virtual bool EndTag(const iser::CArchiveTag &tag)
End of archive tag.
virtual bool IsTagSkippingSupported() const
Check if skiping to the end of tag on EndTag is supported.
virtual bool BeginTag(const iser::CArchiveTag &tag)
Begin of archive tag.

© 2007-2017 Witold Gantzke and Kirill Lepskiy