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

#include <libmythupnp/serializers/jsonSerializer.h>

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

Public Member Functions

 JSONSerializer (QIODevice *pDevice, [[maybe_unused]] 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,
[[maybe_unused] ] 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 32 of file jsonSerializer.cpp.

◆ EndSerialize()

void JSONSerializer::EndSerialize ( )
overrideprotectedvirtual

Reimplemented from Serializer.

Definition at line 43 of file jsonSerializer.cpp.

◆ BeginObject()

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

Implements Serializer.

Definition at line 57 of file jsonSerializer.cpp.

◆ EndObject()

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

Implements Serializer.

Definition at line 68 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 79 of file jsonSerializer.cpp.

◆ RenderValue()

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

Definition at line 98 of file jsonSerializer.cpp.

Referenced by AddProperty(), and RenderList().

◆ RenderStringList()

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

Definition at line 179 of file jsonSerializer.cpp.

Referenced by RenderValue().

◆ RenderList()

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

Definition at line 154 of file jsonSerializer.cpp.

Referenced by RenderValue().

◆ RenderMap()

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

Definition at line 204 of file jsonSerializer.cpp.

Referenced by RenderValue().

◆ Encode()

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

Definition at line 232 of file jsonSerializer.cpp.

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

◆ GetContentType()

QString JSONSerializer::GetContentType ( )
overridevirtual

Implements Serializer.

Definition at line 22 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: