JSON Voorhees
Killer JSON for C++
Loading...
Searching...
No Matches
jsonv::serialization_context Class Reference
+ Inheritance diagram for jsonv::serialization_context:
+ Collaboration diagram for jsonv::serialization_context:

Public Member Functions

 serialization_context ()
 Create a new instance using the default formats (formats::global).
 
 serialization_context (jsonv::formats fmt, const jsonv::version &ver=jsonv::version(), const void *userdata=nullptr)
 Create a new instance using the given fmt and ver.
 
template<typename T >
value to_json (const T &from) const
 Convenience function for converting a C++ object into a JSON value.
 
value to_json (const std::type_info &type, const void *from) const
 Dynamically convert a type into a JSON value.
 
- Public Member Functions inherited from jsonv::context_base
 context_base ()
 Create a new instance using the default formats (formats::global).
 
 context_base (jsonv::formats fmt, const jsonv::version &ver=jsonv::version(1), const void *userdata=nullptr)
 Create a new instance using the given fmt, ver and p.
 
const jsonv::formatsformats () const
 Get the formats object backing extraction and encoding.
 
const jsonv::version version () const
 Get the version this extraction_context was created with.
 
const voiduser_data () const
 Get a pointer to arbitrary user data.
 

Detailed Description

Definition at line 695 of file serialization.hpp.

Member Function Documentation

◆ to_json() [1/2]

value jsonv::serialization_context::to_json ( const std::type_info &  type,
const void from 
) const

Dynamically convert a type into a JSON value.

See also
formats::to_json

◆ to_json() [2/2]

template<typename T >
value jsonv::serialization_context::to_json ( const T &  from) const
inline

Convenience function for converting a C++ object into a JSON value.

See also
formats::to_json

Definition at line 714 of file serialization.hpp.

+ Here is the call graph for this function:

The documentation for this class was generated from the following file: