1 #ifndef REFLECTIVE_RAPIDJSON_JSON_ERROR_HANDLING_H
2 #define REFLECTIVE_RAPIDJSON_JSON_ERROR_HANDLING_H
9 #include <c++utilities/misc/traits.h>
11 #include <rapidjson/rapidjson.h>
48 template <
typename Type,
49 Traits::EnableIf<Traits::Not<std::is_same<Type, bool>>, Traits::Any<std::is_integral<Type>, std::is_floating_point<Type>>> * =
nullptr>
55 template <
typename Type, Traits::EnableIfAny<std::is_same<Type,
bool>> * =
nullptr> constexpr
JsonType jsonType()
60 template <
typename Type, Traits::EnableIfAny<Traits::IsString<Type>, Traits::IsCString<Type>> * =
nullptr> constexpr
JsonType jsonType()
65 template <
typename Type,
66 Traits::EnableIf<Traits::IsIteratable<Type>,
67 Traits::Not<Traits::Any<Traits::IsString<Type>, Traits::IsSpecializationOf<Type, std::map>,
68 Traits::IsSpecializationOf<Type, std::unordered_map>>>> * =
nullptr>
74 template <
typename Type,
75 Traits::DisableIfAny<std::is_integral<Type>, std::is_floating_point<Type>, Traits::IsString<Type>, Traits::IsCString<Type>,
76 Traits::All<Traits::IsIteratable<Type>,
77 Traits::Not<Traits::Any<Traits::IsString<Type>, Traits::IsSpecializationOf<Type, std::map>,
78 Traits::IsSpecializationOf<Type, std::unordered_map>>>>> * =
nullptr>
90 case RAPIDJSON_NAMESPACE::kFalseType:
91 case RAPIDJSON_NAMESPACE::kTrueType:
93 case RAPIDJSON_NAMESPACE::kObjectType:
95 case RAPIDJSON_NAMESPACE::kArrayType:
97 case RAPIDJSON_NAMESPACE::kStringType:
99 case RAPIDJSON_NAMESPACE::kNumberType:
127 static constexpr std::size_t
noIndex = std::numeric_limits<std::size_t>::max();
137 , expectedType(expectedType)
138 , actualType(actualType)
157 template <
typename ExpectedType>
void reportTypeMismatch(RAPIDJSON_NAMESPACE::Type presentType);
179 void throwMaybe(
ThrowOn on)
const;
186 : currentRecord(
"[document]")
187 , currentMember(nullptr)
206 inline void JsonDeserializationErrors::throwMaybe(ThrowOn on)
const
208 if (
static_cast<std::uint8_t
>(
throwOn) &
static_cast<std::uint8_t
>(on)) {
258 #endif // REFLECTIVE_RAPIDJSON_JSON_REFLECTOR_H