class
#include <core/data/des/json.hpp>
JSONDeserializer Deserializer implementation which allows reading data from a JSON object.
Before deserializing any data, a JSON object must be fed to the deserializer.
Base classes
- class Deserializer
- Base class for deserializers, which defines the interface for deserializing arbitrary data using its reflection metadata.
Constructors, destructors, conversion operators
- JSONDeserializer()
- Constructs.
Public functions
- void feed(nlohmann::json json)
- Feeds a JSON object to be deserialized.
Protected functions
-
auto decompose(const reflection::
Type& type, void* value) -> bool override - Called for each type with no hook defined.
Function documentation
void cubos:: core:: data:: JSONDeserializer:: feed(nlohmann::json json)
Feeds a JSON object to be deserialized.
Parameters | |
---|---|
json | JSON object. |
bool cubos:: core:: data:: JSONDeserializer:: decompose(const reflection:: Type& type,
void* value) override protected
Called for each type with no hook defined.
Parameters | |
---|---|
type | Type. |
value | Value. |
Returns | Whether the value was successfully deserialized. |
Should recurse by calling read() again as appropriate.