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>
46 template <
typename Type,
47 Traits::EnableIf<Traits::Not<std::is_same<Type, bool>>, Traits::Any<std::is_integral<Type>, std::is_floating_point<Type>>> * =
nullptr>
53 template <
typename Type, Traits::EnableIfAny<std::is_same<Type,
bool>> * =
nullptr> constexpr
JsonType jsonType()
58 template <
typename Type, Traits::EnableIfAny<Traits::IsString<Type>, Traits::IsCString<Type>> * =
nullptr> constexpr
JsonType jsonType()
63 template <
typename Type,
64 Traits::EnableIf<Traits::IsIteratable<Type>,
65 Traits::Not<Traits::Any<Traits::IsString<Type>, Traits::IsSpecializationOf<Type, std::map>,
66 Traits::IsSpecializationOf<Type, std::unordered_map>>>> * =
nullptr>
72 template <
typename Type,
73 Traits::DisableIfAny<std::is_integral<Type>, std::is_floating_point<Type>, Traits::IsString<Type>, Traits::IsCString<Type>,
74 Traits::All<Traits::IsIteratable<Type>,
75 Traits::Not<Traits::Any<Traits::IsString<Type>, Traits::IsSpecializationOf<Type, std::map>,
76 Traits::IsSpecializationOf<Type, std::unordered_map>>>>> * =
nullptr>
88 case RAPIDJSON_NAMESPACE::kFalseType:
89 case RAPIDJSON_NAMESPACE::kTrueType:
91 case RAPIDJSON_NAMESPACE::kObjectType:
93 case RAPIDJSON_NAMESPACE::kArrayType:
95 case RAPIDJSON_NAMESPACE::kStringType:
97 case RAPIDJSON_NAMESPACE::kNumberType:
125 static constexpr std::size_t
noIndex = std::numeric_limits<std::size_t>::max();
135 , expectedType(expectedType)
136 , actualType(actualType)
155 template <
typename ExpectedType>
void reportTypeMismatch(RAPIDJSON_NAMESPACE::Type presentType);
176 void throwMaybe(
ThrowOn on)
const;
183 : currentRecord(
"[document]")
184 , currentMember(nullptr)
195 return static_cast<JsonDeserializationErrors::ThrowOn>(static_cast<std::uint8_t>(lhs) | static_cast<std::uint8_t>(rhs));
203 inline void JsonDeserializationErrors::throwMaybe(ThrowOn on)
const
205 if (static_cast<std::uint8_t>(
throwOn) & static_cast<std::uint8_t>(on)) {
255 #endif // REFLECTIVE_RAPIDJSON_JSON_REFLECTOR_H