AusweisApp2
governikus::ElementParser Klassenreferenz

#include <ElementParser.h>

Klassendiagramm für governikus::ElementParser:

Öffentliche Methoden

 ElementParser (QSharedPointer< QXmlStreamReader > pXmlReader)
 
virtual ~ElementParser ()
 
bool parserFailed () const
 

Geschützte Methoden

bool readNextStartElement ()
 Like QXmlStreamReader::readNextStartElement(), but also checks mParseError. Mehr ...
 
QString readElementText ()
 Returns the text (simplified()) between the current start element and the corresponding end element. Mehr ...
 
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. Mehr ...
 
template<typename T >
bool assertMandatoryList (const QVector< T > &pList, const char *const pElementName)
 Issues a log warning and sets the error when the list is empty. Mehr ...
 
bool assertNoDuplicateElement (bool pNotYetSeen)
 Issues a log warning and sets the error when a duplicate element has been encountered. Mehr ...
 
bool readUniqueElementText (QString &pText)
 Returns the text (simplified()) between the current start element and the corresponding end element, if the element has not been encountered yet. Mehr ...
 

Geschützte Attribute

QSharedPointer< QXmlStreamReader > mXmlReader
 
bool mParseError
 

Beschreibung der Konstruktoren und Destruktoren

◆ ElementParser()

ElementParser::ElementParser ( QSharedPointer< QXmlStreamReader >  pXmlReader)
explicit

◆ ~ElementParser()

ElementParser::~ElementParser ( )
virtualdefault

Dokumentation der Elementfunktionen

◆ assertMandatoryElement()

void ElementParser::assertMandatoryElement ( const QString &  pValue,
const char *const  pElementName 
)
protected

Issues a log warning and sets the error when the element has not been set, i.e.

the element is null.

Parameter
pValuethe elements value to check.
pElementNamethe elements name used to generate the log message.

◆ assertMandatoryList()

template<typename T >
bool governikus::ElementParser::assertMandatoryList ( const QVector< T > &  pList,
const char *const  pElementName 
)
protected

Issues a log warning and sets the error when the list is empty.

Parameter
pListthe list to check.
pElementNamethe elements name used to generate the log message.
Rückgabe
true, if the assertion holds, false otherwise.

◆ assertNoDuplicateElement()

bool ElementParser::assertNoDuplicateElement ( bool  pNotYetSeen)
protected

Issues a log warning and sets the error when a duplicate element has been encountered.

Parameter
pNotYetSeenIndicates whether the element has not yet been seen.
Rückgabe
true, if the assertion holds, false otherwise.
Hier ist ein Graph der zeigt, wo diese Funktion aufgerufen wird:

◆ parserFailed()

bool ElementParser::parserFailed ( ) const
Hier ist ein Graph der zeigt, wo diese Funktion aufgerufen wird:

◆ readElementText()

QString ElementParser::readElementText ( )
protected

Returns the text (simplified()) between the current start element and the corresponding end element.

Rückgabe
The element text on success (may be isEmpty(), but not isNull()), QString() on error.
Hier ist ein Graph der zeigt, wo diese Funktion aufgerufen wird:

◆ readNextStartElement()

bool ElementParser::readNextStartElement ( )
protected

Like QXmlStreamReader::readNextStartElement(), but also checks mParseError.

Rückgabe
true, if a next start element was found, false, if the end element was reached or an error occurred.
Hier ist ein Graph der zeigt, wo diese Funktion aufgerufen wird:

◆ readUniqueElementText()

bool ElementParser::readUniqueElementText ( QString &  pText)
protected

Returns the text (simplified()) between the current start element and the corresponding end element, if the element has not been encountered yet.

Parameter
pTextThe variable that is set to the read text. It is also used as an indicator whether the element has not yet been encountered (isNull()).
Rückgabe
true, if the element has not yet been encountered and the element text could be read, false otherwise.
Hier ist ein Graph, der zeigt, was diese Funktion aufruft:
Hier ist ein Graph der zeigt, wo diese Funktion aufgerufen wird:

Dokumentation der Datenelemente

◆ mParseError

bool governikus::ElementParser::mParseError
protected

◆ mXmlReader

QSharedPointer<QXmlStreamReader> governikus::ElementParser::mXmlReader
protected

Die Dokumentation für diese Klasse wurde erzeugt aufgrund der Dateien: