|
JSON Voorhees
Killer JSON for C++
|
An adapter for "wrapper" types. More...
#include <jsonv/serialization/wrapper_adapter.hpp>
Inheritance diagram for jsonv::wrapper_adapter< TWrapper >:
Collaboration diagram for jsonv::wrapper_adapter< TWrapper >:Protected Member Functions | |
| virtual std::expected< TWrapper, ast_node_type > | create (deserialization_context &context, reader &from) const override |
Create an instance of T by reading from. | |
| virtual void | serialize (const serialization_context &context, const TWrapper &from, writer &to) const override |
| Write from into to. | |
Additional Inherited Members | |
Public Member Functions inherited from jsonv::adapter_for< TWrapper > | |
| virtual const std::type_info & | get_type () const noexcept override |
| virtual std::expected< void, ast_node_type > | deserialize (deserialization_context &context, reader &from, void *into) const override |
| virtual void | serialize (const serialization_context &context, const void *from, writer &to) const override |
An adapter for "wrapper" types.
| TWrapper | A wrapper type with a member value_type which represents the underlying wrapped type. This must be explicitly convertible to and from the value_type. |
Definition at line 33 of file wrapper_adapter.hpp.
|
inlineoverrideprotectedvirtual |
Create an instance of T by reading from.
| context | Extra information to help you decode sub-objects, such as looking up other deserializer implementations via formats. Record any problem you encounter with deserialization_context::problem. |
| from | The JSON reader to deserialize from. On a successful return it should sit one position past the value which was read, as reader::next_value would have left it. |
std::unexpected carrying the ast_node_type actually found when the failure was a type mismatch, or ast_node_type::error otherwise. Implements jsonv::adapter_for< TWrapper >.
Definition at line 40 of file wrapper_adapter.hpp.
|
inlineoverrideprotectedvirtual |
Write from into to.
Implements jsonv::adapter_for< TWrapper >.
Definition at line 63 of file wrapper_adapter.hpp.