diff --git a/GUI/Model/Util/UtilXML.cpp b/GUI/Model/Util/UtilXML.cpp index b574c611cbbb05d89ba496288f2f990117fb87fc..d8bea517c02e3ff855665343b1c3890a8552a3f3 100644 --- a/GUI/Model/Util/UtilXML.cpp +++ b/GUI/Model/Util/UtilXML.cpp @@ -140,3 +140,46 @@ complex_t XML::readC(QXmlStreamReader* reader, const QString& attributeBaseName) double i = readDouble(reader, attributeBaseName + "Im"); return {r, i}; } + +bool XML::readTaggedBool(QXmlStreamReader* reader, const QString& tag) +{ + bool result = XML::readBool(reader, XML::Attrib::value); + XML::gotoEndElementOfTag(reader, tag); + return result; +} +int XML::readTaggedInt(QXmlStreamReader* reader, const QString& tag) +{ + int result = XML::readInt(reader, XML::Attrib::value); + XML::gotoEndElementOfTag(reader, tag); + return result; +} +unsigned XML::readTaggedUInt(QXmlStreamReader* reader, const QString& tag) +{ + unsigned result = XML::readUInt(reader, XML::Attrib::value); + XML::gotoEndElementOfTag(reader, tag); + return result; +} +size_t XML::readTaggedSize(QXmlStreamReader* reader, const QString& tag) +{ + size_t result = XML::readSize(reader, XML::Attrib::value); + XML::gotoEndElementOfTag(reader, tag); + return result; +} +double XML::readTaggedDouble(QXmlStreamReader* reader, const QString& tag) +{ + double result = XML::readDouble(reader, XML::Attrib::value); + XML::gotoEndElementOfTag(reader, tag); + return result; +} +QString XML::readTaggedString(QXmlStreamReader* reader, const QString& tag) +{ + QString result = XML::readString(reader, XML::Attrib::value); + XML::gotoEndElementOfTag(reader, tag); + return result; +} +QColor XML::readTaggedColor(QXmlStreamReader* reader, const QString& tag) +{ + QColor result = XML::readColor(reader, XML::Attrib::value); + XML::gotoEndElementOfTag(reader, tag); + return result; +} diff --git a/GUI/Model/Util/UtilXML.h b/GUI/Model/Util/UtilXML.h index 43901e1912b609d51582a9e69e335ab120449592..253a7024e4915db0941456ad78cb7a95123240f9 100644 --- a/GUI/Model/Util/UtilXML.h +++ b/GUI/Model/Util/UtilXML.h @@ -70,6 +70,14 @@ double readDouble(QXmlStreamReader* reader, const QString& attributeName); QString readString(QXmlStreamReader* reader, const QString& attributeName); QColor readColor(QXmlStreamReader* reader, const QString& attributeName); +bool readTaggedBool(QXmlStreamReader* reader, const QString& tag); +int readTaggedInt(QXmlStreamReader* reader, const QString& tag); +unsigned readTaggedUInt(QXmlStreamReader* reader, const QString& tag); +size_t readTaggedSize(QXmlStreamReader* reader, const QString& tag); +double readTaggedDouble(QXmlStreamReader* reader, const QString& tag); +QString readTaggedString(QXmlStreamReader* reader, const QString& tag); +QColor readTaggedColor(QXmlStreamReader* reader, const QString& tag); + // TODO: will the following remain unused? R3 readR3(QXmlStreamReader* reader, const QString& attributeBaseName); complex_t readC(QXmlStreamReader* reader, const QString& attributeBaseName);