MythTV  master
mythxmlserialiser.h
Go to the documentation of this file.
1 #ifndef MYTHXMLSERIALISER_H
2 #define MYTHXMLSERIALISER_H
3 
4 // Qt
5 #include <QXmlStreamWriter>
6 
7 // MythTV
9 
10 #define XML_SERIALIZER_VERSION "1.1"
11 
13 {
14  public:
15  MythXMLSerialiser(const QString& Name, const QVariant& Value);
16 
17  protected:
18  void AddObject (const QString& Name, const QVariant& Value);
19  void AddValue (const QString& Name, const QVariant& Value);
20  void AddQObject (const QObject* Object);
21  void AddStringList(const QVariant& Values);
22  void AddList (const QString& Name, const QVariant& Values);
23  void AddMap (const QString& Name, const QVariantMap& Map);
24  void AddProperty (const QString& Name, const QVariant& Value,
25  const QMetaObject* MetaObject, const QMetaProperty* MetaProperty);
26 
27  private:
28  Q_DISABLE_COPY(MythXMLSerialiser)
29  static QString GetItemName(const QString& Name);
30  static QString GetContentName(const QString &Name, const QMetaObject* MetaObject);
31  QXmlStreamWriter m_writer;
32  bool m_first { true };
33 };
34 
35 #endif
MythXMLSerialiser::AddValue
void AddValue(const QString &Name, const QVariant &Value)
Definition: mythxmlserialiser.cpp:35
MythXMLSerialiser::GetContentName
static QString GetContentName(const QString &Name, const QMetaObject *MetaObject)
FIXME We shouldn't be doing this on the fly.
Definition: mythxmlserialiser.cpp:182
MythXMLSerialiser::AddObject
void AddObject(const QString &Name, const QVariant &Value)
Definition: mythxmlserialiser.cpp:21
MythXMLSerialiser::AddQObject
void AddQObject(const QObject *Object)
Definition: mythxmlserialiser.cpp:84
MythXMLSerialiser::GetItemName
static QString GetItemName(const QString &Name)
Definition: mythxmlserialiser.cpp:172
MythSerialiser
Definition: mythserialiser.h:14
MythXMLSerialiser::AddMap
void AddMap(const QString &Name, const QVariantMap &Map)
Definition: mythxmlserialiser.cpp:156
MythXMLSerialiser::m_writer
QXmlStreamWriter m_writer
Definition: mythxmlserialiser.h:31
mythserialiser.h
MythXMLSerialiser::AddList
void AddList(const QString &Name, const QVariant &Values)
Definition: mythxmlserialiser.cpp:145
Name
Definition: channelsettings.cpp:71
MythXMLSerialiser
Definition: mythxmlserialiser.h:12
MythXMLSerialiser::AddProperty
void AddProperty(const QString &Name, const QVariant &Value, const QMetaObject *MetaObject, const QMetaProperty *MetaProperty)
Definition: mythxmlserialiser.cpp:117
MythXMLSerialiser::m_first
bool m_first
Definition: mythxmlserialiser.h:32
MythXMLSerialiser::AddStringList
void AddStringList(const QVariant &Values)
Definition: mythxmlserialiser.cpp:134
MythXMLSerialiser::MythXMLSerialiser
MythXMLSerialiser(const QString &Name, const QVariant &Value)
Definition: mythxmlserialiser.cpp:10