mirror of
https://github.com/nlohmann/json.git
synced 2026-03-27 03:12:48 +00:00
Add serialization-only user defined type macros (#3816)
This commit is contained in:
committed by
GitHub
parent
5d931c59a3
commit
360ce457f4
@@ -119,6 +119,13 @@ an object and uses its values as the defaults when calling the [`value`](../api/
|
||||
|
||||
See [full documentation of `NLOHMANN_DEFINE_TYPE_INTRUSIVE_WITH_DEFAULT`](../api/macros/nlohmann_define_type_intrusive.md).
|
||||
|
||||
## `NLOHMANN_DEFINE_TYPE_INTRUSIVE_ONLY_SERIALIZE(type, member...)`
|
||||
|
||||
This macro is similar to `NLOHMANN_DEFINE_TYPE_INTRUSIVE` except that it defines only the serialization code. This is
|
||||
useful when the user type does not have a default constructor and only the serialization is required.
|
||||
|
||||
See [full documentation of `NLOHMANN_DEFINE_TYPE_INTRUSIVE_ONLY_SERIALIZE`](../api/macros//nlohmann_define_type_intrusive.md).
|
||||
|
||||
## `NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(type, member...)`
|
||||
|
||||
This macro can be used to simplify the serialization/deserialization of types if (1) want to use a JSON object as
|
||||
@@ -138,6 +145,13 @@ an object and uses its values as the defaults when calling the [`value`](../api/
|
||||
|
||||
See [full documentation of `NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE_WITH_DEFAULT`](../api/macros/nlohmann_define_type_non_intrusive.md).
|
||||
|
||||
## `NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE_ONLY_SERIALIZE(type, member...)`
|
||||
|
||||
This macro is similar to `NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE` except that it defines only the serialization code. This is
|
||||
useful when the user type does not have a default constructor and only the serialization is required.
|
||||
|
||||
See [full documentation of `NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE_ONLY_SERIALIZE`](../api/macros//nlohmann_define_type_non_intrusive.md).
|
||||
|
||||
## `NLOHMANN_JSON_SERIALIZE_ENUM(type, ...)`
|
||||
|
||||
This macro simplifies the serialization/deserialization of enum types. See
|
||||
|
||||
Reference in New Issue
Block a user