19#include <daw/cpp_17.h>
20#include <daw/daw_arith_traits.h>
21#include <daw/daw_fwd_pack_apply.h>
22#include <daw/daw_traits.h>
23#include <daw/daw_utility.h>
49 typename Constructor = default_constructor<T>,
62 typename Constructor = nullable_constructor<T>,
66 json_details::class_opts_set<Options, JsonNullDefault>>;
91 template<JSONNAMETYPE Name,
typename T = std::optional<
double>,
92 json_details::json_options_t Options = number_opts_def,
93 typename Constructor = nullable_constructor<T>>
96 json_details::number_opts_set<Options, JsonNullDefault>,
113 json_details::number_opts_set<Options, JsonRangeCheck::CheckForNarrowing>,
136 template<JSONNAMETYPE Name,
typename T = std::optional<
bool>,
137 json_details::json_options_t Options =
bool_opts_def,
138 typename Constructor = default_constructor<T>>
155 template<
JSONNAMETYPE Name,
typename String = std::string,
172 template<JSONNAMETYPE Name,
typename String = std::optional<std::
string>,
173 json_details::json_options_t Options =
string_opts_def,
174 typename Constructor = nullable_constructor<String>>
177 json_details::string_opts_set<Options, JsonNullDefault>,
195 template<
JSONNAMETYPE Name,
typename String = std::string,
214 template<JSONNAMETYPE Name,
typename String = std::optional<std::
string>,
215 json_details::json_options_t Options =
string_raw_opts_def,
216 typename Constructor = nullable_constructor<String>>
218 Name, String, json_details::string_raw_opts_set<Options, JsonNullDefault>,
229 template<JSONNAMETYPE Name,
typename T = std::optional<
double>,
230 json_details::json_options_t Options = number_opts_def,
231 typename Constructor = nullable_constructor<T>>
253 typename JsonValueType =
typename Container::mapped_type,
254 typename JsonKeyType = json_base::json_string<std::string>,
273 typename JsonValueType =
typename Container::mapped_type,
274 typename JsonKeyType =
typename Container::key_type,
277 json_key_value<Name, Container, JsonValueType, JsonKeyType, Constructor,
290 typename T = std::chrono::time_point<std::chrono::system_clock,
291 std::chrono::milliseconds>,
292 typename Constructor =
305 typename T = std::optional<std::chrono::time_point<
306 std::chrono::system_clock, std::chrono::milliseconds>>,
307 typename Constructor =
315 template<
typename... JsonElements>
319 fwd_pack<json_details::json_deduced_type<JsonElements>...>;
334 typename Container = json_deduce_type,
335 typename Constructor = json_deduce_type,
350 typename Container = json_deduce_type,
351 typename Constructor = json_deduce_type>
371 typename JsonValueType =
typename Container::mapped_type,
372 typename JsonKeyType =
typename Container::key_type,
392 typename JsonValueType =
typename Container::mapped_type,
393 typename JsonKeyType =
typename Container::key_type,
432 json_custom<Name, T, FromJsonConverter, ToJsonConverter,
433 json_details::json_custom_opts_set<Options, JsonNullDefault>>;
440 Name, T, FromJsonConverter, ToJsonConverter,
441 json_details::json_custom_opts_set<Options, JsonCustomTypes::Literal>>;
448 json_custom<Name, T, FromJsonConverter, ToJsonConverter,
452 namespace json_details {
453 template<JsonBaseParseTypes PT>
454 constexpr std::size_t
457 for(
auto const &pt : pts ) {
463 return ( daw::numeric_limits<std::size_t>::max )( );
471 template<
typename... Ts>
476 template<
typename... Ts>
477 [[maybe_unused]]
constexpr std::conditional_t<
478 std::conjunction<has_json_deduced_type<Ts>...>::value,
488 std::remove_reference_t<daw::detected_t<underlying_nullable_type, T>>;
502 template<
typename,
typename =
void>
505 template<
typename... Ts>
507 using type = std::conditional_t<
508 std::conjunction<has_json_deduced_type<Ts>...>::value,
513 template<
typename,
typename =
void>
516 template<
template<
class...>
class Tuple,
typename... Ts>
518 static_assert( std::conjunction_v<has_deduced_type_mapping<Ts>...>,
519 "Missing mapping for type in tuple" );
521 using types = std::tuple<json_deduced_type<Ts>...>;
524 template<JsonNullable,
typename>
527 template<JsonNullable Nullable,
typename Variant>
529 std::disjunction_v<daw::not_trait<is_nullable_json_value<Nullable>>,
530 daw::not_trait<is_nullable_type<Variant>>>,
533 is_nullable_type_v<Variant>,
537 template<JsonNullable,
typename>
540 template<JsonNullable Nullable,
typename Tuple>
542 std::disjunction_v<daw::not_trait<is_nullable_json_value<Nullable>>,
543 daw::not_trait<is_nullable_type<Tuple>>>,
545 std::conditional_t<is_nullable_type_v<Tuple>,
564 typename JsonElements = json_deduce_type,
579 typename JsonElements = json_deduce_type,
599 template<
JSONNAMETYPE Name,
typename T,
typename TagMember,
600 typename Switcher,
typename JsonElements = json_deduce_type,
620 template<
JSONNAMETYPE Name,
typename Variant,
typename TagMember,
621 typename Switcher,
typename JsonElements = json_deduce_type,
626 template<
JSONNAMETYPE Name,
typename JsonElement,
typename SizeMember,
630 typename Constructor =
648 template<
JSONNAMETYPE Name,
typename Variant,
typename TagMember,
649 typename Switcher,
typename JsonElements = json_deduce_type,
655 template<
typename... Ts>
658 std::conjunction_v<json_details::has_json_deduced_type<Ts>...>,
659 "Missing mapping for type in tuple" );
660 using types = std::tuple<json_details::json_deduced_type<Ts>...>;
670 typename Constructor = json_deduce_type,
672 typename JsonTupleTypesList = json_deduce_type>
676 typename Constructor = json_deduce_type,
678 typename JsonTupleTypesList = json_deduce_type>
681 json_details::tuple_opts_set<Options, JsonNullDefault>,
684 namespace json_details {
687 static_assert( is_a_json_type_v<T>,
688 "The supplied type does not have a json_data_contract" );
#define JSONNAMETYPE
Definition: daw_json_name.h:111
constexpr bool is_nullable_type_v
Definition: daw_json_link_types_fwd.h:494
constexpr std::size_t find_json_element(std::initializer_list< JsonBaseParseTypes > pts)
Definition: daw_json_link_types_fwd.h:455
std::uint32_t json_options_t
Definition: daw_json_option_bits.h:23
constexpr std::conditional_t< std::conjunction< has_json_deduced_type< Ts >... >::value, json_variant_type_list< json_deduced_type< Ts >... >, missing_default_type_mapping< json_deduced_type< Ts >... > > get_variant_type_list(std::variant< Ts... > const *)
std::remove_reference_t< daw::detected_t< underlying_nullable_type, T > > detected_underlying_nullable_type
Definition: daw_json_link_types_fwd.h:488
typename ensure_mapped< T >::type ensure_mapped_t
Definition: daw_json_link_types_fwd.h:693
constexpr json_options_t number_opts_set
Definition: daw_json_parse_common.h:298
std::conditional_t< std::disjunction_v< daw::not_trait< is_nullable_json_value< Nullable > >, daw::not_trait< is_nullable_type< Tuple > > >, typename tuple_types_list< Tuple >::type, std::conditional_t< is_nullable_type_v< Tuple >, typename tuple_types_list< detected_underlying_nullable_type< Tuple > >::type, cannot_deduce_tuple_types_list< Nullable, Tuple > > > determine_tuple_element_types
Definition: daw_json_link_types_fwd.h:548
std::conditional_t< std::disjunction_v< daw::not_trait< is_nullable_json_value< Nullable > >, daw::not_trait< is_nullable_type< Variant > > >, variant_alternatives_list< Variant >, std::conditional_t< is_nullable_type_v< Variant >, variant_alternatives_list< detected_underlying_nullable_type< Variant > >, cannot_deduce_variant_element_types< Nullable, Variant > > > determine_variant_element_types
Definition: daw_json_link_types_fwd.h:535
decltype(*std::declval< T >()) underlying_nullable_type
Definition: daw_json_link_types_fwd.h:484
constexpr json_options_t json_custom_opts_set
Definition: daw_json_parse_common.h:314
daw::is_detected< underlying_nullable_type, T > is_nullable_type
Definition: daw_json_link_types_fwd.h:491
constexpr json_details::json_options_t string_opts_def
Definition: daw_json_type_options.h:163
@ Variant
Can be a literal, string, or either and allows for some customized parsing.
@ Tuple
A variant type where the Switcher is based on a submember of the class being parsed.
constexpr json_details::json_options_t json_custom_opts_def
Definition: daw_json_type_options.h:253
constexpr json_details::json_options_t tuple_opts_def
Definition: daw_json_type_options.h:219
JsonNullable
Definition: daw_json_enums.h:90
constexpr json_details::json_options_t class_opts_def
Definition: daw_json_type_options.h:208
constexpr json_details::json_options_t bool_opts_def
Definition: daw_json_type_options.h:121
constexpr json_details::json_options_t string_raw_opts_def
Definition: daw_json_type_options.h:196
constexpr JsonNullable JsonNullDefault
Definition: daw_json_enums.h:96
constexpr json_details::json_options_t number_opts_def
Definition: daw_json_type_options.h:108
Definition: daw_from_json.h:22
Definition: daw_json_link_types_iso8601.h:45
Definition: daw_json_link_types_iso8601.h:28
Definition: daw_json_traits.h:199
Definition: to_daw_json_string.h:195
Definition: to_daw_json_string.h:115
Definition: daw_json_link_types.h:1319
Definition: daw_json_link_types.h:553
Definition: daw_json_link_types.h:858
Definition: daw_json_link_types.h:1199
Definition: daw_json_link_types.h:785
Definition: daw_json_link_types_fwd.h:538
Definition: daw_json_link_types_fwd.h:525
Definition: daw_json_link_types_fwd.h:686
T type
Definition: daw_json_link_types_fwd.h:689
Definition: daw_json_link_types_fwd.h:472
void i_am_variant_type_list
Definition: daw_json_link_types_fwd.h:473
std::tuple< json_deduced_type< Ts >... > types
Definition: daw_json_link_types_fwd.h:521
Definition: daw_json_link_types_fwd.h:514
Definition: daw_json_link_types_fwd.h:467
void i_am_variant_type_list
Definition: daw_json_link_types_fwd.h:468
Allow specialization of variant like types to extract the alternative pack.
Definition: daw_json_link_types_fwd.h:503
Definition: daw_json_link_types.h:1866
Definition: daw_json_link_types.h:1644
Definition: daw_json_link_types.h:1531
Definition: daw_json_link_types.h:449
Definition: daw_json_link_types.h:1418
Definition: daw_json_link_types.h:638
Definition: daw_json_link_types.h:720
Definition: daw_json_link_types.h:1106
Definition: daw_json_link_types_fwd.h:656
std::tuple< json_details::json_deduced_type< Ts >... > types
Definition: daw_json_link_types_fwd.h:660
Map a tuple like type to a a JSON tuple/heterogeneous array.
Definition: daw_json_link_types.h:1735
Definition: daw_json_link_types_fwd.h:316
fwd_pack< json_details::json_deduced_type< JsonElements >... > element_map_t
Definition: daw_json_link_types_fwd.h:319
void i_am_variant_type_list
Definition: daw_json_link_types_fwd.h:317
Definition: daw_json_link_types.h:984
Definition: daw_json_traits.h:351
#define DAW_JSON_VER
The version string used in namespace definitions. Must be a valid namespace name.
Definition: version.h:16