Stellarium 0.12.0
Home · All Namespaces · All Classes · Functions · Coding Style · Scripting · Plugins · Renderer · File Structure

StelJsonParser Class Reference

Qt-based simple JSON reader inspired by the one from Zoolib. More...

#include <StelJsonParser.hpp>

List of all members.

Static Public Member Functions

static JsonListIterator initListIterator (QIODevice *in)
 Create a JsonListIterator from the given input device.
static QVariant parse (QIODevice *input)
 Parse the given input stream.
static QVariant parse (const QByteArray &input)
static void write (const QVariant &jsonObject, QIODevice *output, int indentLevel=0)
 Serialize the passed QVariant as JSON into the output QIODevice.
static QByteArray write (const QVariant &jsonObject, int indentLevel=0)
 Serialize the passed QVariant as JSON in a QByteArray.
static void registerSerializerForType (int t, void(*func)(const QVariant &, QIODevice *, int))

Detailed Description

Qt-based simple JSON reader inspired by the one from Zoolib.

The mapping with Qt types is done as following:

JSON            Qt
----          -------
null          QVariant::Invalid
object        QVariantMap (QVariant::Map)
array         QVariantList (QVariant::List)
boolean       QVariant::Bool
string        QVariant::String
number        QVariant::Int or QVariant::Double

JSON is JavaScript Object Notation. See http://www.json.org/

Definition at line 69 of file StelJsonParser.hpp.


Member Function Documentation

static JsonListIterator StelJsonParser::initListIterator ( QIODevice *  in  )  [inline, static]

Create a JsonListIterator from the given input device.

Definition at line 73 of file StelJsonParser.hpp.

static QVariant StelJsonParser::parse ( QIODevice *  input  )  [static]

Parse the given input stream.

static QByteArray StelJsonParser::write ( const QVariant &  jsonObject,
int  indentLevel = 0 
) [static]

Serialize the passed QVariant as JSON in a QByteArray.

static void StelJsonParser::write ( const QVariant &  jsonObject,
QIODevice *  output,
int  indentLevel = 0 
) [static]

Serialize the passed QVariant as JSON into the output QIODevice.


The documentation for this class was generated from the following file:
Generated on Thu Jan 31 14:05:45 2013 for Stellarium by  doxygen 1.6.3