11 #include <QLoggingCategory>
12 #include <QSharedPointer>
14 #include <QXmlStreamReader>
17 Q_DECLARE_LOGGING_CATEGORY(paos)
19 class test_ElementParser;
26 friend class ::test_ElementParser;
29 explicit ElementParser(QSharedPointer<QXmlStreamReader> pXmlReader);
63 template<
typename T>
bool assertMandatoryList(
const QVector<T>& pList,
const char*
const pElementName);
98 void initData(
const QByteArray& pXmlData);
103 QSharedPointer<QXmlStreamReader> mXmlReader;
112 qCWarning(paos) <<
"Mandatory list is empty:" << pElementName;
Definition: ConnectionHandle.h:15
Definition: ElementParser.h:25
ConnectionHandle parseConnectionHandle()
Definition: ElementParser.cpp:123
QStringView getElementTypeByNamespace(const QString &pNamespace) const
Definition: ElementParser.cpp:103
bool parserFailed() const
Definition: ElementParser.cpp:21
bool readNextStartElement()
Like QXmlStreamReader::readNextStartElement(), but also checks mParseError.
Definition: ElementParser.cpp:27
void assertMandatoryElement(const QString &pValue, const char *const pElementName)
Issues a log warning and sets the error when the element has not been set, i.e.
Definition: ElementParser.cpp:67
ElementParser(QSharedPointer< QXmlStreamReader > pXmlReader)
Definition: ElementParser.cpp:11
QString readElementText()
Returns the text (simplified()) between the current start element and the corresponding end element.
Definition: ElementParser.cpp:33
bool assertMandatoryList(const QVector< T > &pList, const char *const pElementName)
Issues a log warning and sets the error when the list is empty.
Definition: ElementParser.h:108
QStringView getElementName() const
Returns the name of the current element and issues a log message with it.
Definition: ElementParser.cpp:95
bool assertNoDuplicateElement(bool pNotYetSeen)
Issues a log warning and sets the error when a duplicate element has been encountered.
Definition: ElementParser.cpp:55
void initData(const QByteArray &pXmlData)
Definition: ElementParser.cpp:109
void skipCurrentElement() const
Skips parsing of the current element Used to ignore unknown or unrecognized elements while parsing.
Definition: ElementParser.cpp:89
bool readUniqueElementText(QString &pText)
Returns the text (simplified()) between the current start element and the corresponding end element,...
Definition: ElementParser.cpp:77
void setParserFailed()
Definition: ElementParser.cpp:117
Implementation of GeneralAuthenticate response APDUs.
Definition: CommandApdu.h:16