Qt Utilities: misc/xmlparsermacros.h File Reference

Qt Utilities 6.21.2 Common Qt related C++ classes and routines used by my applications such as dialogs, widgets and models

Loading...
Searching...
No Matches
Macros
xmlparsermacros.h File Reference

Macros to utilize XML parsing using QXmlStreamReader. More...

`#include "./undefxmlparsermacros.h"`
Include dependency graph for xmlparsermacros.h:

Go to the source code of this file.

## Macros
#define | iftag(tagName)
#define | eliftag(tagName)
#define | else_skip
#define | children while (xmlReader.readNextStartElement())
#define | text (xmlReader.readElementText(QXmlStreamReader::ErrorOnUnexpectedElement))
#define | attribute(attributeName)
#define | attributeFlag(attributeName)

## Detailed Description

Macros to utilize XML parsing using QXmlStreamReader.

See also
  For an example, see dbquery.cpp of the tageditor project.

Definition in file xmlparsermacros.h.

## Macro Definition Documentation

## ◆ attribute

#define attribute | ( |  | attributeName | ) |

Value:
(xmlReader.attributes().value(QLatin1String(attributeName)))

Definition at line 19 of file xmlparsermacros.h.

## ◆ attributeFlag

#define attributeFlag | ( |  | attributeName | ) |

Value:
(xmlReader.attributes().hasAttribute(QLatin1String(attributeName)) \
&& xmlReader.attributes().value(QLatin1String(attributeName)) != QLatin1String("false"))

Definition at line 20 of file xmlparsermacros.h.

## ◆ children

#define children while (xmlReader.readNextStartElement())

Definition at line 17 of file xmlparsermacros.h.

## ◆ eliftag

#define eliftag | ( |  | tagName | ) |

Value:
else if (xmlReader.name() == QLatin1String(tagName))

Definition at line 11 of file xmlparsermacros.h.

## ◆ else_skip

#define else_skip

Value:
else \
{ \
xmlReader.skipCurrentElement(); \
}

Definition at line 12 of file xmlparsermacros.h.

## ◆ iftag

#define iftag | ( |  | tagName | ) |

Value:
if (xmlReader.name() == QLatin1String(tagName))

Definition at line 10 of file xmlparsermacros.h.

## ◆ text

#define text (xmlReader.readElementText(QXmlStreamReader::ErrorOnUnexpectedElement))

Definition at line 18 of file xmlparsermacros.h.