A JSON serializer by using the meta reflection implementation in this project.
More...
|
template<typename U , typename BasicJsonContext >
requires nlohmann::detail::is_basic_json_context<BasicJsonContext>::value |
static void | throw_exception (const U &member, std::string_view json_key, std::string_view message, std::string_view internal, BasicJsonContext context) |
|
template<typename BasicJson , typename U = T>
requires ( nlohmann::detail::is_basic_json<BasicJson>::value && (nlohmann::detail::is_compatible_type<nlohmann::json, U>::value || std::ranges::forward_range<U>) && !std::is_enum_v<U>) |
static void | to_json (BasicJson &json, const U &value) |
| Serializes a primitive value to a JSON value.
|
|
template<typename BasicJson , typename U = T>
requires ( nlohmann::detail::is_basic_json<BasicJson>::value && (nlohmann::detail::is_compatible_type<nlohmann::json, U>::value || std::ranges::forward_range<U>) && !std::is_enum_v<U>) |
static void | from_json (const BasicJson &json, U &value) |
| Deserializes a JSON value to a primitive value.
|
|
template<typename BasicJson , typename U = T>
requires (nlohmann::detail::is_basic_json<BasicJson>::value && std_optional<U>) |
static void | to_json (BasicJson &json, const U &value) |
| Serializes a std::optional<> value to a JSON value.
|
|
template<typename BasicJson , typename U = T>
requires (nlohmann::detail::is_basic_json<BasicJson>::value && std_optional<U>) |
static void | from_json (const BasicJson &json, U &value) |
| Deserializes a JSON value to a std::optional<> value.
|
|
template<typename BasicJson , typename U = T>
requires (std::is_class_v<U> && nlohmann::detail::is_basic_json<BasicJson>::value && !nlohmann::detail::is_compatible_type<nlohmann::json, U>::value && !std::ranges::forward_range<U> && !std_optional<U>) |
static void | to_json (BasicJson &json, const U &value) |
| Serializes a non-iterable class object to a JSON value.
|
|
template<typename BasicJson , typename U = T>
requires (std::is_class_v<U> && nlohmann::detail::is_basic_json<BasicJson>::value && !nlohmann::detail::is_compatible_type<nlohmann::json, U>::value && !std::ranges::forward_range<U> && !std_optional<U>) |
static void | from_json (const BasicJson &json, U &value) |
| Deserializes a JSON value to a non-iterable class object.
|
|
template<typename BasicJson , typename U = T>
requires (nlohmann::detail::is_basic_json<BasicJson>::value && std::same_as<typename BasicJson::string_t::value_type, char> && std::is_enum_v<U>) |
static void | to_json (BasicJson &json, const U &value) |
| Serializes an enumeration value to a JSON value.
|
|
template<typename BasicJson , typename U = T>
requires (nlohmann::detail::is_basic_json<BasicJson>::value && std::same_as<typename BasicJson::string_t::value_type, char> && std::is_enum_v<U>) |
static void | from_json (const BasicJson &json, U &value) |
| Deserializes a JSON value to an enumeration value.
|
|
template<typename T, typename = void>
struct essence::meta::runtime::json_serializer< T, typename >
A JSON serializer by using the meta reflection implementation in this project.
- Template Parameters
-
template<typename T , typename = void>
template<typename BasicJson , typename U = T>
requires ( nlohmann::detail::is_basic_json<BasicJson>::value && (nlohmann::detail::is_compatible_type<nlohmann::json, U>::value || std::ranges::forward_range<U>) && !std::is_enum_v<U>)
Deserializes a JSON value to a primitive value.
- Template Parameters
-
BasicJson | The type of the JSON. |
U | A type placeholder to support overload resolution. |
- Parameters
-
json | The JSON value. |
value | The primitive value. |
template<typename T , typename = void>
template<typename BasicJson , typename U = T>
requires (std::is_class_v<U> && nlohmann::detail::is_basic_json<BasicJson>::value && !nlohmann::detail::is_compatible_type<nlohmann::json, U>::value && !std::ranges::forward_range<U> && !std_optional<U>)
Deserializes a JSON value to a non-iterable class object.
- Template Parameters
-
BasicJson | The type of the JSON. |
U | A type placeholder to support overload resolution. |
- Parameters
-
json | The JSON value. |
value | The class object. |
template<typename T , typename = void>
template<typename BasicJson , typename U = T>
requires ( nlohmann::detail::is_basic_json<BasicJson>::value && (nlohmann::detail::is_compatible_type<nlohmann::json, U>::value || std::ranges::forward_range<U>) && !std::is_enum_v<U>)
Serializes a primitive value to a JSON value.
- Template Parameters
-
BasicJson | The type of the JSON. |
U | A type placeholder to support overload resolution. |
- Parameters
-
json | The JSON value. |
value | The primitive value. |
template<typename T , typename = void>
template<typename BasicJson , typename U = T>
requires (std::is_class_v<U> && nlohmann::detail::is_basic_json<BasicJson>::value && !nlohmann::detail::is_compatible_type<nlohmann::json, U>::value && !std::ranges::forward_range<U> && !std_optional<U>)
Serializes a non-iterable class object to a JSON value.
- Template Parameters
-
BasicJson | The type of the JSON. |
U | A type placeholder to support overload resolution. |
- Parameters
-
json | The JSON value. |
value | The class object. |