Reflection for RapidJSON
0.0.15
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 : std::uint8_t { ThrowOn::None = 0, ThrowOn::TypeMismatch = 0x1, ThrowOn::ArraySizeMismatch = 0x2, ThrowOn::ConversionError = 0x4, ThrowOn::UnexpectedDuplicate = 0x8, ThrowOn::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. 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... | |
void | reportUnexpectedDuplicate (JsonType jsonType) |
Reports an unexpected duplicate. 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 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 169 of file errorhandling.h.
|
inline |
Creates an empty JsonDeserializationErrors object with default context and no errors considered fatal.
Definition at line 185 of file errorhandling.h.
|
inline |
Reports an array size mismatch.
Definition at line 228 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 239 of file errorhandling.h.
|
inline |
Reports a type mismatch between.
ExpectedType | and presentType within the current context. |
Definition at line 216 of file errorhandling.h.
|
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 250 of file errorhandling.h.
std::size_t ReflectiveRapidJSON::JsonDeserializationErrors::currentIndex |
The index in the array which is currently processed.
Definition at line 167 of file errorhandling.h.
const char* ReflectiveRapidJSON::JsonDeserializationErrors::currentMember |
The name of the member (in currentRecord) which is currently being processed.
Definition at line 165 of file errorhandling.h.
const char* ReflectiveRapidJSON::JsonDeserializationErrors::currentRecord |
The name of the class or struct which is currently being processed.
Definition at line 163 of file errorhandling.h.
enum ReflectiveRapidJSON::JsonDeserializationErrors::ThrowOn ReflectiveRapidJSON::JsonDeserializationErrors::throwOn |