Main class used to convert JSON data to QVariant objects. More...
#include <parser.h>
Public Member Functions | |
QVariant | parse (QIODevice *io, bool *ok=0) |
QVariant | parse (const QByteArray &jsonData, bool *ok=0) |
QString | errorString () const |
int | errorLine () const |
void | allowSpecialNumbers (bool allowSpecialNumbers) |
bool | specialNumbersAllowed () const |
void QJson::Parser::allowSpecialNumbers | ( | bool | allowSpecialNumbers | ) |
Sets whether special numbers (Infinity, -Infinity, NaN) are allowed as an extension to the standard
allowSpecialNumbers | new value of whether special numbers are allowed |
Definition at line 119 of file parser.cpp.
int Parser::errorLine | ( | ) | const |
This method returns line number where the error occurred
Definition at line 114 of file parser.cpp.
QString Parser::errorString | ( | ) | const |
This method returns the error message
Definition at line 109 of file parser.cpp.
QVariant Parser::parse | ( | QIODevice * | io, |
bool * | ok = 0 |
||
) |
Read JSON string from the I/O Device and converts it to a QVariant object
io | Input output device |
ok | if a conversion error occurs, *ok is set to false; otherwise *ok is set to true. |
Definition at line 63 of file parser.cpp.
References yy::json_parser::parse().
QVariant Parser::parse | ( | const QByteArray & | jsonData, |
bool * | ok = 0 |
||
) |
This is a method provided for convenience.
jsonData | data containing the JSON object representation |
ok | if a conversion error occurs, *ok is set to false; otherwise *ok is set to true. |
Definition at line 101 of file parser.cpp.
bool Parser::specialNumbersAllowed | ( | ) | const |
Definition at line 123 of file parser.cpp.
hosts this site. |
Send comments to: QJson Developers |