15#ifndef RAPIDJSON_ERROR_ERROR_H_
16#define RAPIDJSON_ERROR_ERROR_H_
22RAPIDJSON_DIAG_OFF(padded)
38#ifndef RAPIDJSON_ERROR_CHARTYPE
39#define RAPIDJSON_ERROR_CHARTYPE char
51#ifndef RAPIDJSON_ERROR_STRING
52#define RAPIDJSON_ERROR_STRING(x) x
118 size_t Offset()
const {
return offset_; }
#define RAPIDJSON_NAMESPACE_BEGIN
provide custom rapidjson namespace (opening expression)
#define RAPIDJSON_NAMESPACE_END
provide custom rapidjson namespace (closing expression)
#define RAPIDJSON_ERROR_CHARTYPE
Character type of error messages.
ParseErrorCode
Error code of parsing.
@ kParseErrorDocumentEmpty
The document is empty.
@ kParseErrorNumberMissFraction
Miss fraction part in number.
@ kParseErrorStringInvalidEncoding
Invalid encoding in string.
@ kParseErrorValueInvalid
Invalid value.
@ kParseErrorDocumentRootNotSingular
The document root must not follow by other values.
@ kParseErrorUnspecificSyntaxError
Unspecific syntax error.
@ kParseErrorObjectMissCommaOrCurlyBracket
Missing a comma or '}' after an object member.
@ kParseErrorObjectMissColon
Missing a colon after a name of object member.
@ kParseErrorStringMissQuotationMark
Missing a closing quotation mark in string.
@ kParseErrorTermination
Parsing was terminated.
@ kParseErrorNumberMissExponent
Miss exponent in number.
@ kParseErrorStringEscapeInvalid
Invalid escape character in string.
@ kParseErrorArrayMissCommaOrSquareBracket
Missing a comma or ']' after an array element.
@ kParseErrorNone
No error.
@ kParseErrorStringUnicodeSurrogateInvalid
The surrogate pair in string is invalid.
@ kParseErrorObjectMissName
Missing a name for object member.
@ kParseErrorNumberTooBig
Number too big to be stored in double.
@ kParseErrorStringUnicodeEscapeInvalidHex
Incorrect hex digit after \u escape in string.
common definitions and configuration
Result of parsing (wraps ParseErrorCode)
friend bool operator!=(ParseErrorCode code, const ParseResult &err)
ParseErrorCode Code() const
Get the error code.
ParseResult(ParseErrorCode code, size_t offset)
Constructor to set an error.
bool operator==(const ParseResult &that) const
friend bool operator==(ParseErrorCode code, const ParseResult &err)
bool operator==(ParseErrorCode code) const
bool(ParseResult::*) BooleanType() const
! Unspecified boolean type
void Clear()
Reset error code.
bool operator!=(const ParseResult &that) const
void Set(ParseErrorCode code, size_t offset=0)
Update error code and offset.
ParseResult()
Default constructor, no error.
bool IsError() const
Whether the result is an error.
size_t Offset() const
Get the error offset, if IsError(), 0 otherwise.
bool operator!=(ParseErrorCode code) const