Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
QJsonParseError Class Reference

\inmodule QtCore\reentrant More...

#include <qjsondocument.h>

+ Collaboration diagram for QJsonParseError:

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
 

Detailed Description

\inmodule QtCore

\reentrant

Since
5.0

The QJsonParseError class is used to report errors during JSON parsing.

See also
{JSON Support in Qt}, {Saving and Loading a Game}

Definition at line 20 of file qjsondocument.h.

Member Enumeration Documentation

◆ ParseError

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

Enumerator
NoError 
UnterminatedObject 
MissingNameSeparator 
UnterminatedArray 
MissingValueSeparator 
IllegalValue 
TerminationByNumber 
IllegalNumber 
IllegalEscapeSequence 
IllegalUTF8String 
UnterminatedString 
MissingObject 
DeepNesting 
DocumentTooLarge 
GarbageAtEnd 

Definition at line 22 of file qjsondocument.h.

Member Function Documentation

◆ errorString()

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.

See also
ParseError, errorString()

\variable QJsonParseError::offset

Contains the offset in the input string where the parse error occurred.

See also
error, errorString()

Returns the human-readable message appropriate to the reported JSON parsing error.

See also
error

Definition at line 115 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(), QDeclarativeGeoJsonData::openUrl(), MetaTypesJsonProcessor::processForeignTypes(), and MetaTypesJsonProcessor::processTypes().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ error

◆ offset

int QJsonParseError::offset = -1

Definition at line 42 of file qjsondocument.h.


The documentation for this class was generated from the following files: