Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
QJsonParseError Class Reference

\inmodule QtCore\reentrant More...

#include <qjsonparseerror.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 15 of file qjsonparseerror.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 (as of 6.9, this is no longer returned) \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 17 of file qjsonparseerror.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 byte offset in the UTF-8 byte array where the parse error occurred.

See also
error, errorString(), QJsonDocument::fromJson()

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

See also
error

Definition at line 100 of file qjsonparser.cpp.

Member Data Documentation

◆ error

ParseError QJsonParseError::error = NoError

Definition at line 38 of file qjsonparseerror.h.

◆ offset


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