55 m_xmlStream.writeStartDocument(QStringLiteral(
"1.0"));
76 switch(static_cast<QMetaType::Type>(Value.type()))
78 case QMetaType::QVariantList:
ListToXML(Name, Value.toList());
return;
79 case QMetaType::QStringList:
StringListToXML(Name, Value.toStringList());
return;
80 case QMetaType::QVariantMap:
MapToXML(Name, Value.toMap());
return;
81 case (QVariant::Type)QMetaType::QDateTime:
83 QDateTime datetime(Value.toDateTime());
84 if (datetime.isNull())
85 m_xmlStream.writeAttribute(QStringLiteral(
"xsi:nil"), QStringLiteral(
"true"));
86 m_xmlStream.writeCharacters(datetime.toString(Qt::ISODate));
89 default:
m_xmlStream.writeCharacters(Value.toString());
return;
97 int type = Value[0].type();
98 QVariantList::const_iterator it = Value.begin();
99 for ( ; it != Value.end(); ++it)
101 if ((
int)(*it).type() != type)
109 QVariantList::const_iterator it = Value.begin();
110 for ( ; it != Value.end(); ++it)
122 QStringList::const_iterator it = Value.begin();
123 for ( ; it != Value.end(); ++it)
125 m_xmlStream.writeStartElement(QStringLiteral(
"String"));
133 QVariantMap::const_iterator it = Value.begin();
134 for ( ; it != Value.end(); ++it)
void VariantToXML(const QString &Name, const QVariant &Value)
virtual void End(QByteArray &Dest) override
void StringListToXML(const QString &Name, const QStringList &Value)
void ListToXML(const QString &Name, const QVariantList &Value)
virtual void Begin(QByteArray &Dest) override
TorcSerialiser * Create(void)
virtual void AddProperty(QByteArray &Dest, const QString &Name, const QVariant &Value) override
TorcXMLSerialiserFactory TorcXMLSerialiserFactory
void MapToXML(const QString &Name, const QVariantMap &Value)
virtual HTTPResponseType ResponseType(void) override
QXmlStreamWriter m_xmlStream
virtual void Prepare(QByteArray &Dest) override
TorcXMLSerialiserFactory()