ACF $AcfVersion:0$
CXmlReadArchiveBase.h
Go to the documentation of this file.
1// SPDX-License-Identifier: LGPL-2.1-or-later OR GPL-2.0-or-later OR GPL-3.0-or-later OR LicenseRef-ACF-Commercial
2#pragma once
3
4
5// ACF includes
8
9
10namespace iser
11{
12
13
20{
21public:
23
24 // reimplemented (iser::IArchive)
25 virtual bool IsTagSkippingSupported() const override;
26 virtual bool BeginTag(const CArchiveTag& tag) override;
27 virtual bool BeginMultiTag(const CArchiveTag& tag, const CArchiveTag& subTag, int& count) override;
28 virtual bool EndTag(const CArchiveTag& tag) override;
29 virtual bool Process(QByteArray& value) override;
30 virtual bool Process(QString& value) override;
32
33protected:
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) override;
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
64private:
65 CArchiveTag m_rootTag;
66
67 bool m_isSeparatorNeeded;
68 bool m_isTagEmpty;
69};
70
71
72} // namespace iser
73
74
75
76
Process tag used to group data in archive stream.
Definition CArchiveTag.h:22
Common archive implementation of text-based reading archives.
virtual bool Process(bool &value) override
Processes (reads or writes) a boolean value.
Base class for all XML implementations for ACF documents.
Base class for XML based reading archives.
virtual bool BeginTag(const CArchiveTag &tag) override
Begins a tagged section in the archive.
virtual bool IsTagSkippingSupported() const override
Checks if skipping to the end of a tag on EndTag() is supported.
CTextReadArchiveBase BaseClass
virtual bool ReadTextNode(QByteArray &text) override
Read single unformatted text node.
bool InternEndTag(const CArchiveTag &tag, bool &wasTagSkipped)
Extended implementation of EndTag() with additional flag signalizing that tag is skipped.
CXmlReadArchiveBase(const CArchiveTag &rootTag)
virtual bool Process(QString &value) override
Process primitive type.
virtual bool ReadXmlHeader()
virtual bool ReadXmlFooter()
virtual bool EndTag(const CArchiveTag &tag) override
Ends a tagged section in the archive.
virtual bool BeginMultiTag(const CArchiveTag &tag, const CArchiveTag &subTag, int &count) override
Begins a tagged section containing multiple elements of the same type.
virtual bool Process(QByteArray &value) override
Process primitive type.
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.
#define NULL
Definition istd.h:74
Contains general persistence mechanism with basic archives implementations.