Reflection for RapidJSON 0.0.16
Reflection for serializing/deserializing with RapidJSON
Loading...
Searching...
No Matches
ReflectiveRapidJSON::JsonDeserializationError Struct Reference

The JsonDeserializationError struct describes any errors of fromJson() except such caused by invalid JSON. More...

#include <errorhandling.h>

Public Member Functions

 JsonDeserializationError (JsonDeserializationErrorKind kind, JsonType expectedType, JsonType actualType, const char *record, const char *member=nullptr, std::size_t index=noIndex)
 Constructs a new JsonDeserializationError.
 

Public Attributes

JsonDeserializationErrorKind kind
 Which kind of error occurred.
 
JsonType expectedType
 The expected type (might not be relevant for all error kinds).
 
JsonType actualType
 The actual type (might not be relevant for all error kinds).
 
const char * record
 The name of the class or struct which was being processed when the error was ascertained.
 
const char * member
 The name of the member which was being processed when the error was ascertained.
 
std::size_t index
 The index in the array which was being processed when the error was ascertained.
 

Static Public Attributes

static constexpr std::size_t noIndex = std::numeric_limits<std::size_t>::max()
 Indicates no array was being processed when the error occurred.
 

Detailed Description

The JsonDeserializationError struct describes any errors of fromJson() except such caused by invalid JSON.

Definition at line 109 of file errorhandling.h.

Constructor & Destructor Documentation

◆ JsonDeserializationError()

ReflectiveRapidJSON::JsonDeserializationError::JsonDeserializationError ( JsonDeserializationErrorKind kind,
JsonType expectedType,
JsonType actualType,
const char * record,
const char * member = nullptr,
std::size_t index = noIndex )
inline

Constructs a new JsonDeserializationError.

Remarks
Supposed to be called by JsonDeserializationErrors::reportTypeMismatch() and similar methods of JsonDeserializationErrors.

Definition at line 134 of file errorhandling.h.

Member Data Documentation

◆ actualType

JsonType ReflectiveRapidJSON::JsonDeserializationError::actualType

The actual type (might not be relevant for all error kinds).

Definition at line 118 of file errorhandling.h.

◆ expectedType

JsonType ReflectiveRapidJSON::JsonDeserializationError::expectedType

The expected type (might not be relevant for all error kinds).

Definition at line 116 of file errorhandling.h.

◆ index

std::size_t ReflectiveRapidJSON::JsonDeserializationError::index

The index in the array which was being processed when the error was ascertained.

Definition at line 124 of file errorhandling.h.

◆ kind

JsonDeserializationErrorKind ReflectiveRapidJSON::JsonDeserializationError::kind

Which kind of error occurred.

Definition at line 114 of file errorhandling.h.

◆ member

const char* ReflectiveRapidJSON::JsonDeserializationError::member

The name of the member which was being processed when the error was ascertained.

Definition at line 122 of file errorhandling.h.

◆ noIndex

std::size_t ReflectiveRapidJSON::JsonDeserializationError::noIndex = std::numeric_limits<std::size_t>::max()
staticconstexpr

Indicates no array was being processed when the error occurred.

Definition at line 127 of file errorhandling.h.

◆ record

const char* ReflectiveRapidJSON::JsonDeserializationError::record

The name of the class or struct which was being processed when the error was ascertained.

Definition at line 120 of file errorhandling.h.


The documentation for this struct was generated from the following file: