Reflection for RapidJSON
0.0.2
Reflection for serializing/deserializing with RapidJSON
|
The JsonDeserializationErrors struct can be passed to fromJson() for error handling. More...
#include <errorhandling.h>
Public Types | |
enum | ThrowOn : byte { ThrowOn::None = 0, ThrowOn::TypeMismatch = 0x1, ThrowOn::ArraySizeMismatch = 0x2, ThrowOn::ConversionError = 0x4 } |
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. More... | |
template<typename ExpectedType > | |
void | reportTypeMismatch (RAPIDJSON_NAMESPACE::Type presentType) |
Reports a type mismatch between. More... | |
void | reportArraySizeMismatch () |
Reports an array size mismatch. More... | |
void | reportConversionError (JsonType jsonType) |
Reports a conversion error. More... | |
Public Attributes | |
const char * | currentRecord |
The name of the class or struct which is currently being processed. More... | |
const char * | currentMember |
The name of the member (in currentRecord) which is currently being processed. More... | |
std::size_t | currentIndex |
The index in the array which is currently processed. More... | |
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 151 of file errorhandling.h.
|
strong |
The list of fatal error types in form of flags.
Enumerator | |
---|---|
None | |
TypeMismatch | |
ArraySizeMismatch | |
ConversionError |
Definition at line 165 of file errorhandling.h.
|
inline |
Creates an empty JsonDeserializationErrors object with default context and no errors considered fatal.
Definition at line 174 of file errorhandling.h.
|
inline |
Reports an array size mismatch.
Definition at line 217 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 228 of file errorhandling.h.
|
inline |
Reports a type mismatch between.
ExpectedType | and presentType within the current context. |
Definition at line 205 of file errorhandling.h.
std::size_t ReflectiveRapidJSON::JsonDeserializationErrors::currentIndex |
The index in the array which is currently processed.
Definition at line 163 of file errorhandling.h.
const char* ReflectiveRapidJSON::JsonDeserializationErrors::currentMember |
The name of the member (in currentRecord) which is currently being processed.
Definition at line 161 of file errorhandling.h.
const char* ReflectiveRapidJSON::JsonDeserializationErrors::currentRecord |
The name of the class or struct which is currently being processed.
Definition at line 159 of file errorhandling.h.
enum ReflectiveRapidJSON::JsonDeserializationErrors::ThrowOn ReflectiveRapidJSON::JsonDeserializationErrors::throwOn |