Torc  0.1
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
TorcXMLSerialiser Class Reference

A serialiser for XML formatted output. More...

#include <torcxmlserialiser.h>

Inheritance diagram for TorcXMLSerialiser:
[legend]

Public Member Functions

 TorcXMLSerialiser ()
 
virtual ~TorcXMLSerialiser ()=default
 
virtual HTTPResponseType ResponseType (void) override
 
- Public Member Functions inherited from TorcSerialiser
 TorcSerialiser ()=default
 
virtual ~TorcSerialiser ()=default
 
void Serialise (QByteArray &Dest, const QVariant &Data, const QString &Type=QString())
 

Protected Member Functions

virtual void Prepare (QByteArray &Dest) override
 
virtual void Begin (QByteArray &Dest) override
 
virtual void AddProperty (QByteArray &Dest, const QString &Name, const QVariant &Value) override
 
virtual void End (QByteArray &Dest) override
 
void VariantToXML (const QString &Name, const QVariant &Value)
 
void ListToXML (const QString &Name, const QVariantList &Value)
 
void StringListToXML (const QString &Name, const QStringList &Value)
 
void MapToXML (const QString &Name, const QVariantMap &Value)
 

Protected Attributes

QXmlStreamWriter m_xmlStream
 
QBuffer m_buffer
 

Additional Inherited Members

- Static Public Member Functions inherited from TorcSerialiser
static TorcSerialiserGetSerialiser (const QString &MimeType)
 

Detailed Description

A serialiser for XML formatted output.

TorcXMLSerialiser uses QXmlStreamWriter for the bulk of the serialisation overhead.

Todo:
Ensure complete consistency and interopability with all other serialisers.

Definition at line 11 of file torcxmlserialiser.h.

Constructor & Destructor Documentation

TorcXMLSerialiser::TorcXMLSerialiser ( )

Definition at line 33 of file torcxmlserialiser.cpp.

virtual TorcXMLSerialiser::~TorcXMLSerialiser ( )
virtualdefault

Member Function Documentation

void TorcXMLSerialiser::AddProperty ( QByteArray &  Dest,
const QString &  Name,
const QVariant &  Value 
)
overrideprotectedvirtual

Implements TorcSerialiser.

Reimplemented in TorcPListSerialiser.

Definition at line 64 of file torcxmlserialiser.cpp.

void TorcXMLSerialiser::Begin ( QByteArray &  Dest)
overrideprotectedvirtual

Implements TorcSerialiser.

Reimplemented in TorcPListSerialiser.

Definition at line 52 of file torcxmlserialiser.cpp.

void TorcXMLSerialiser::End ( QByteArray &  Dest)
overrideprotectedvirtual

Implements TorcSerialiser.

Reimplemented in TorcPListSerialiser.

Definition at line 58 of file torcxmlserialiser.cpp.

void TorcXMLSerialiser::ListToXML ( const QString &  Name,
const QVariantList &  Value 
)
protected

Definition at line 93 of file torcxmlserialiser.cpp.

void TorcXMLSerialiser::MapToXML ( const QString &  Name,
const QVariantMap &  Value 
)
protected

Definition at line 131 of file torcxmlserialiser.cpp.

void TorcXMLSerialiser::Prepare ( QByteArray &  Dest)
overrideprotectedvirtual

Implements TorcSerialiser.

Definition at line 45 of file torcxmlserialiser.cpp.

HTTPResponseType TorcXMLSerialiser::ResponseType ( void  )
overridevirtual

Implements TorcSerialiser.

Reimplemented in TorcPListSerialiser.

Definition at line 40 of file torcxmlserialiser.cpp.

void TorcXMLSerialiser::StringListToXML ( const QString &  Name,
const QStringList &  Value 
)
protected

Definition at line 118 of file torcxmlserialiser.cpp.

void TorcXMLSerialiser::VariantToXML ( const QString &  Name,
const QVariant &  Value 
)
protected

Definition at line 74 of file torcxmlserialiser.cpp.

Member Data Documentation

QBuffer TorcXMLSerialiser::m_buffer
protected

Definition at line 32 of file torcxmlserialiser.h.

QXmlStreamWriter TorcXMLSerialiser::m_xmlStream
protected

Definition at line 31 of file torcxmlserialiser.h.


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