Reflection for RapidJSON 0.0.16
Reflection for serializing/deserializing with RapidJSON
|
The JsonDeserializationErrors struct can be passed to fromJson() for error handling. More...
#include <errorhandling.h>
Public Types | |
enum class | ThrowOn : std::uint8_t { None = 0 , TypeMismatch = 0x1 , ArraySizeMismatch = 0x2 , ConversionError = 0x4 , UnexpectedDuplicate = 0x8 , All = 0xFF } |
The list of fatal error types in form of flags. More... | |
Public Member Functions | |
JsonDeserializationErrors () | |
Creates an empty JsonDeserializationErrors object with default context and no errors considered fatal. | |
template<typename ExpectedType > | |
void | reportTypeMismatch (RAPIDJSON_NAMESPACE::Type presentType) |
Reports a type mismatch between. | |
template<RAPIDJSON_NAMESPACE::Type expectedType> | |
void | reportTypeMismatch (RAPIDJSON_NAMESPACE::Type presentType) |
void | reportArraySizeMismatch () |
Reports an array size mismatch. | |
void | reportConversionError (JsonType jsonType) |
Reports a conversion error. | |
void | reportUnexpectedDuplicate (JsonType jsonType) |
Reports an unexpected duplicate. | |
Public Attributes | |
const char * | currentRecord |
The name of the class or struct which is currently being processed. | |
const char * | currentMember |
The name of the member (in currentRecord) which is currently being processed. | |
std::size_t | currentIndex |
The index in the array which is currently processed. | |
enum ReflectiveRapidJSON::JsonDeserializationErrors::ThrowOn | throwOn |
The JsonDeserializationErrors struct can be passed to fromJson() for error handling.
When passed to fromJson() and an error occurs, a JsonDeserializationError is added to this object. If throwOn is set, the JsonDeserializationError is additionally thrown making the error fatal.
Definition at line 154 of file errorhandling.h.
|
strong |
The list of fatal error types in form of flags.
Enumerator | |
---|---|
None | |
TypeMismatch | |
ArraySizeMismatch | |
ConversionError | |
UnexpectedDuplicate | |
All |
Definition at line 170 of file errorhandling.h.
|
inline |
Creates an empty JsonDeserializationErrors object with default context and no errors considered fatal.
Definition at line 186 of file errorhandling.h.
|
inline |
Reports an array size mismatch.
Definition at line 239 of file errorhandling.h.
|
inline |
Reports a conversion error.
An error of that kind occurs when the JSON type matched the expected type, but further conversion of the value has failed.
Definition at line 250 of file errorhandling.h.
|
inline |
Reports a type mismatch between.
ExpectedType | and presentType within the current context. |
expectedType | and presentType within the current context. |
Definition at line 217 of file errorhandling.h.
void ReflectiveRapidJSON::JsonDeserializationErrors::reportTypeMismatch | ( | RAPIDJSON_NAMESPACE::Type | presentType | ) |
|
inline |
Reports an unexpected duplicate.
An error of that kind occurs when the JSON type matched the expected type, but the value can not be inserted in the container because it is already present and duplicates are not allowed.
Definition at line 261 of file errorhandling.h.
std::size_t ReflectiveRapidJSON::JsonDeserializationErrors::currentIndex |
The index in the array which is currently processed.
Definition at line 168 of file errorhandling.h.
const char* ReflectiveRapidJSON::JsonDeserializationErrors::currentMember |
The name of the member (in currentRecord) which is currently being processed.
Definition at line 166 of file errorhandling.h.
const char* ReflectiveRapidJSON::JsonDeserializationErrors::currentRecord |
The name of the class or struct which is currently being processed.
Definition at line 164 of file errorhandling.h.
enum ReflectiveRapidJSON::JsonDeserializationErrors::ThrowOn ReflectiveRapidJSON::JsonDeserializationErrors::throwOn |