![]() |
Qt 6.x
The Qt SDK
|
\inmodule QtCore\reentrant More...
#include <qjsondocument.h>
Public Types | |
enum | ParseError { NoError = 0 , UnterminatedObject , MissingNameSeparator , UnterminatedArray , MissingValueSeparator , IllegalValue , TerminationByNumber , IllegalNumber , IllegalEscapeSequence , IllegalUTF8String , UnterminatedString , MissingObject , DeepNesting , DocumentTooLarge , GarbageAtEnd } |
This enum describes the type of error that occurred during the parsing of a JSON document. More... | |
Public Member Functions | |
QString | errorString () const |
\variable QJsonParseError::error | |
Public Attributes | |
int | offset = -1 |
ParseError | error = NoError |
\inmodule QtCore
\reentrant
The QJsonParseError class is used to report errors during JSON parsing.
Definition at line 19 of file qjsondocument.h.
This enum describes the type of error that occurred during the parsing of a JSON document.
\value NoError No error occurred \value UnterminatedObject An object is not correctly terminated with a closing curly bracket \value MissingNameSeparator A comma separating different items is missing \value UnterminatedArray The array is not correctly terminated with a closing square bracket \value MissingValueSeparator A colon separating keys from values inside objects is missing \value IllegalValue The value is illegal \value TerminationByNumber The input stream ended while parsing a number \value IllegalNumber The number is not well formed \value IllegalEscapeSequence An illegal escape sequence occurred in the input \value IllegalUTF8String An illegal UTF8 sequence occurred in the input \value UnterminatedString A string wasn't terminated with a quote \value MissingObject An object was expected but couldn't be found \value DeepNesting The JSON document is too deeply nested for the parser to parse it \value DocumentTooLarge The JSON document is too large for the parser to parse it \value GarbageAtEnd The parsed document contains additional garbage characters at the end
Definition at line 21 of file qjsondocument.h.
QString QJsonParseError::errorString | ( | ) | const |
\variable QJsonParseError::error
Contains the type of the parse error. Is equal to QJsonParseError::NoError if the document was parsed correctly.
\variable QJsonParseError::offset
Contains the offset in the input string where the parse error occurred.
Returns the human-readable message appropriate to the reported JSON parsing error.
Definition at line 111 of file qjsonparser.cpp.
References DeepNesting, DocumentTooLarge, error, GarbageAtEnd, IllegalEscapeSequence, IllegalNumber, IllegalUTF8String, IllegalValue, JSONERR_DEEP_NEST, JSONERR_DOC_LARGE, JSONERR_END_OF_NUM, JSONERR_GARBAGEEND, JSONERR_ILLEGAL_NUM, JSONERR_ILLEGAL_VAL, JSONERR_MISS_NSEP, JSONERR_MISS_OBJ, JSONERR_MISS_VSEP, JSONERR_OK, JSONERR_STR_ESC_SEQ, JSONERR_STR_UTF8, JSONERR_UNTERM_AR, JSONERR_UNTERM_OBJ, JSONERR_UTERM_STR, MissingNameSeparator, MissingObject, MissingValueSeparator, NoError, TerminationByNumber, QCoreApplication::translate(), UnterminatedArray, UnterminatedObject, and UnterminatedString.
Referenced by QGtk3Json::load(), moduleFromJsonFile(), readTranslationsCatalogs(), and QGeoCodeJsonParser::run().
ParseError QJsonParseError::error = NoError |
Definition at line 42 of file qjsondocument.h.
Referenced by errorString(), QGtk3Json::load(), moduleFromJsonFile(), readTranslationsCatalogs(), and QGeoCodeJsonParser::run().
int QJsonParseError::offset = -1 |
Definition at line 41 of file qjsondocument.h.