MythTV  master
Public Member Functions | Public Attributes | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Private Member Functions | List of all members
XmlSerializer Class Reference

#include <xmlSerializer.h>

Inheritance diagram for XmlSerializer:
Inheritance graph
[legend]
Collaboration diagram for XmlSerializer:
Collaboration graph
[legend]

Public Member Functions

 XmlSerializer (QIODevice *pDevice, const QString &sRequestName)
 
virtual ~XmlSerializer ()
 
QString GetContentType () override
 
- Public Member Functions inherited from Serializer
virtual void Serialize (const QObject *pObject, const QString &_sName=QString())
 
virtual void Serialize (const QVariant &vValue, const QString &sName)
 
virtual void AddHeaders (QStringMap &headers)
 
 Serializer ()
 

Public Attributes

bool PropertiesAsAttributes {true}
 

Protected Member Functions

void BeginSerialize (QString &sName) override
 
void EndSerialize () override
 
void BeginObject (const QString &sName, const QObject *pObject) override
 
void EndObject (const QString &sName, const QObject *pObject) override
 
void AddProperty (const QString &sName, const QVariant &vValue, const QMetaObject *pMetaParent, const QMetaProperty *pMetaProp) override
 
void RenderValue (const QString &sName, const QVariant &vValue)
 
void RenderEnum (const QString &sName, const QVariant &vValue, const QMetaProperty *pMetaProp)
 
void RenderStringList (const QString &sName, const QStringList &list)
 
void RenderList (const QString &sName, const QVariantList &list)
 
void RenderMap (const QString &sName, const QVariantMap &map)
 
- Protected Member Functions inherited from Serializer
void SerializeObject (const QObject *pObject, const QString &sName)
 
void SerializeObjectProperties (const QObject *pObject)
 

Static Protected Member Functions

static QString GetItemName (const QString &sName)
 
static QString GetContentName (const QString &sName, const QMetaObject *pMetaObject, const QMetaProperty *pMetaProp)
 
static QString FindOptionValue (const QStringList &sOptions, const QString &sName)
 
- Static Protected Member Functions inherited from Serializer
static QString ReadPropertyMetadata (const QObject *pObject, const QString &sPropName, const QString &sKey)
 

Protected Attributes

QXmlStreamWriter * m_pXmlWriter {nullptr}
 
QString m_sRequestName
 
bool m_bIsRoot {true}
 
- Protected Attributes inherited from Serializer
QCryptographicHash m_hash
 

Private Member Functions

 XmlSerializer (const XmlSerializer &)=delete
 
XmlSerializeroperator= (const XmlSerializer &)=delete
 

Detailed Description

Definition at line 32 of file xmlSerializer.h.

Constructor & Destructor Documentation

◆ XmlSerializer() [1/2]

XmlSerializer::XmlSerializer ( QIODevice *  pDevice,
const QString &  sRequestName 
)

Definition at line 29 of file xmlSerializer.cpp.

◆ ~XmlSerializer()

XmlSerializer::~XmlSerializer ( )
virtual

Definition at line 39 of file xmlSerializer.cpp.

◆ XmlSerializer() [2/2]

XmlSerializer::XmlSerializer ( const XmlSerializer )
privatedelete

Member Function Documentation

◆ BeginSerialize()

void XmlSerializer::BeginSerialize ( QString &  sName)
overrideprotectedvirtual

Reimplemented from Serializer.

Definition at line 61 of file xmlSerializer.cpp.

◆ EndSerialize()

void XmlSerializer::EndSerialize ( void  )
overrideprotectedvirtual

Reimplemented from Serializer.

Definition at line 71 of file xmlSerializer.cpp.

◆ BeginObject()

void XmlSerializer::BeginObject ( const QString &  sName,
const QObject *  pObject 
)
overrideprotectedvirtual

Implements Serializer.

Definition at line 80 of file xmlSerializer.cpp.

◆ EndObject()

void XmlSerializer::EndObject ( const QString &  sName,
const QObject *  pObject 
)
overrideprotectedvirtual

Implements Serializer.

Definition at line 109 of file xmlSerializer.cpp.

◆ AddProperty()

void XmlSerializer::AddProperty ( const QString &  sName,
const QVariant &  vValue,
const QMetaObject *  pMetaParent,
const QMetaProperty *  pMetaProp 
)
overrideprotectedvirtual

Implements Serializer.

Definition at line 118 of file xmlSerializer.cpp.

◆ RenderValue()

void XmlSerializer::RenderValue ( const QString &  sName,
const QVariant &  vValue 
)
protected

Definition at line 165 of file xmlSerializer.cpp.

Referenced by AddProperty(), RenderList(), and RenderMap().

◆ RenderEnum()

void XmlSerializer::RenderEnum ( const QString &  sName,
const QVariant &  vValue,
const QMetaProperty *  pMetaProp 
)
protected

Definition at line 140 of file xmlSerializer.cpp.

Referenced by AddProperty().

◆ RenderStringList()

void XmlSerializer::RenderStringList ( const QString &  sName,
const QStringList &  list 
)
protected

Definition at line 253 of file xmlSerializer.cpp.

Referenced by RenderValue().

◆ RenderList()

void XmlSerializer::RenderList ( const QString &  sName,
const QVariantList &  list 
)
protected

Definition at line 230 of file xmlSerializer.cpp.

Referenced by RenderValue().

◆ RenderMap()

void XmlSerializer::RenderMap ( const QString &  sName,
const QVariantMap &  map 
)
protected

Definition at line 269 of file xmlSerializer.cpp.

Referenced by RenderValue().

◆ GetItemName()

QString XmlSerializer::GetItemName ( const QString &  sName)
staticprotected

◆ GetContentName()

QString XmlSerializer::GetContentName ( const QString &  sName,
const QMetaObject *  pMetaObject,
const QMetaProperty *  pMetaProp 
)
staticprotected

Definition at line 321 of file xmlSerializer.cpp.

Referenced by AddProperty().

◆ FindOptionValue()

QString XmlSerializer::FindOptionValue ( const QStringList &  sOptions,
const QString &  sName 
)
staticprotected

Definition at line 363 of file xmlSerializer.cpp.

Referenced by GetContentName().

◆ GetContentType()

QString XmlSerializer::GetContentType ( )
overridevirtual

Implements Serializer.

Definition at line 52 of file xmlSerializer.cpp.

◆ operator=()

XmlSerializer& XmlSerializer::operator= ( const XmlSerializer )
privatedelete

Member Data Documentation

◆ m_pXmlWriter

QXmlStreamWriter* XmlSerializer::m_pXmlWriter {nullptr}
protected

◆ m_sRequestName

QString XmlSerializer::m_sRequestName
protected

Definition at line 38 of file xmlSerializer.h.

Referenced by XmlSerializer().

◆ m_bIsRoot

bool XmlSerializer::m_bIsRoot {true}
protected

Definition at line 39 of file xmlSerializer.h.

Referenced by BeginObject().

◆ PropertiesAsAttributes

bool XmlSerializer::PropertiesAsAttributes {true}

Definition at line 74 of file xmlSerializer.h.


The documentation for this class was generated from the following files: