JSON Voorhees
Killer JSON for C++
jsonv::serialization_context Class Reference
+ Inheritance diagram for jsonv::serialization_context:

Public Member Functions

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

Detailed Description

Definition at line 636 of file serialization.hpp.

Constructor & Destructor Documentation

jsonv::serialization_context::serialization_context ( )

Create a new instance using the default formats (formats::global).

jsonv::serialization_context::serialization_context ( jsonv::formats  fmt,
const jsonv::version ver = jsonv::version(),
const void *  userdata = nullptr 
)
explicit

Create a new instance using the given fmt and ver.

Member Function Documentation

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 656 of file serialization.hpp.

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

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