QtBase
v6.3.1
|
The QJsonParseError class is used to report errors during JSON parsing. More...
#include <qjsondocument.h>
Public Types | |
enum | ParseError { NoError = 0 , UnterminatedObject , MissingNameSeparator , UnterminatedArray , MissingValueSeparator , IllegalValue , TerminationByNumber , IllegalNumber , IllegalEscapeSequence , IllegalUTF8String , UnterminatedString , MissingObject , DeepNesting , DocumentTooLarge , GarbageAtEnd } |
Public Member Functions | |
QString | errorString () const |
Public Attributes | |
int | offset = -1 |
ParseError | error = NoError |
The QJsonParseError class is used to report errors during JSON parsing.
\inmodule QtCore
\reentrant
Definition at line 55 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 57 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 143 of file qjsonparser.cpp.
ParseError QJsonParseError::error = NoError |
Definition at line 78 of file qjsondocument.h.
int QJsonParseError::offset = -1 |
Definition at line 77 of file qjsondocument.h.