DAW JSON Link
Functions
daw::json::anonymous_namespace{daw_json_apply.h} Namespace Reference

Functions

template<typename Signature = use_default, typename String , typename Callable DAW_JSON_ENABLEIF>
constexpr auto json_apply (String &&json_doc, Callable &&callable)
 Parse to parameters specified in signature and pass them to Callable for evaluation. This is similar to std::apply but using JSON documents instead of tuples. More...
 
template<typename Signature = use_default, typename String , auto... PolicyFlags, typename Callable DAW_JSON_ENABLEIF>
constexpr auto json_apply (String &&json_doc, daw::json::options::parse_flags_t< PolicyFlags... > flags, Callable &&callable)
 Parse to parameters specified in signature and pass them to Callable for evaluation. This is similar to std::apply but using JSON documents instead of tuples. More...
 
template<typename Signature = use_default, typename String , typename Callable DAW_JSON_ENABLEIF>
constexpr auto json_apply (String &&json_doc, std::string_view json_path, Callable &&callable)
 Parse to parameters specified in signature and pass them to Callable for evaluation. This is similar to std::apply but using JSON documents instead of tuples. More...
 
template<typename Signature = use_default, typename String , auto... PolicyFlags, typename Callable DAW_JSON_ENABLEIF>
constexpr auto json_apply (String &&json_doc, std::string_view json_path, daw::json::options::parse_flags_t< PolicyFlags... > flags, Callable &&callable)
 Parse to parameters specified in signature and pass them to Callable for evaluation. This is similar to std::apply but using JSON documents instead of tuples. More...
 

Function Documentation

◆ json_apply() [1/4]

template<typename Signature = use_default, typename String , typename Callable DAW_JSON_ENABLEIF>
constexpr auto daw::json::anonymous_namespace{daw_json_apply.h}::json_apply ( String &&  json_doc,
Callable &&  callable 
)
constexpr

Parse to parameters specified in signature and pass them to Callable for evaluation. This is similar to std::apply but using JSON documents instead of tuples.

Template Parameters
SignatureThe signature of the Callable. Will try to auto deduce if not specified. Does not work when there are overloads(e.g. auto params/template params/overloaded call operator or functions)
StringType of json document
CallableA callable to pass the parsed json document to
Parameters
json_docThe json document with serialized data to parse
callableThe callable used to evaluate the parsed values.
Returns
The result of calling Callable

Definition at line 68 of file daw_json_apply.h.

◆ json_apply() [2/4]

template<typename Signature = use_default, typename String , auto... PolicyFlags, typename Callable DAW_JSON_ENABLEIF>
constexpr auto daw::json::anonymous_namespace{daw_json_apply.h}::json_apply ( String &&  json_doc,
daw::json::options::parse_flags_t< PolicyFlags... >  flags,
Callable &&  callable 
)
constexpr

Parse to parameters specified in signature and pass them to Callable for evaluation. This is similar to std::apply but using JSON documents instead of tuples.

Template Parameters
SignatureThe signature of the Callable. Will try to auto deduce if not specified. Does not work when there are overloads(e.g. auto params/template params/overloaded call operator or functions)
StringType of json document
CallableA callable to pass the parsed json document to
PolicyFlagsParser Policy flags. See parser_policies.md
Parameters
json_docThe json document with serialized data to parse
flagsParsing policy flags to change parser behaviour
callableThe callable used to evaluate the parsed values.
Returns
The result of calling Callable

Definition at line 140 of file daw_json_apply.h.

◆ json_apply() [3/4]

template<typename Signature = use_default, typename String , typename Callable DAW_JSON_ENABLEIF>
constexpr auto daw::json::anonymous_namespace{daw_json_apply.h}::json_apply ( String &&  json_doc,
std::string_view  json_path,
Callable &&  callable 
)
constexpr

Parse to parameters specified in signature and pass them to Callable for evaluation. This is similar to std::apply but using JSON documents instead of tuples.

Template Parameters
SignatureThe signature of the Callable. Will try to auto deduce if not specified. Does not work when there are overloads(e.g. auto params/template params/overloaded call operator or functions)
StringType of json document
CallableA callable to pass the parsed json document to
Parameters
json_docThe json document with serialized data to parse
json_pathThe JSON Path to the element in the document to parse
callableThe callable used to evaluate the parsed values.
Returns
The result of calling Callable

Definition at line 89 of file daw_json_apply.h.

◆ json_apply() [4/4]

template<typename Signature = use_default, typename String , auto... PolicyFlags, typename Callable DAW_JSON_ENABLEIF>
constexpr auto daw::json::anonymous_namespace{daw_json_apply.h}::json_apply ( String &&  json_doc,
std::string_view  json_path,
daw::json::options::parse_flags_t< PolicyFlags... >  flags,
Callable &&  callable 
)
constexpr

Parse to parameters specified in signature and pass them to Callable for evaluation. This is similar to std::apply but using JSON documents instead of tuples.

Template Parameters
SignatureThe signature of the Callable. Will try to auto deduce if not specified. Does not work when there are overloads(e.g. auto params/template params/overloaded call operator or functions)
StringType of json document
CallableA callable to pass the parsed json document to
PolicyFlagsParser Policy flags. See parser_policies.md
Parameters
json_docThe json document with serialized data to parse
json_pathThe JSON Path to the element in the document to parse
flagsParsing policy flags to change parser behaviour
callableThe callable used to evaluate the parsed values.
Returns
The result of calling Callable

Definition at line 114 of file daw_json_apply.h.