qtutilities/misc/xmlparsermacros.h

16 lines
690 B
C
Raw Normal View History

2016-03-03 01:43:48 +01:00
/*!
* \file xmlparsermacros.h
* \brief Macros to utilize XML parsing using QXmlStreamReader.
* \sa For an example, see dbquery.cpp of the tageditor project.
*/
// ensure there are no conflicting macros defined
#include "./undefxmlparsermacros.h"
2016-03-03 01:43:48 +01:00
#define iftag(tagName) if(xmlReader.name() == QLatin1String(tagName))
#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))