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

A parser for binary property lists, using QVariant for internal storage. More...

#include <plist.h>

Public Member Functions

 PList (const QByteArray &data)
 
QVariant GetValue (const QString &key)
 
QString ToString (void)
 
bool ToXML (QIODevice *device)
 

Private Member Functions

void ParseBinaryPList (const QByteArray &data)
 
QVariant ParseBinaryNode (quint64 num)
 
QVariantMap ParseBinaryDict (quint8 *data)
 
QList< QVariant > ParseBinaryArray (quint8 *data)
 
quint8 * GetBinaryObject (quint64 num)
 
bool ToXML (const QVariant &data, QXmlStreamWriter &xml)
 
void DictToXML (const QVariant &data, QXmlStreamWriter &xml)
 
void ArrayToXML (const QVariant &data, QXmlStreamWriter &xml)
 

Static Private Member Functions

static QVariant ParseBinaryString (quint8 *data)
 
static QVariant ParseBinaryReal (quint8 *data)
 
static QVariant ParseBinaryDate (quint8 *data)
 
static QVariant ParseBinaryData (quint8 *data)
 
static QVariant ParseBinaryUnicode (quint8 *data)
 
static QVariant ParseBinaryUInt (quint8 **data)
 
static quint64 GetBinaryCount (quint8 **data)
 
static quint64 GetBinaryUInt (quint8 *p, quint64 size)
 

Private Attributes

QVariant m_result
 
quint8 * m_data {nullptr}
 
quint8 * m_offsetTable {nullptr}
 
quint64 m_rootObj {0}
 
quint64 m_numObjs {0}
 
quint8 m_offsetSize {0}
 
quint8 m_parmSize {0}
 

Detailed Description

A parser for binary property lists, using QVariant for internal storage.

Values can be queried using GetValue and the structure can be exported to Xml with ToXml().

Support for importing Xml formatted property lists will be added.

Definition at line 8 of file plist.h.

Constructor & Destructor Documentation

◆ PList()

PList::PList ( const QByteArray &  data)
inlineexplicit

Definition at line 11 of file plist.h.

Member Function Documentation

◆ GetValue()

QVariant PList::GetValue ( const QString &  key)

Definition at line 102 of file plist.cpp.

◆ ToString()

QString PList::ToString ( void  )

Definition at line 118 of file plist.cpp.

◆ ToXML() [1/2]

bool PList::ToXML ( QIODevice *  device)

Definition at line 128 of file plist.cpp.

Referenced by ArrayToXML(), DictToXML(), and ToString().

◆ ParseBinaryPList()

void PList::ParseBinaryPList ( const QByteArray &  data)
private

Definition at line 215 of file plist.cpp.

◆ ParseBinaryNode()

QVariant PList::ParseBinaryNode ( quint64  num)
private

Definition at line 266 of file plist.cpp.

Referenced by ParseBinaryArray(), ParseBinaryDict(), and ParseBinaryPList().

◆ ParseBinaryDict()

QVariantMap PList::ParseBinaryDict ( quint8 *  data)
private

Definition at line 336 of file plist.cpp.

Referenced by ParseBinaryNode().

◆ ParseBinaryArray()

QList< QVariant > PList::ParseBinaryArray ( quint8 *  data)
private

Definition at line 368 of file plist.cpp.

Referenced by ParseBinaryNode().

◆ ParseBinaryString()

QVariant PList::ParseBinaryString ( quint8 *  data)
staticprivate

Definition at line 405 of file plist.cpp.

Referenced by ParseBinaryNode().

◆ ParseBinaryReal()

QVariant PList::ParseBinaryReal ( quint8 *  data)
staticprivate

Definition at line 420 of file plist.cpp.

Referenced by ParseBinaryNode().

◆ ParseBinaryDate()

QVariant PList::ParseBinaryDate ( quint8 *  data)
staticprivate

Definition at line 446 of file plist.cpp.

Referenced by ParseBinaryNode().

◆ ParseBinaryData()

QVariant PList::ParseBinaryData ( quint8 *  data)
staticprivate

Definition at line 463 of file plist.cpp.

Referenced by ParseBinaryNode().

◆ ParseBinaryUnicode()

QVariant PList::ParseBinaryUnicode ( quint8 *  data)
staticprivate

Definition at line 479 of file plist.cpp.

Referenced by ParseBinaryNode().

◆ ParseBinaryUInt()

QVariant PList::ParseBinaryUInt ( quint8 **  data)
staticprivate

Definition at line 390 of file plist.cpp.

Referenced by GetBinaryCount(), and ParseBinaryNode().

◆ GetBinaryCount()

quint64 PList::GetBinaryCount ( quint8 **  data)
staticprivate

◆ GetBinaryUInt()

quint64 PList::GetBinaryUInt ( quint8 *  p,
quint64  size 
)
staticprivate

Definition at line 303 of file plist.cpp.

Referenced by GetBinaryObject(), ParseBinaryArray(), ParseBinaryDict(), and ParseBinaryUInt().

◆ GetBinaryObject()

quint8 * PList::GetBinaryObject ( quint64  num)
private

Definition at line 322 of file plist.cpp.

Referenced by ParseBinaryNode().

◆ ToXML() [2/2]

bool PList::ToXML ( const QVariant &  data,
QXmlStreamWriter &  xml 
)
private

Definition at line 145 of file plist.cpp.

◆ DictToXML()

void PList::DictToXML ( const QVariant &  data,
QXmlStreamWriter &  xml 
)
private

Definition at line 186 of file plist.cpp.

Referenced by ToXML().

◆ ArrayToXML()

void PList::ArrayToXML ( const QVariant &  data,
QXmlStreamWriter &  xml 
)
private

Definition at line 204 of file plist.cpp.

Referenced by ToXML().

Member Data Documentation

◆ m_result

QVariant PList::m_result
private

Definition at line 38 of file plist.h.

Referenced by GetValue(), ParseBinaryPList(), and ToXML().

◆ m_data

quint8* PList::m_data {nullptr}
private

Definition at line 39 of file plist.h.

Referenced by GetBinaryObject(), and ParseBinaryPList().

◆ m_offsetTable

quint8* PList::m_offsetTable {nullptr}
private

Definition at line 40 of file plist.h.

Referenced by GetBinaryObject(), and ParseBinaryPList().

◆ m_rootObj

quint64 PList::m_rootObj {0}
private

Definition at line 41 of file plist.h.

Referenced by ParseBinaryPList().

◆ m_numObjs

quint64 PList::m_numObjs {0}
private

Definition at line 42 of file plist.h.

Referenced by GetBinaryObject(), and ParseBinaryPList().

◆ m_offsetSize

quint8 PList::m_offsetSize {0}
private

Definition at line 43 of file plist.h.

Referenced by GetBinaryObject(), and ParseBinaryPList().

◆ m_parmSize

quint8 PList::m_parmSize {0}
private

Definition at line 44 of file plist.h.

Referenced by ParseBinaryArray(), ParseBinaryDict(), and ParseBinaryPList().


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