15 #ifndef BORNAGAIN_GUI_SUPPORT_XML_UTILXML_H
16 #define BORNAGAIN_GUI_SUPPORT_XML_UTILXML_H
19 #include <QXmlStreamWriter>
20 #include <heinz/Complex.h>
21 #include <heinz/Vectors3D.h>
23 class QXmlStreamReader;
31 constexpr
auto Id(
"id");
52 void writeVariant(QXmlStreamWriter* writer, QVariant variant,
int role);
55 void writeAttribute(QXmlStreamWriter* writer,
const QString& attributeName,
56 const QVariant& variant);
58 void writeUid(QXmlStreamWriter* writer,
const QString&
id);
59 void writeUid(QXmlStreamWriter* writer,
const QUuid&
id);
60 void writeAttribute(QXmlStreamWriter* writer,
const QString& attributeName,
int d);
61 void writeAttribute(QXmlStreamWriter* writer,
const QString& attributeName,
unsigned d);
62 void writeAttribute(QXmlStreamWriter* writer,
const QString& attributeName,
double d);
63 void writeAttribute(QXmlStreamWriter* writer,
const QString& attributeBaseName,
const R3& vec);
64 void writeAttribute(QXmlStreamWriter* writer,
const QString& attributeBaseName,
const complex_t& c);
67 unsigned readUIntAttribute(QXmlStreamReader* reader,
const QString& attributeName);
69 void readAttribute(QXmlStreamReader* reader,
const QString& attributeName,
double* d);
70 void readAttribute(QXmlStreamReader* reader,
const QString& attributeName, QString* s);
71 void readAttribute(QXmlStreamReader* reader,
const QString& attributeName, QColor* c);
72 void readAttribute(QXmlStreamReader* reader,
const QString& attributeBaseName, R3* vec);
73 void readAttribute(QXmlStreamReader* reader,
const QString& attributeBaseName, complex_t* c);
The service to collect messages from different senders.
void writeVariant(QXmlStreamWriter *writer, QVariant variant, int role)
Write the variant as a complete tag, including the given role.
void readAttribute(QXmlStreamReader *reader, const QString &attributeName, double *d)
bool readBoolAttribute(QXmlStreamReader *reader, const QString &attributeName)
void writeUid(QXmlStreamWriter *writer, const QString &id)
constexpr auto Version("Version")
void writeAttribute(QXmlStreamWriter *writer, const QString &attributeName, const QVariant &variant)
Write the variant's value as an attribute.
void gotoEndElementOfTag(QXmlStreamReader *reader, const QString &tag)
void assertExpectedTag(QXmlStreamReader *reader, const QString &tag)
unsigned readUIntAttribute(QXmlStreamReader *reader, const QString &attributeName)