ACF $AcfVersion:0$
CXmlDocumentInfoBase.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// Qt includes
6#include <QtCore/QString>
7#include <QtCore/QMap>
8
9
10namespace iser
11{
12
13
19{
20public:
22
27 bool IsCommentEnabled() const;
32 void SetCommentEnabled(bool state = true);
33
34 // static methods
35 static void EncodeXml(const QByteArray& text, QByteArray& xmlText);
36 static void DecodeXml(const QByteArray& xmlText, QByteArray& text);
37 static void EncodeXml(const QString& text, QByteArray& xmlText);
38 static void DecodeXml(const QByteArray& xmlText, QString& text);
39 static const QString& GetElementSeparator();
40
41protected:
42 class CharToEntityMap: public QMap<char, QByteArray>
43 {
44 public:
46 };
47
48 class EntityToChartMap: public QMap<QByteArray, char>
49 {
50 public:
52 };
53
54 class WideCharToEntityMap: public QMap<QChar, QByteArray >
55 {
56 public:
58 };
59
60 class EntityToWideChartMap: public QMap<QByteArray, QChar>
61 {
62 public:
64 };
65
66private:
67 bool m_isCommentEnabled;
68
69 static CharToEntityMap s_charToEntityMap;
70 static EntityToChartMap s_entityToChartMap;
71 static WideCharToEntityMap s_wideCharToEntityMap;
72 static EntityToWideChartMap s_entityToWideChartMap;
73
74 static QString s_elementSeparator;
75};
76
77
78// inline methods
79
81{
82 return m_isCommentEnabled;
83}
84
85
87{
88 m_isCommentEnabled = state;
89}
90
91
92} // namespace iser
93
94
95
96
Base class for all XML implementations for ACF documents.
static void EncodeXml(const QString &text, QByteArray &xmlText)
static void EncodeXml(const QByteArray &text, QByteArray &xmlText)
bool IsCommentEnabled() const
Check if comments in XML document are enabled.
static void DecodeXml(const QByteArray &xmlText, QString &text)
static const QString & GetElementSeparator()
void SetCommentEnabled(bool state=true)
Allows comments in XML document.
static void DecodeXml(const QByteArray &xmlText, QByteArray &text)
Contains general persistence mechanism with basic archives implementations.