JSON Voorhees
Killer JSON for C++
jsonv::formats_builder Class Reference

Public Member Functions

template<typename T >
adapter_builder< T > type ()
 
template<typename T , typename F >
adapter_builder< T > type (F &&f)
 
template<typename TEnum >
formats_builderenum_type (std::string enum_name, std::initializer_list< std::pair< TEnum, value >> mapping)
 
template<typename TEnum >
formats_builderenum_type_icase (std::string enum_name, std::initializer_list< std::pair< TEnum, value >> mapping)
 
template<typename TPointer >
polymorphic_adapter_builder< TPointer > polymorphic_type (std::string discrimination_key="")
 
template<typename TPointer , typename F >
polymorphic_adapter_builder< TPointer > polymorphic_type (std::string discrimination_key, F &&f)
 
template<typename F >
formats_builderextend (F &&func)
 
formats_builderregister_adapter (const adapter *p)
 
formats_builderregister_adapter (std::shared_ptr< const adapter > p)
 
template<typename TOptional >
formats_builderregister_optional ()
 
template<typename TContainer >
formats_builderregister_container ()
 
template<typename TWrapper >
formats_builderregister_wrapper ()
 
 operator formats () const
 
formats_builderreference_type (std::type_index type)
 
formats_builderreference_type (std::type_index type, std::type_index from)
 
formats_builderon_duplicate_type (duplicate_type_action action) noexcept
 Assigns the action to perform when a serializer or extractor is being registered by this formats_builder and there is already a serializer or extracter for that type.
 
formats_buildercheck_references (const formats &other, const std::string &name="")
 
formats_buildercheck_references (const formats::list &others, const std::string &name="")
 
formats_buildercheck_references (const std::string &name="")
 
formats compose_checked (formats other, const std::string &name="")
 
formats compose_checked (const formats::list &others, const std::string &name="")
 

Detailed Description

Definition at line 1242 of file serialization_builder.hpp.

Member Function Documentation

formats_builder& jsonv::formats_builder::check_references ( const formats other,
const std::string &  name = "" 
)

Check that, when combined with the formats other, all types referenced by this formats_builder will get decoded properly.

Parameters
nameif non-empty and this function throws, this name will be provided in the exception's what string. This can be useful if you are running multiple check_references calls and you want to name the different checks.
Exceptions
std::logic_errorif formats this formats_builder is generating, when combined with the provided other formats, cannot properly serialize all the types.
formats jsonv::formats_builder::compose_checked ( formats  other,
const std::string &  name = "" 
)

Check the references of this builder (see check_references) and compose a formats instance if successful (see formats::compose).


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