Classes | |
| struct | rapidjson::ParseResult |
| Result of parsing (wraps ParseErrorCode). More... | |
Macros | |
| #define | RAPIDJSON_ERROR_CHARTYPE char |
| Character type of error messages. | |
| #define | RAPIDJSON_ERROR_STRING(x) |
| Macro for converting string literal to RAPIDJSON_ERROR_CHARTYPE[]. | |
| #define | RAPIDJSON_PARSE_ERROR_NORETURN(parseErrorCode, offset) |
| Macro to indicate a parse error. | |
| #define | RAPIDJSON_PARSE_ERROR(parseErrorCode, offset) |
| (Internal) macro to indicate and handle a parse error. | |
Typedefs | |
| typedef const RAPIDJSON_ERROR_CHARTYPE *(* | rapidjson::GetParseErrorFunc) (ParseErrorCode) |
| Function pointer type of GetParseError(). | |
| typedef const RAPIDJSON_ERROR_CHARTYPE *(* | rapidjson::GetValidateErrorFunc) (ValidateErrorCode) |
| Function pointer type of GetValidateError(). | |
| typedef const RAPIDJSON_ERROR_CHARTYPE *(* | rapidjson::GetSchemaErrorFunc) (SchemaErrorCode) |
| Function pointer type of GetSchemaError(). | |
| typedef const RAPIDJSON_ERROR_CHARTYPE *(* | rapidjson::GetPointerParseErrorFunc) (PointerParseErrorCode) |
| Function pointer type of GetPointerParseError(). | |
Functions | |
| const RAPIDJSON_ERROR_CHARTYPE * | rapidjson::GetParseError_En (ParseErrorCode parseErrorCode) |
| Maps error code of parsing into error message. | |
| const RAPIDJSON_ERROR_CHARTYPE * | rapidjson::GetValidateError_En (ValidateErrorCode validateErrorCode) |
| Maps error code of validation into error message. | |
| const RAPIDJSON_ERROR_CHARTYPE * | rapidjson::GetSchemaError_En (SchemaErrorCode schemaErrorCode) |
| Maps error code of schema document compilation into error message. | |
| const RAPIDJSON_ERROR_CHARTYPE * | rapidjson::GetPointerParseError_En (PointerParseErrorCode pointerParseErrorCode) |
| Maps error code of pointer parse into error message. | |
| struct rapidjson::ParseResult |
Result of parsing (wraps ParseErrorCode).
Public Types | |
| typedef bool(ParseResult::* | BooleanType) () const |
| ! Unspecified boolean type | |
Public Member Functions | |
| ParseResult () | |
| Default constructor, no error. | |
| ParseResult (ParseErrorCode code, size_t offset) | |
| Constructor to set an error. | |
| ParseErrorCode | Code () const |
| Get the error code. | |
| size_t | Offset () const |
| Get the error offset, if IsError(), 0 otherwise. | |
| operator BooleanType () const | |
Explicit conversion to bool, returns true, iff !IsError(). | |
| bool | IsError () const |
| Whether the result is an error. | |
| bool | operator== (const ParseResult &that) const |
| bool | operator== (ParseErrorCode code) const |
| bool | operator!= (const ParseResult &that) const |
| bool | operator!= (ParseErrorCode code) const |
| void | Clear () |
| Reset error code. | |
| void | Set (ParseErrorCode code, size_t offset=0) |
| Update error code and offset. | |
Friends | |
| bool | operator== (ParseErrorCode code, const ParseResult &err) |
| bool | operator!= (ParseErrorCode code, const ParseResult &err) |
| #define RAPIDJSON_ERROR_CHARTYPE char |
Character type of error messages.
The default character type is char. On Windows, user can define this macro as TCHAR for supporting both unicode/non-unicode settings.
| #define RAPIDJSON_ERROR_STRING | ( | x | ) |
Macro for converting string literal to RAPIDJSON_ERROR_CHARTYPE[].
By default this conversion macro does nothing. On Windows, user can define this macro as _T(x) for supporting both unicode/non-unicode settings.
| #define RAPIDJSON_PARSE_ERROR | ( | parseErrorCode, | |
| offset ) |
(Internal) macro to indicate and handle a parse error.
| parseErrorCode | rapidjson::ParseErrorCode of the error |
| offset | position of the error in JSON input (size_t) |
Invokes RAPIDJSON_PARSE_ERROR_NORETURN and stops the parsing.
| #define RAPIDJSON_PARSE_ERROR_NORETURN | ( | parseErrorCode, | |
| offset ) |
Macro to indicate a parse error.
| parseErrorCode | rapidjson::ParseErrorCode of the error |
| offset | position of the error in JSON input (size_t) |
This macros can be used as a customization point for the internal error handling mechanism of RapidJSON.
A common usage model is to throw an exception instead of requiring the caller to explicitly check the rapidjson::GenericReader::Parse's return value:
| typedef const RAPIDJSON_ERROR_CHARTYPE *(* rapidjson::GetParseErrorFunc) (ParseErrorCode) |
Function pointer type of GetParseError().
This is the prototype for GetParseError_X(), where X is a locale. User can dynamically change locale in runtime, e.g.:
| typedef const RAPIDJSON_ERROR_CHARTYPE *(* rapidjson::GetPointerParseErrorFunc) (PointerParseErrorCode) |
Function pointer type of GetPointerParseError().
This is the prototype for GetPointerParseError_X(), where X is a locale. User can dynamically change locale in runtime, e.g.:
| typedef const RAPIDJSON_ERROR_CHARTYPE *(* rapidjson::GetSchemaErrorFunc) (SchemaErrorCode) |
Function pointer type of GetSchemaError().
This is the prototype for GetSchemaError_X(), where X is a locale. User can dynamically change locale in runtime, e.g.:
| typedef const RAPIDJSON_ERROR_CHARTYPE *(* rapidjson::GetValidateErrorFunc) (ValidateErrorCode) |
Function pointer type of GetValidateError().
This is the prototype for GetValidateError_X(), where X is a locale. User can dynamically change locale in runtime, e.g.:
Error code of parsing.
Error code of JSON pointer parsing.
Error codes when validating.
| Enumerator | |
|---|---|
| kSchemaErrorNone | No error. |
| kSchemaErrorStartUnknown | Pointer to start of schema does not resolve to a location in the document. |
| kSchemaErrorRefPlainName | $ref fragment must be a JSON pointer |
| kSchemaErrorRefInvalid | $ref must not be an empty string |
| kSchemaErrorRefPointerInvalid | $ref fragment is not a valid JSON pointer at offset |
| kSchemaErrorRefUnknown | $ref does not resolve to a location in the target document |
| kSchemaErrorRefCyclical | $ref is cyclical |
| kSchemaErrorRefNoRemoteProvider | $ref is remote but there is no remote provider |
| kSchemaErrorRefNoRemoteSchema | $ref is remote but the remote provider did not return a schema |
| kSchemaErrorRegexInvalid | Invalid regular expression in 'pattern' or 'patternProperties'. |
| kSchemaErrorSpecUnknown | JSON schema draft or OpenAPI version is not recognized. |
| kSchemaErrorSpecUnsupported | JSON schema draft or OpenAPI version is not supported. |
| kSchemaErrorSpecIllegal | Both JSON schema draft and OpenAPI version found in document. |
| kSchemaErrorReadOnlyAndWriteOnly | Property must not be both 'readOnly' and 'writeOnly'. |
Error codes when validating.
|
inline |
Maps error code of parsing into error message.
| parseErrorCode | Error code obtained in parsing. |
|
inline |
Maps error code of pointer parse into error message.
| pointerParseErrorCode | Error code obtained from pointer parse. |
|
inline |
Maps error code of schema document compilation into error message.
| schemaErrorCode | Error code obtained from compiling the schema document. |
|
inline |
Maps error code of validation into error message.
| validateErrorCode | Error code obtained from validator. |