CXmlReadArchiveBase.h
Go to the documentation of this file.
1 #ifndef iser_CXmlReadArchiveBase_included
2 #define iser_CXmlReadArchiveBase_included
3 
4 
5 // ACF includes
8 
9 
10 namespace iser
11 {
12 
13 
18  public CTextReadArchiveBase,
20 {
21 public:
23 
24  // reimplemented (iser::IArchive)
25  virtual bool IsTagSkippingSupported() const;
26  virtual bool BeginTag(const CArchiveTag& tag);
27  virtual bool BeginMultiTag(const CArchiveTag& tag, const CArchiveTag& subTag, int& count);
28  virtual bool EndTag(const CArchiveTag& tag);
29  virtual bool Process(QByteArray& value);
30  virtual bool Process(QString& value);
31  using BaseClass::Process;
32 
33 protected:
34  explicit CXmlReadArchiveBase(const CArchiveTag& rootTag);
35 
41  bool InternEndTag(const CArchiveTag& tag, bool& wasTagSkipped);
42 
43  virtual bool ReadXmlHeader();
44  virtual bool ReadXmlFooter();
45 
46  // reimplemented (iser::CTextReadArchiveBase)
47  virtual bool ReadTextNode(QByteArray& text);
48 
49  // abstract methods
58  virtual bool ReadToDelimeter(
59  const QByteArray& delimeters,
60  QByteArray& result,
61  bool skipDelimeter = true,
62  char* foundDelimeterPtr = NULL) = 0;
63 
64 private:
65  CArchiveTag m_rootTag;
66 
67  bool m_isSeparatorNeeded;
68  bool m_isTagEmpty;
69 };
70 
71 
72 } // namespace iser
73 
74 
75 #endif // !iser_CXmlReadArchiveBase_included
76 
77 
virtual bool ReadXmlHeader()
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 ReadXmlFooter()
virtual bool ReadToDelimeter(const QByteArray &delimeters, QByteArray &result, bool skipDelimeter=true, char *foundDelimeterPtr=NULL)=0
Read input stream till one of specified delimeters is found.
bool InternEndTag(const CArchiveTag &tag, bool &wasTagSkipped)
Extended implementation of EndTag() with additional flag signalizing that tag is skipped.
virtual bool ReadTextNode(QByteArray &text)
Read single unformatted text node.
CTextReadArchiveBase BaseClass
CXmlReadArchiveBase(const CArchiveTag &rootTag)
virtual bool Process(bool &value)
Process primitive type.
virtual bool Process(QByteArray &value)
Process primitive type.
virtual bool IsTagSkippingSupported() const
Check if skiping to the end of tag on EndTag is supported.
virtual bool EndTag(const CArchiveTag &tag)
End of archive tag.
Base class for XML based reading archives.
Common archive implementation of text-based reading archives.
#define NULL
Definition: istd.h:64
Base class for all XML implementations for ACF documents.
virtual bool BeginTag(const CArchiveTag &tag)
Begin of archive tag.
Process tag used to group data in archive stream.
Definition: CArchiveTag.h:21

© 2007-2017 Witold Gantzke and Kirill Lepskiy