QtBase  v6.3.1
Public Types | Public Member Functions | Public Attributes | List of all members
QJsonParseError Class Reference

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
 

Detailed Description

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

\inmodule QtCore

\reentrant

Since
5.0
See also
{JSON Support in Qt}, {JSON Save Game Example}

Definition at line 55 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 57 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 143 of file qjsonparser.cpp.

Here is the call graph for this function:

Member Data Documentation

◆ error

ParseError QJsonParseError::error = NoError

Definition at line 78 of file qjsondocument.h.

◆ offset

int QJsonParseError::offset = -1

Definition at line 77 of file qjsondocument.h.


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