Improve macros for XML parsing

This commit is contained in:
Martchus 2016-08-31 23:39:04 +02:00
parent 58fad82c3b
commit b51b53190b
1 changed files with 3 additions and 2 deletions

View File

@ -11,5 +11,6 @@
#define eliftag(tagName) else if(xmlReader.name() == QLatin1String(tagName))
#define else_skip else { xmlReader.skipCurrentElement(); }
#define children while(xmlReader.readNextStartElement())
#define text xmlReader.readElementText(QXmlStreamReader::ErrorOnUnexpectedElement)
#define attribute(attributeName) xmlReader.attributes().value(QLatin1String(attributeName))
#define text (xmlReader.readElementText(QXmlStreamReader::ErrorOnUnexpectedElement))
#define attribute(attributeName) (xmlReader.attributes().value(QLatin1String(attributeName)))
#define attributeFlag(attributeName) (xmlReader.attributes().hasAttribute(QLatin1String(attributeName)) && xmlReader.attributes().value(QLatin1String(attributeName)) != QLatin1String("false"))