CXmlWriteArchiveBase.h
Go to the documentation of this file.
1 #ifndef iser_CXmlWriteArchiveBase_included
2 #define iser_CXmlWriteArchiveBase_included
3 
4 
5 // ACF includes
8 
9 
10 namespace iser
11 {
12 
13 
18 {
19 public:
21 
22  // reimplemented (iser::IArchive)
23  virtual bool IsTagSkippingSupported() const;
24  virtual bool BeginTag(const CArchiveTag& tag);
25  virtual bool BeginMultiTag(const CArchiveTag& tag, const CArchiveTag& subTag, int& count);
26  virtual bool EndTag(const CArchiveTag& tag);
27  virtual bool Process(QByteArray& value);
28  virtual bool Process(QString& value);
29  using BaseClass::Process;
30 
31 protected:
32  CXmlWriteArchiveBase(const IVersionInfo* versionInfoPtr, const CArchiveTag& rootTag);
33 
34  bool MakeIndent();
35 
39  bool WriteXmlHeader();
43  bool WriteXmlFooter();
44 
45  // reimplemented (iser::CTextWriteArchiveBase)
46  bool WriteTextNode(const QByteArray& text);
47 
48  // abstract methods
49  virtual bool WriteString(const QByteArray& value) = 0;
50 
51 private:
52  CArchiveTag m_rootTag;
53 
54  int m_indent;
55 
56  bool m_isSeparatorNeeded;
57 };
58 
59 
60 } // namespace iser
61 
62 
63 #endif // !iser_CXmlWriteArchiveBase_included
64 
65 
virtual bool IsTagSkippingSupported() const
Check if skiping to the end of tag on EndTag is supported.
Base class for XML storing archives.
bool WriteTextNode(const QByteArray &text)
Write single unformatted text node.
Provides access to version information.
Definition: IVersionInfo.h:22
CTextWriteArchiveBase BaseClass
virtual bool BeginTag(const CArchiveTag &tag)
Begin of archive tag.
virtual bool Process(QByteArray &value)
Process primitive type.
CXmlWriteArchiveBase(const IVersionInfo *versionInfoPtr, const CArchiveTag &rootTag)
Base class for all XML implementations for ACF documents.
virtual bool BeginMultiTag(const CArchiveTag &tag, const CArchiveTag &subTag, int &count)
Begin of archive tag containing set of subelements of the same type.
virtual bool WriteString(const QByteArray &value)=0
Process tag used to group data in archive stream.
Definition: CArchiveTag.h:21
virtual bool EndTag(const CArchiveTag &tag)
End of archive tag.
bool WriteXmlFooter()
Write XML footer.
bool WriteXmlHeader()
Write XML header.
virtual bool Process(bool &value)
Process primitive type.
Common archive implementation of text-based storing archives.

© 2007-2017 Witold Gantzke and Kirill Lepskiy