19 #ifndef _STELJSONPARSER_HPP_
20 #define _STELJSONPARSER_HPP_
52 class StelJsonParserInstance* parser;
76 static QVariant
parse(QIODevice* input);
77 static QVariant
parse(
const QByteArray& input);
80 static void write(
const QVariant& jsonObject, QIODevice* output,
int indentLevel=0);
83 static QByteArray
write(
const QVariant& jsonObject,
int indentLevel=0);
85 static void registerSerializerForType(
int t,
void (*func)(
const QVariant&, QIODevice*,
int)) {otherSerializer.insert(t, func);}
88 static QHash<int, void (*)(const QVariant&, QIODevice*, int)> otherSerializer;
91 #endif // _STELJSONPARSER_HPP_
Qt-based simple JSON reader inspired by the one from Zoolib.
static JsonListIterator initListIterator(QIODevice *in)
Create a JsonListIterator from the given input device.
static QVariant parse(QIODevice *input)
Parse the given input stream.
static void write(const QVariant &jsonObject, QIODevice *output, int indentLevel=0)
Serialize the passed QVariant as JSON into the output QIODevice.
Qt-style iterator over a JSON array.
bool hasNext() const
Returns true if the next non-whitespace character is not a ']' character.
QVariant next()
Reads and parses the next object from input.
JsonListIterator(QIODevice *input)
Sets up JsonListIterator to read an array.