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

#include <jsonSerializer.h>

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

Public Member Functions

 JSONSerializer (QIODevice *pDevice, const QString &sRequestName)
 
virtual ~JSONSerializer ()=default
 
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 ()
 

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 QVariant &vValue)
 
void RenderStringList (const QStringList &list)
 
void RenderList (const QVariantList &list)
 
void RenderMap (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 Encode (const QString &sIn)
 
- Static Protected Member Functions inherited from Serializer
static QString ReadPropertyMetadata (const QObject *pObject, const QString &sPropName, const QString &sKey)
 

Protected Attributes

QTextStream m_Stream
 
bool m_bCommaNeeded {false}
 
- Protected Attributes inherited from Serializer
QCryptographicHash m_hash
 

Detailed Description

Definition at line 31 of file jsonSerializer.h.

Constructor & Destructor Documentation

◆ JSONSerializer()

JSONSerializer::JSONSerializer ( QIODevice *  pDevice,
const QString &  sRequestName 
)
inline

Definition at line 61 of file jsonSerializer.h.

◆ ~JSONSerializer()

virtual JSONSerializer::~JSONSerializer ( )
virtualdefault

Member Function Documentation

◆ BeginSerialize()

void JSONSerializer::BeginSerialize ( QString &  sName)
overrideprotectedvirtual

Reimplemented from Serializer.

Definition at line 33 of file jsonSerializer.cpp.

◆ EndSerialize()

void JSONSerializer::EndSerialize ( void  )
overrideprotectedvirtual

Reimplemented from Serializer.

Definition at line 44 of file jsonSerializer.cpp.

◆ BeginObject()

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

Implements Serializer.

Definition at line 58 of file jsonSerializer.cpp.

◆ EndObject()

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

Implements Serializer.

Definition at line 69 of file jsonSerializer.cpp.

◆ AddProperty()

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

Implements Serializer.

Definition at line 80 of file jsonSerializer.cpp.

◆ RenderValue()

void JSONSerializer::RenderValue ( const QVariant &  vValue)
protected

Definition at line 99 of file jsonSerializer.cpp.

Referenced by AddProperty(), and RenderList().

◆ RenderStringList()

void JSONSerializer::RenderStringList ( const QStringList &  list)
protected

Definition at line 175 of file jsonSerializer.cpp.

Referenced by RenderValue().

◆ RenderList()

void JSONSerializer::RenderList ( const QVariantList &  list)
protected

Definition at line 150 of file jsonSerializer.cpp.

Referenced by RenderValue().

◆ RenderMap()

void JSONSerializer::RenderMap ( const QVariantMap &  map)
protected

Definition at line 200 of file jsonSerializer.cpp.

Referenced by RenderValue().

◆ Encode()

QString JSONSerializer::Encode ( const QString &  sIn)
staticprotected

Definition at line 228 of file jsonSerializer.cpp.

Referenced by RenderMap(), RenderStringList(), and RenderValue().

◆ GetContentType()

QString JSONSerializer::GetContentType ( )
overridevirtual

Implements Serializer.

Definition at line 23 of file jsonSerializer.cpp.

Member Data Documentation

◆ m_Stream

QTextStream JSONSerializer::m_Stream
protected

◆ m_bCommaNeeded

bool JSONSerializer::m_bCommaNeeded {false}
protected

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