JSON Voorhees
Killer JSON for C++
jsonv::member_adapter_builder< T, TMember > Class Template Reference
+ Inheritance diagram for jsonv::member_adapter_builder< T, TMember >:

Public Member Functions

 member_adapter_builder (formats_builder *fmt_builder, adapter_builder< T > *adapt_builder, detail::member_adapter_impl< T, TMember > *adapter)
 
member_adapter_builderalternate_name (std::string name)
 When extracting, also look for this name as a key. More...
 
member_adapter_buildercheck_input (std::function< void(const TMember &)> check)
 
member_adapter_buildercheck_input (std::function< bool(const TMember &)> check, std::function< void(const TMember &)> thrower)
 
template<typename TException >
member_adapter_buildercheck_input (std::function< void(const TMember &)> check, const TException &ex)
 
member_adapter_builderdefault_value (std::function< TMember(const extraction_context &, const value &)> create)
 If the key for this member is not in the object when deserializing, call this function to create a value. More...
 
member_adapter_builderdefault_value (TMember value)
 If the key for this member is not in the object when deserializing, use this value. More...
 
member_adapter_builderdefault_on_null (bool on=true)
 Should a kind::null for a key be interpreted as a missing value?
 
member_adapter_builderencode_if (std::function< bool(const serialization_context &, const TMember &)> check)
 Only encode this member if the check passes. More...
 
member_adapter_buildersince (version ver)
 Only encode this member if the serialization_context::version is greater than or equal to ver. More...
 
member_adapter_builderuntil (version ver)
 Only encode this member if the serialization_context::version is less than or equal to ver. More...
 
member_adapter_builderafter (version ver)
 Only encode this member if the serialization_context::version is greater than ver. More...
 
member_adapter_builderbefore (version ver)
 Only encode this member if the serialization_context::version is less than ver. More...
 
- Public Member Functions inherited from jsonv::detail::formats_builder_dsl
 formats_builder_dsl (formats_builder *owner)
 
template<typename T >
adapter_builder< T > type ()
 
template<typename T , typename F >
adapter_builder< T > type (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 &&)
 
template<typename F >
formats_builderextend (F &&)
 
formats_builderregister_adapter (const adapter *p)
 
formats_builderregister_adapter (std::shared_ptr< const adapter > p)
 
formats_builderreference_type (std::type_index typ)
 
formats_builderreference_type (std::type_index type, std::type_index from)
 
template<typename TOptional >
formats_builderregister_optional ()
 
template<typename TContainer >
formats_builderregister_container ()
 
template<typename TWrapper >
formats_builderregister_wrapper ()
 
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_builderon_duplicate_type (duplicate_type_action action) noexcept
 
formats compose_checked (formats other, const std::string &name="")
 
formats compose_checked (std::vector< formats > others, const std::string &name="")
 
 operator formats () const
 
- Public Member Functions inherited from jsonv::detail::adapter_builder_dsl< T >
 adapter_builder_dsl (adapter_builder< T > *owner)
 
adapter_builder< T > & type_default_on_null (bool on=true)
 
adapter_builder< T > & type_default_value (std::function< T(const extraction_context &ctx)> create)
 
adapter_builder< T > & type_default_value (const T &value)
 
template<typename TMember >
member_adapter_builder< T, TMember > member (std::string name, TMember T::*selector)
 
template<typename TMember >
member_adapter_builder< T, TMember > member (std::string name, std::function< const TMember &(const T &)> access, std::function< void(T &, TMember &&)> mutate)
 
template<typename TMember >
member_adapter_builder< T, TMember > member (std::string name, const TMember &(T::*access)() const, TMember &(T::*mutable_access)())
 
template<typename TMember >
member_adapter_builder< T, TMember > member (std::string name, const TMember &(T::*access)() const, void(T::*mutate)(TMember))
 
template<typename TMember >
member_adapter_builder< T, TMember > member (std::string name, const TMember &(T::*access)() const, void(T::*mutate)(TMember &&))
 
adapter_builder< T > & pre_extract (typename adapter_builder< T >::pre_extract_func perform)
 
adapter_builder< T > & post_extract (typename adapter_builder< T >::post_extract_func perform)
 
adapter_builder< T > & on_extract_extra_keys (typename adapter_builder< T >::extra_keys_func handler)
 

Additional Inherited Members

- Protected Attributes inherited from jsonv::detail::formats_builder_dsl
formats_builderowner
 
- Protected Attributes inherited from jsonv::detail::adapter_builder_dsl< T >
adapter_builder< T > * owner
 

Detailed Description

template<typename T, typename TMember>
class jsonv::member_adapter_builder< T, TMember >

Definition at line 26 of file forward.hpp.

Member Function Documentation

template<typename T, typename TMember>
member_adapter_builder& jsonv::member_adapter_builder< T, TMember >::after ( version  ver)
inline

Only encode this member if the serialization_context::version is greater than ver.

Definition at line 924 of file serialization_builder.hpp.

template<typename T, typename TMember>
member_adapter_builder& jsonv::member_adapter_builder< T, TMember >::alternate_name ( std::string  name)
inline

When extracting, also look for this name as a key.

Definition at line 840 of file serialization_builder.hpp.

template<typename T, typename TMember>
member_adapter_builder& jsonv::member_adapter_builder< T, TMember >::before ( version  ver)
inline

Only encode this member if the serialization_context::version is less than ver.

Definition at line 934 of file serialization_builder.hpp.

template<typename T, typename TMember>
member_adapter_builder& jsonv::member_adapter_builder< T, TMember >::default_value ( std::function< TMember(const extraction_context &, const value &)>  create)
inline

If the key for this member is not in the object when deserializing, call this function to create a value.

If a default_value is not specified, the key is required.

Definition at line 873 of file serialization_builder.hpp.

template<typename T, typename TMember>
member_adapter_builder& jsonv::member_adapter_builder< T, TMember >::default_value ( TMember  value)
inline

If the key for this member is not in the object when deserializing, use this value.

If a default_value is not specified, the key is required.

Definition at line 882 of file serialization_builder.hpp.

template<typename T, typename TMember>
member_adapter_builder& jsonv::member_adapter_builder< T, TMember >::encode_if ( std::function< bool(const serialization_context &, const TMember &)>  check)
inline

Only encode this member if the check passes.

The final decision to encode is based on all check functions.

Definition at line 897 of file serialization_builder.hpp.

template<typename T, typename TMember>
member_adapter_builder& jsonv::member_adapter_builder< T, TMember >::since ( version  ver)
inline

Only encode this member if the serialization_context::version is greater than or equal to ver.

Definition at line 904 of file serialization_builder.hpp.

template<typename T, typename TMember>
member_adapter_builder& jsonv::member_adapter_builder< T, TMember >::until ( version  ver)
inline

Only encode this member if the serialization_context::version is less than or equal to ver.

Definition at line 914 of file serialization_builder.hpp.


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