DAW JSON Link
daw_json_link_types.h
Go to the documentation of this file.
1// Copyright (c) Darrell Wright
2//
3// Distributed under the Boost Software License, version 1.0. (see accompanying
4// file LICENSE or copy at http://www.boost.org/LICENSE_1_0.txt)
5//
6// Official repository: https://github.com/beached/daw_json_link
7//
8
9#pragma once
10
13#include "impl/version.h"
14
15#include <daw/daw_attributes.h>
16#include <daw/daw_string_view.h>
17#include <daw/daw_traits.h>
18#include <daw/daw_visit.h>
19
20#include <cstddef>
21#include <string_view>
22#include <tuple>
23#include <type_traits>
24
25namespace daw::json {
26 inline namespace DAW_JSON_VER {
32 template<typename... JsonMembers>
34 using i_am_a_json_member_list = daw::fwd_pack<JsonMembers...>;
35 static_assert(
36 std::conjunction_v<json_details::is_a_json_type<JsonMembers>...>,
37 "Only JSON Link mapping types can appear in a "
38 "json_member_list(e.g. json_number, json_string...)" );
39
40 static_assert(
41 not std::disjunction_v<json_details::is_no_name<JsonMembers>...>,
42 "All members must have a name and not no_name in a "
43 "json_member_list" );
54 template<typename OutputIterator, typename Value,
55 template<class...> class Tuple, typename... Ts>
56 [[maybe_unused, nodiscard]] static inline constexpr OutputIterator
57 serialize( OutputIterator it, Tuple<Ts...> const &args, Value const &v ) {
58 static_assert(
59 sizeof...( Ts ) == sizeof...( JsonMembers ),
60 "The method to_json_data in the json_data_contract does not match "
61 "the mapping. The number of members is not the same." );
62 static_assert(
63 ( (not std::is_rvalue_reference_v<Ts>)and... ),
64 "The Tuple contains rvalue references. The values "
65 "passed are now dangling. daw::forward_nonrvalue_as_tuple in "
66 "<daw/daw_tuple_forward.h> can forward only non-rvalue refs and "
67 "store the temporaries" );
68 return json_details::serialize_json_class<JsonMembers...>(
69 it, args, v, std::index_sequence_for<Ts...>{ } );
70 }
71
72 template<typename Constructor>
74 json_details::json_class_parse_result_t<Constructor, JsonMembers...>;
84 template<typename JsonClass, typename ParseState>
85 [[maybe_unused,
86 nodiscard]] DAW_ATTRIB_FLATTEN static inline constexpr json_details::
87 json_result<JsonClass>
88 parse_to_class( ParseState &parse_state, template_param<JsonClass> ) {
89
90 static_assert( json_details::is_no_name_v<JsonClass> );
91 static_assert( json_details::is_a_json_type_v<JsonClass> );
93 typename JsonClass::base_type>,
94 "Unexpected type" );
95 return json_details::parse_json_class<JsonClass, JsonMembers...>(
96 parse_state, std::index_sequence_for<JsonMembers...>{ } );
97 }
98 };
99
100 /***
101 * Allow the JsonMember type to parse like JsonMember. This is required to
102 * be aliased to type in a json_data_contract specialization. Assuming T is
103 * the specialized type, it's constructor must have an overload for that of
104 * what would be expected for the JsonMember's parse_to_t
105 * @tparam JsonMember This is the json_ type to be aliased
106 */
107 template<typename JsonMember>
112 static_assert( json_details::is_a_json_type_v<json_member>,
113 "Only JSON Link mapping types can appear in a "
114 "json_class_map(e.g. json_number, json_string...)" );
115
116 static_assert(
117 json_details::is_no_name_v<json_member>,
118 "The JSONMember cannot be named, it does not make sense in "
119 "this context" );
120
121 template<typename OutputIterator, typename Member, typename Value>
122 [[maybe_unused, nodiscard]] static inline constexpr OutputIterator
123 serialize( OutputIterator it, Member const &m, Value const & ) {
124 return json_details::member_to_string( template_arg<json_member>, it,
125 m );
126 }
127
128 template<typename Constructor>
131
132 template<typename JsonClass, typename ParseState>
133 [[maybe_unused,
134 nodiscard]] DAW_ATTRIB_FLATTEN static constexpr json_details::
135 json_result<JsonClass>
136 parse_to_class( ParseState &parse_state, template_param<JsonClass> ) {
137 static_assert( json_details::is_a_json_type_v<JsonClass> );
139 typename JsonClass::base_type>,
140 "Unexpected type" );
141 // Using construct_value here as the result of aliased type is used to
142 // construct our result and the Constructor maybe different. This
143 // happens with BigInt and string.
144 using Constructor = typename JsonClass::constructor_t;
146 template_args<JsonClass, Constructor>, parse_state,
147 json_details::parse_value<json_member, false>(
149 }
150 };
151
152 template<typename JsonType>
154 : std::true_type {};
155
156 /***
157 *
158 * Allows specifying an unnamed json mapping where the
159 * result is a tuple
160 */
161 template<typename... Members>
163 std::tuple<typename Members::parse_to_t...> members;
164
165 template<typename... Ts>
166 explicit constexpr tuple_json_mapping( Ts &&...values )
167 : members{ DAW_FWD2( Ts, values )... } {}
168 };
169
170 template<typename... Members>
172 using type = json_member_list<Members...>;
173
174 [[nodiscard, maybe_unused]] static inline auto const &
176 return value.members;
177 }
178 };
179
180 /***
181 * In a json_tuple_member_list, this allows specifying the position in the
182 * array to parse this member from
183 * @tparam Index Position in array where member is
184 * @tparam JsonMember type of value( e.g. int, json_string )
185 */
186 template<std::size_t Index, typename JsonMember>
189 using i_am_a_json_type = void;
190 static constexpr JSONNAMETYPE name = no_name;
191 static constexpr std::size_t member_index = Index;
192 static_assert(
194 "Missing specialization of daw::json::json_data_contract for class "
195 "mapping or specialization of daw::json::json_link_basic_type_map" );
197 using parse_to_t = typename json_member::parse_to_t;
198 };
199
200 template<std::size_t Index, typename JsonMember>
202 [[deprecated( "Use json_tuple_member, removal in v4" )]] =
204
205 namespace json_details {
206 template<typename JsonMember>
208 std::conditional_t<is_an_ordered_member_v<JsonMember>, JsonMember,
210 } // namespace json_details
211
212 /***
213 * Allow extracting elements from a JSON array and constructing from it.
214 * Members can be either normal C++ no_name members, or an ordered_member
215 * with a position. All ordered members must have a value greater than the
216 * previous. The first element in the list, unless it is specified as an
217 * ordered_member, is 0. A non-ordered_member item will be 1 more than the
218 * previous item in the list. All items must have an index greater than the
219 * previous. In Javascript these are also called tuples.
220 * @tparam JsonMembers A list of json_TYPE mappings or a json_TYPE mapping
221 * wrapped into a json_tuple_member
222 */
223 template<typename... JsonMembers>
225 using i_am_a_json_member_list = daw::fwd_pack<JsonMembers...>;
227
236 template<typename OutputIterator, typename Value,
237 template<class...> class Tuple, typename... Ts>
238 [[maybe_unused, nodiscard]] static inline constexpr OutputIterator
239 serialize( OutputIterator it, Tuple<Ts...> const &args, Value const &v ) {
240 static_assert( sizeof...( Ts ) == sizeof...( JsonMembers ),
241 "Argument count is incorrect" );
242 static_assert(
243 ( (not std::is_rvalue_reference_v<Ts>)and... ),
244 "The Tuple contains rvalue references. The values "
245 "passed are now dangling. daw::forward_nonrvalue_as_tuple in "
246 "<daw/daw_tuple_forward.h> can forward only non-rvalue refs and "
247 "store the temporaries" );
248 static_assert(
249 std::conjunction<json_details::is_a_json_type<
251 "Only value JSON types can be used" );
254 it, args, v, std::index_sequence_for<Ts...>{ } );
255 }
256
257 template<typename Constructor>
270 template<typename JsonClass, typename ParseState>
271 [[maybe_unused,
272 nodiscard]] static inline constexpr json_details::json_result<JsonClass>
273 parse_to_class( ParseState &parse_state, template_param<JsonClass> ) {
276 typename JsonClass::base_type>,
277 "Unexpected type" );
278
280 template_args<
282 parse_state );
283 }
284 };
285
286 template<typename... JsonMembers>
288 [[deprecated( "Use json_tuple_member_list, removal in v4" )]] =
289 json_tuple_member_list<JsonMembers...>;
290
291 /***
292 * Parse a tagged variant like class where the tag member is in the same
293 * class that is being discriminated. The container type, that will
294 * specialize json_data_construct on, must support the get_if, get_index
295 * @tparam TagMember JSON element to pass to Switcher. Does not have to be
296 * declared in member list
297 * @tparam Switcher A callable that returns an index into JsonClasses when
298 * passed the TagMember object
299 * @tparam JsonClasses List of alternative classes that are mapped via a
300 * json_data_contract
301 */
302 template<typename TagMember, typename Switcher, typename... JsonClasses>
306
313 template<typename OutputIterator, typename Value>
314 [[maybe_unused, nodiscard]] static inline constexpr OutputIterator
315 serialize( OutputIterator it, Value const &v ) {
316
317 return daw::visit_nt( v, [&]( auto const &alternative ) {
318 using Alternative = DAW_TYPEOF( alternative );
319 static_assert(
320 std::disjunction_v<std::is_same<Alternative, JsonClasses>...>,
321 "Unexpected alternative type" );
322 static_assert( json_details::has_json_to_json_data_v<Alternative>,
323 "Alternative type does not have a to_json_data_member "
324 "in it's json_data_contract specialization" );
325
327 template_arg<json_base::json_class<Alternative>>, it, alternative );
328 } );
329 }
330
331 template<typename Constructor>
334 daw::traits::first_type<JsonClasses...>>>;
344 template<typename JsonClass, typename ParseState>
345 [[maybe_unused,
346 nodiscard]] DAW_ATTRIB_FLATTEN static inline constexpr json_details::
347 from_json_result_t<JsonClass>
348 parse_to_class( ParseState &parse_state, template_param<JsonClass> ) {
351 typename JsonClass::base_type>,
352 "Unexpected type" );
353 using tag_class_t = tuple_json_mapping<TagMember>;
354
355 std::size_t const idx = [parse_state]( ) mutable {
356 return Switcher{ }( std::get<0>(
359 .members ) );
360 }( );
361 daw_json_assert_weak( idx < sizeof...( JsonClasses ),
362 ErrorReason::UnexpectedJSONVariantType );
364 0, JsonClass, false, json_base::json_class<JsonClasses>...>(
365 idx, parse_state );
366 }
367 };
368
369 /**************************************************
370 * Member types - These are the mapping classes to
371 * describe the constructor of your classes
372 **************************************************/
373
374 namespace json_base {
375 template<typename T, json_details::json_options_t Options,
376 typename Constructor>
377 struct json_number {
378 using i_am_a_json_type = void;
379 using wrapped_type = T;
380 static constexpr daw::string_view name = no_name;
381 static constexpr bool must_be_class_member = false;
382
383 static constexpr JsonNullable nullable =
384 json_details::get_bits_for<JsonNullable>( number_opts, Options );
386 static_assert( traits::not_same<void, base_type>::value,
387 "Failed to detect base type" );
388
389 static_assert( daw::is_arithmetic<base_type>::value,
390 "json_number requires an arithmetic type" );
391
393 nullable != JsonNullable::MustExist, Constructor, base_type>::type;
394
395 static_assert(
396 std::disjunction_v<
397 not_trait<json_details::is_nullable_json_value<nullable>>,
398 typename std::is_invocable_r<parse_to_t, Constructor>::type>,
399 "Default ctor of constructor must match that of base" );
400 using constructor_t = Constructor;
401
402 static constexpr JsonParseTypes expected_type =
403 get_parse_type_v<json_details::number_parse_type_v<base_type>,
404 nullable>;
405
407 json_details::number_parse_type_v<base_type>;
408
410 json_details::get_bits_for<LiteralAsStringOpt>( number_opts,
411 Options );
412
413 static constexpr JsonRangeCheck range_check =
414 json_details::get_bits_for<JsonRangeCheck>( number_opts, Options );
415
417 json_details::get_bits_for<FPOutputFormat>( number_opts, Options );
418
420 json_details::get_bits_for<JsonNumberErrors>( number_opts, Options );
421
424 "Cannot allow NaN/Inf/-Inf when numbers cannot be "
425 "serialized/parsed as a string" );
426
429
430 template<JSONNAMETYPE NewName>
431 using with_name =
434 };
435
436 } // namespace json_base
437
447 template<JSONNAMETYPE Name, typename T,
448 json_details::json_options_t Options, typename Constructor>
449 struct json_number : json_base::json_number<T, Options, Constructor> {
450
451 static constexpr daw::string_view name = Name;
452#if not defined( DAW_JSON_NO_FAIL_ON_NO_NAME_NAME )
453 static_assert( name != no_name,
454 "For no_name mappings, use the json_number_no_name "
455 "variant without a name argument" );
456#endif
457
458 template<JSONNAMETYPE NewName>
461 };
462
463 template<typename T = double,
465 typename Constructor = default_constructor<T>>
466 using json_number_no_name = json_base::json_number<T, Options, Constructor>;
467
468 template<typename T = std::optional<double>,
469 json_details::json_options_t Options = number_opts_def,
470 typename Constructor = nullable_constructor<T>>
471 using json_number_null_no_name = json_base::json_number<
472 T, json_details::number_opts_set<Options, JsonNullDefault>, Constructor>;
473
482 template<typename T = double,
484 typename Constructor = default_constructor<T>>
485 using json_checked_number_no_name = json_base::json_number<
486 T,
487 json_details::number_opts_set<Options, JsonRangeCheck::CheckForNarrowing>,
488 Constructor>;
489
498 template<typename T = std::optional<double>,
499 json_details::json_options_t Options = number_opts_def,
500 typename Constructor = nullable_constructor<T>>
501 using json_checked_number_null_no_name = json_base::json_number<
502 T,
505 Constructor>;
506
507 namespace json_base {
508 template<typename T, json_details::json_options_t Options,
509 typename Constructor>
510 struct json_bool {
511 using i_am_a_json_type = void;
512 static constexpr daw::string_view name = no_name;
513 static constexpr JsonNullable nullable =
514 json_details::get_bits_for<JsonNullable>( bool_opts, Options );
515 static constexpr bool must_be_class_member = false;
516 using wrapped_type = T;
518 static_assert( traits::not_same<void, base_type>::value,
519 "Failed to detect base type" );
520
522 nullable != JsonNullable::MustExist, Constructor, base_type>::type;
523
524 using constructor_t = Constructor;
525
526 static constexpr JsonParseTypes expected_type =
527 get_parse_type_v<JsonParseTypes::Bool, nullable>;
530
532 json_details::get_bits_for<LiteralAsStringOpt>( bool_opts, Options );
533
536
537 template<JSONNAMETYPE NewName>
538 using with_name =
541 };
542 } // namespace json_base
543
551 template<JSONNAMETYPE Name, typename T,
552 json_details::json_options_t Options, typename Constructor>
553 struct json_bool : json_base::json_bool<T, Options, Constructor> {
554
555 static constexpr daw::string_view name = Name;
556#if not defined( DAW_JSON_NO_FAIL_ON_NO_NAME_NAME )
557 static_assert( name != no_name,
558 "For no_name mappings, use the json_bool_no_name variant "
559 "without a name argument" );
560#endif
561
562 template<JSONNAMETYPE NewName>
565 };
566
567 template<typename T = bool,
569 typename Constructor = default_constructor<T>>
570 using json_bool_no_name = json_base::json_bool<T, Options, Constructor>;
571
572 template<typename T = std::optional<bool>,
573 json_details::json_options_t Options = bool_opts_def,
574 typename Constructor = nullable_constructor<T>>
575 using json_bool_null_no_name = json_base::json_bool<
576 T, json_details::bool_opts_set<Options, JsonNullDefault>, Constructor>;
577
578 namespace json_base {
580 template<typename String, json_details::json_options_t Options,
581 typename Constructor>
583 using i_am_a_json_type = void;
584 static constexpr JsonNullable nullable =
585 json_details::get_bits_for<JsonNullable>( string_raw_opts, Options );
586 static constexpr bool must_be_class_member = false;
587 using constructor_t = Constructor;
590 static_assert( traits::not_same<void, base_type>::value,
591 "Failed to detect base type" );
592
594 nullable != JsonNullable::MustExist, Constructor, base_type>::type;
595
596 static constexpr daw::string_view name = no_name;
597 static constexpr JsonParseTypes expected_type =
598 get_parse_type_v<JsonParseTypes::StringRaw, nullable>;
603
605 json_details::get_bits_for<EmptyStringNull>( string_raw_opts,
606 Options );
607 static constexpr EightBitModes eight_bit_mode =
608 json_details::get_bits_for<EightBitModes>( string_raw_opts, Options );
609
611 json_details::get_bits_for<AllowEscapeCharacter>( string_raw_opts,
612 Options );
613
614 template<JSONNAMETYPE NewName>
615 using with_name =
618 };
619 } // namespace json_base
620
635 template<JSONNAMETYPE Name, typename String,
636 json_details::json_options_t Options, typename Constructor>
638 : json_base::json_string_raw<String, Options, Constructor> {
639 using i_am_a_json_type = void;
640
641 static constexpr daw::string_view name = Name;
642#if not defined( DAW_JSON_NO_FAIL_ON_NO_NAME_NAME )
643 static_assert( name != no_name,
644 "For no_name mappings, use the json_string_raw_no_name "
645 "variant without a name argument" );
646#endif
647
648 template<JSONNAMETYPE NewName>
652 };
653
654 template<typename T = std::string,
656 typename Constructor = default_constructor<T>>
658 json_base::json_string_raw<T, Options, Constructor>;
659
660 template<typename T = std::optional<std::string>,
661 json_details::json_options_t Options = string_raw_opts_def,
662 typename Constructor = nullable_constructor<T>>
663 using json_string_raw_null_no_name = json_base::json_string_raw<
664 T, json_details::string_raw_opts_set<Options, JsonNullDefault>,
665 Constructor>;
666
667 namespace json_base {
668 template<typename String, json_details::json_options_t Options,
669 typename Constructor>
670 struct json_string {
671 using i_am_a_json_type = void;
672 static constexpr JsonNullable nullable =
673 json_details::get_bits_for<JsonNullable>( string_opts, Options );
674 static constexpr bool must_be_class_member = false;
675 using constructor_t = Constructor;
678 static_assert( traits::not_same<void, base_type>::value,
679 "Failed to detect base type" );
680
682 nullable != JsonNullable::MustExist, Constructor, char const *,
683 char const *>::type;
684
685 static constexpr daw::string_view name = no_name;
686 static constexpr JsonParseTypes expected_type =
687 get_parse_type_v<JsonParseTypes::StringEscaped, nullable>;
691 json_details::get_bits_for<EmptyStringNull>( string_opts, Options );
692 static constexpr EightBitModes eight_bit_mode =
693 json_details::get_bits_for<EightBitModes>( string_opts, Options );
694
697
698 template<JSONNAMETYPE NewName>
699 using with_name =
702 };
703 } // namespace json_base
704
718 template<JSONNAMETYPE Name, typename String,
719 json_details::json_options_t Options, typename Constructor>
720 struct json_string : json_base::json_string<String, Options, Constructor> {
721 static constexpr daw::string_view name = Name;
722#if not defined( DAW_JSON_NO_FAIL_ON_NO_NAME_NAME )
723 static_assert( name != no_name,
724 "For no_name mappings, use the json_string_no_name "
725 "variant of mapping type" );
726#endif
727
728 template<JSONNAMETYPE NewName>
730
732 };
733
734 template<typename T = std::string,
736 typename Constructor = default_constructor<T>>
737 using json_string_no_name = json_base::json_string<T, Options, Constructor>;
738
739 template<typename T = std::optional<std::string>,
740 json_details::json_options_t Options = string_opts_def,
741 typename Constructor = nullable_constructor<T>>
742 using json_string_null_no_name = json_base::json_string<
743 T, json_details::string_opts_set<Options, JsonNullDefault>, Constructor>;
744
745 namespace json_base {
746 template<typename T, typename Constructor, JsonNullable Nullable>
747 struct json_date {
748 using i_am_a_json_type = void;
749 using constructor_t = Constructor;
750 using wrapped_type = T;
751 static constexpr bool must_be_class_member = false;
753 static_assert( traits::not_same<void, base_type>::value,
754 "Failed to detect base type" );
755
757 Nullable != JsonNullable::MustExist, Constructor, char const *,
758 std::size_t>::type;
759
760 static constexpr daw::string_view name = no_name;
761 static constexpr JsonParseTypes expected_type =
762 get_parse_type_v<JsonParseTypes::Date, Nullable>;
767 static constexpr JsonNullable nullable = Nullable;
768
769 template<JSONNAMETYPE NewName>
770 using with_name =
773 };
774 } // namespace json_base
775
783 template<JSONNAMETYPE Name, typename T, typename Constructor,
785 struct json_date : json_base::json_date<T, Constructor, Nullable> {
786 static constexpr daw::string_view name = Name;
787#if not defined( DAW_JSON_NO_FAIL_ON_NO_NAME_NAME )
788 static_assert( name != no_name,
789 "For no_name mappings, use the json_date_no_name variant "
790 "without a name argument" );
791#endif
792
793 template<JSONNAMETYPE NewName>
795
797 };
798
799 template<typename T, typename Constructor = default_constructor<T>,
800 JsonNullable Nullable = JsonNullable::MustExist>
801 using json_date_no_name = json_base::json_date<T, Constructor, Nullable>;
802
803 template<typename T, typename Constructor = nullable_constructor<T>>
805 json_base::json_date<T, Constructor, JsonNullDefault>;
806
807 namespace json_base {
808 template<typename T, typename Constructor,
810 struct json_class {
811 using i_am_a_json_type = void;
812 static constexpr daw::string_view name = no_name;
813 using wrapped_type = T;
814 static constexpr bool must_be_class_member = false;
815 static constexpr JsonNullable nullable =
816 json_details::get_bits_for<JsonNullable>( class_opts, Options );
820
822 static_assert( traits::not_same<void, base_type>::value,
823 "Failed to detect base type" );
824
826
827 using parse_to_t = typename std::conditional_t<
829 daw::traits::identity<base_type>,
830 daw::traits::identity<
831 typename data_contract::template result_type<constructor_t>>>::type;
832
833 static constexpr JsonParseTypes expected_type =
834 get_parse_type_v<JsonParseTypes::Class, nullable>;
839
840 template<JSONNAMETYPE NewName>
841 using with_name =
844 };
845 } // namespace json_base
846
856 template<JSONNAMETYPE Name, typename T, typename Constructor,
858 struct json_class : json_base::json_class<T, Constructor, Options> {
859
860 static constexpr daw::string_view name = Name;
861#if not defined( DAW_JSON_NO_FAIL_ON_NO_NAME_NAME )
862 static_assert( name != no_name,
863 "For no_name mappings, use the json_class_no_name variant "
864 "without a name argument" );
865#endif
866 template<JSONNAMETYPE NewName>
868
870 };
871
872 template<typename T, typename Constructor = default_constructor<T>,
873 json_details::json_options_t Options = class_opts_def>
874 using json_class_no_name = json_base::json_class<T, Constructor, Options>;
875
876 template<typename T, typename Constructor = nullable_constructor<T>,
877 json_details::json_options_t Options = class_opts_def>
878 using json_class_null_no_name = json_base::json_class<
879 T, Constructor, json_details::class_opts_set<Options, JsonNullDefault>>;
880
881 /***
882 * A type to hold the types for parsing variants.
883 * @tparam JsonElements Up to one of a JsonElement that is a JSON number,
884 * string, object, or array
885 */
886 template<typename... JsonElements>
888 [[deprecated( "Use json_variant_type_list, removal in v4" )]] =
889 json_variant_type_list<JsonElements...>;
890
891 template<typename>
893
898 template<typename... JsonElements>
900 json_variant_type_list<JsonElements...>> {
901 static_assert(
902 sizeof...( JsonElements ) <= 5U,
903 "There can be at most 5 items, one for each JsonBaseParseTypes" );
904
905 static_assert(
906 std::conjunction<
908 "Missing specialization of daw::json::json_data_contract for class "
909 "mapping or specialization of daw::json::json_link_basic_type_map" );
910
911 static constexpr std::size_t base_map[5] = {
912 json_details::find_json_element<JsonBaseParseTypes::Number>(
914 JsonElements>::underlying_json_type... } ),
915 json_details::find_json_element<JsonBaseParseTypes::Bool>(
917 JsonElements>::underlying_json_type... } ),
918 json_details::find_json_element<JsonBaseParseTypes::String>(
920 JsonElements>::underlying_json_type... } ),
921 json_details::find_json_element<JsonBaseParseTypes::Class>(
923 JsonElements>::underlying_json_type... } ),
924 json_details::find_json_element<JsonBaseParseTypes::Array>(
926 JsonElements>::underlying_json_type... } ) };
927 };
928
929 namespace json_base {
930 template<typename Variant, typename JsonElements, typename Constructor,
931 JsonNullable Nullable>
933 using i_am_a_json_type = void;
934 static constexpr bool must_be_class_member = false;
935 static constexpr JsonNullable nullable = Nullable;
936
937 using json_elements = typename std::conditional_t<
938 std::is_same<JsonElements, json_deduce_type>::value,
940 daw::traits::identity<JsonElements>>::type;
941 static_assert(
942 std::is_same<typename json_elements::i_am_variant_type_list,
943 void>::value,
944 "Expected a json_variant_type_list or could not deduce alternatives "
945 "from Variant" );
946
951 static_assert( traits::not_same<void, base_type>::value,
952 "Failed to detect base type" );
954 static constexpr daw::string_view name = no_name;
955 static constexpr JsonParseTypes expected_type =
956 get_parse_type_v<JsonParseTypes::Variant, nullable>;
959
963
964 template<JSONNAMETYPE NewName>
965 using with_name =
966 daw::json::json_variant<NewName, Variant, JsonElements, Constructor,
967 Nullable>;
969 };
970 } // namespace json_base
971
972 /***
973 * Link to a nullable JSON variant
974 * @tparam Name name of JSON member to link to
975 * @tparam T type that has specialization of
976 * daw::json::json_data_contract
977 * @tparam JsonElements a json_variant_type_list
978 * @tparam Constructor A callable used to construct T. The
979 * default supports normal and aggregate construction
980 */
981 template<JSONNAMETYPE Name, typename Variant, typename JsonElements,
982 typename Constructor, JsonNullable Nullable>
984 : json_base::json_variant<Variant, JsonElements, Constructor, Nullable> {
985 static constexpr daw::string_view name = Name;
986#if not defined( DAW_JSON_NO_FAIL_ON_NO_NAME_NAME )
987 static_assert( name != no_name,
988 "For no_name mappings, use the json_variant_no_name "
989 "variant without a name argument" );
990#endif
991 template<JSONNAMETYPE NewName>
992 using with_name =
994
997 };
998
999 template<typename Variant, typename JsonElements = json_deduce_type,
1000 typename Constructor = default_constructor<Variant>,
1003 json_base::json_variant<Variant, JsonElements, Constructor,
1005
1006 template<typename Variant, typename JsonElements = json_deduce_type,
1007 typename Constructor = nullable_constructor<Variant>>
1009 json_base::json_variant<Variant, JsonElements, Constructor,
1011
1012 namespace json_base {
1013 template<typename T, typename TagMember, typename Switcher,
1014 typename JsonElements, typename Constructor,
1015 JsonNullable Nullable>
1017 using i_am_a_json_type = void;
1019 static constexpr JsonNullable nullable = Nullable;
1020 static constexpr bool must_be_class_member = false;
1021
1022 using json_elements = typename std::conditional_t<
1023 std::is_same<JsonElements, json_deduce_type>::value,
1025 daw::traits::identity<JsonElements>>::type;
1026 static_assert(
1027 std::is_same<typename json_elements::i_am_variant_type_list,
1028 void>::value,
1029 "Expected a json_variant_type_list or could not deduce alternatives "
1030 "from Variant" );
1031
1032 using wrapped_type = T;
1033
1034 static_assert( json_details::is_a_json_type_v<TagMember>,
1035 "The TagMember type must have a name and be a "
1036 "member of the same object as this" );
1037 /* static_assert( json_details::is_nullability_compatable_v<
1038 nullable, TagMember::nullable>,
1039 "The TagMember nullability nullable type" );*/
1040 using dependent_member = TagMember;
1041
1042 static_assert(
1043 std::disjunction_v<
1045 std::conjunction<
1047 daw::not_trait<json_details::is_no_name<TagMember>>>>,
1048 "Must specify the location in tuple or name of member "
1049 "for TagMember" );
1050
1051 using tag_member = typename std::conditional_t<
1053 daw::traits::identity<TagMember>,
1054 daw::traits::identity<json_details::json_deduced_type<TagMember>>>::
1055 type;
1056
1057 using tag_member_class_wrapper = std::conditional_t<
1058 json_details::is_an_ordered_member_v<tag_member>,
1060 json_deduce_type, tuple_opts_def,
1063
1064 using switcher = Switcher;
1068 static_assert( traits::not_same<void, base_type>::value,
1069 "Failed to detect base type" );
1070 using parse_to_t = T;
1071 static constexpr daw::string_view name = no_name;
1073 get_parse_type_v<JsonParseTypes::VariantTagged, nullable>;
1078
1079 template<JSONNAMETYPE NewName>
1081 daw::json::json_tagged_variant<NewName, T, TagMember, Switcher,
1082 JsonElements, Constructor, Nullable>;
1084 };
1085 } // namespace json_base
1086
1087 /***
1088 * Link to a nullable variant like data type that is discriminated via
1089 * another member.
1090 * @tparam Name name of JSON member to link to
1091 * @tparam T type of value to construct
1092 * @tparam TagMember JSON element to pass to Switcher. Does not have to be
1093 * declared in member list
1094 * @tparam Switcher A callable that returns an index into JsonElements when
1095 * passed the TagMember object in parent member list
1096 * @tparam JsonElements a json_tagged_variant_type_list, defaults to type
1097 * elements of T when T is a std::variant and they are all auto mappable
1098 * @tparam Constructor A callable used to construct T. The
1099 * default supports normal and aggregate construction
1100 */
1101 template<JSONNAMETYPE Name, typename T, typename TagMember,
1102 typename Switcher, typename JsonElements, typename Constructor,
1105 : json_base::json_tagged_variant<T, TagMember, Switcher, JsonElements,
1106 Constructor, Nullable> {
1107
1108 static constexpr daw::string_view name = Name;
1109#if not defined( DAW_JSON_NO_FAIL_ON_NO_NAME_NAME )
1110 static_assert(
1111 name != no_name,
1112 "For no_name mappings, use the json_tagged_variant_no_name variant "
1113 "without a name argument" );
1114#endif
1115
1116 template<JSONNAMETYPE NewName>
1118 json_tagged_variant<NewName, T, TagMember, Switcher, JsonElements,
1119 Constructor, Nullable>;
1120
1122 json_base::json_tagged_variant<T, TagMember, Switcher, JsonElements,
1123 Constructor, Nullable>;
1124 };
1125
1126 template<typename T, typename TagMember, typename Switcher,
1127 typename JsonElements = json_deduce_type,
1128 typename Constructor = default_constructor<T>,
1131 json_base::json_tagged_variant<T, TagMember, Switcher, JsonElements,
1132 Constructor, Nullable>;
1133
1134 template<typename T, typename TagMember, typename Switcher,
1135 typename JsonElements = json_deduce_type,
1136 typename Constructor = default_constructor<T>>
1138 json_base::json_tagged_variant<T, TagMember, Switcher, JsonElements,
1139 Constructor, JsonNullDefault>;
1140
1141 namespace json_base {
1142 template<typename T, typename FromJsonConverter, typename ToJsonConverter,
1145 using i_am_a_json_type = void;
1146 using to_converter_t = ToJsonConverter;
1147 using from_converter_t = FromJsonConverter;
1148 using constructor_t = FromJsonConverter;
1149 static constexpr bool must_be_class_member = false;
1150
1151 static constexpr JsonNullable nullable =
1152 json_details::get_bits_for<JsonNullable>( json_custom_opts, Options );
1153
1155 static_assert( traits::not_same<void, base_type>::value,
1156 "Failed to detect base type" );
1157
1159 nullable != JsonNullable::MustExist, FromJsonConverter,
1160 std::string_view>::type;
1161
1162 static_assert(
1163 std::is_invocable_v<ToJsonConverter, parse_to_t> or
1164 std::is_invocable_r<char *, ToJsonConverter, char *,
1165 parse_to_t>::value,
1166 "ToConverter must be callable with T or T and and OutputIterator" );
1167 static constexpr daw::string_view name = no_name;
1169 get_parse_type_v<JsonParseTypes::Custom, nullable>;
1172
1174 json_details::get_bits_for<JsonCustomTypes>( json_custom_opts,
1175 Options );
1176
1179
1180 template<JSONNAMETYPE NewName>
1181 using with_name = daw::json::json_custom<NewName, T, FromJsonConverter,
1182 ToJsonConverter, Options>;
1184 };
1185 } // namespace json_base
1186
1196 template<JSONNAMETYPE Name, typename T, typename FromJsonConverter,
1197 typename ToJsonConverter, json_details::json_options_t Options>
1199 : json_base::json_custom<T, FromJsonConverter, ToJsonConverter, Options> {
1200
1201 static constexpr daw::string_view name = Name;
1202#if not defined( DAW_JSON_NO_FAIL_ON_NO_NAME_NAME )
1203 static_assert( name != no_name,
1204 "For no_name mappings, use the json_custom_no_name "
1205 "variant without a name argument" );
1206#endif
1207
1208 template<JSONNAMETYPE NewName>
1211
1214 };
1215
1216 template<typename T,
1217 typename FromJsonConverter = default_from_json_converter_t<T>,
1218 typename ToJsonConverter = default_to_json_converter_t<T>,
1221 json_base::json_custom<T, FromJsonConverter, ToJsonConverter, Options>;
1222
1223 template<typename T,
1224 typename FromJsonConverter = default_from_json_converter_t<T>,
1225 typename ToJsonConverter = default_to_json_converter_t<T>,
1227 using json_custom_lit_no_name = json_base::json_custom<
1228 T, FromJsonConverter, ToJsonConverter,
1229 json_details::json_custom_opts_set<Options, JsonCustomTypes::Literal>>;
1230
1231 template<typename T,
1232 typename FromJsonConverter = default_from_json_converter_t<T>,
1233 typename ToJsonConverter = default_to_json_converter_t<T>,
1235 using json_custom_null_no_name = json_base::json_custom<
1236 T, FromJsonConverter, ToJsonConverter,
1237 json_details::json_custom_opts_set<Options, JsonNullDefault>>;
1238
1239 template<typename T,
1240 typename FromJsonConverter = default_from_json_converter_t<T>,
1241 typename ToJsonConverter = default_to_json_converter_t<T>,
1243 using json_custom_lit_null_no_name = json_base::json_custom<
1244 T, FromJsonConverter, ToJsonConverter,
1247
1248 namespace json_base {
1249 template<typename JsonElement, typename Container, typename Constructor,
1250 JsonNullable Nullable>
1251 struct json_array {
1252 using i_am_a_json_type = void;
1253 static constexpr bool must_be_class_member = false;
1254 static_assert(
1255 json_details::has_unnamed_default_type_mapping_v<JsonElement>,
1256 "Missing specialization of daw::json::json_data_contract for class "
1257 "mapping or specialization of daw::json::json_link_basic_type_map" );
1259 using json_element_parse_to_t = typename json_element_t::parse_to_t;
1260
1261 static_assert( traits::not_same_v<json_element_t, void>,
1262 "Unknown JsonElement type." );
1263 static_assert( json_details::is_a_json_type_v<json_element_t>,
1264 "Error determining element type" );
1266 std::conditional_t<std::is_same_v<Container, json_deduce_type>,
1267 std::vector<json_element_parse_to_t>, Container>;
1268 static constexpr JsonNullable nullable = Nullable;
1269 using constructor_t = std::conditional_t<
1270 std::is_same_v<Constructor, json_deduce_type>,
1271 std::conditional_t<nullable == JsonNullable::MustExist,
1274 Constructor>;
1275
1277 static_assert( traits::not_same_v<void, base_type>,
1278 "Failed to detect base type" );
1279
1283 json_element_parse_to_t const *>::type;
1284
1285 static constexpr daw::string_view name = no_name;
1286
1288 get_parse_type_v<JsonParseTypes::Array, nullable>;
1289
1292
1293 static_assert( json_element_t::name == no_name_sv,
1294 "All elements of json_array must be have no_name" );
1297
1298 template<JSONNAMETYPE NewName>
1299 using with_name = daw::json::json_array<NewName, JsonElement, Container,
1300 Constructor, Nullable>;
1302 };
1303 } // namespace json_base
1304
1316 template<JSONNAMETYPE Name, typename JsonElement, typename Container,
1317 typename Constructor, JsonNullable Nullable>
1319 : json_base::json_array<JsonElement, Container, Constructor, Nullable> {
1320
1321 static constexpr daw::string_view name = Name;
1322#if not defined( DAW_JSON_NO_FAIL_ON_NO_NAME_NAME )
1323 static_assert( name != no_name,
1324 "For no_name mappings, use the json_array_no_name variant "
1325 "without a name argument" );
1326#endif
1327 template<JSONNAMETYPE NewName>
1330
1333 };
1334
1335 template<typename JsonElement, typename Container = json_deduce_type,
1336 typename Constructor = json_deduce_type,
1339 json_base::json_array<JsonElement, Container, Constructor, Nullable>;
1340
1341 template<typename JsonElement, typename Container = json_deduce_type,
1342 typename Constructor = json_deduce_type>
1344 json_base::json_array<JsonElement, Container, Constructor,
1346
1347 namespace json_base {
1348 template<typename JsonElement, typename SizeMember, typename Container,
1349 typename Constructor, JsonNullable Nullable>
1351 using i_am_a_json_type = void;
1352 static constexpr bool must_be_class_member = true;
1353 static constexpr JsonNullable nullable = Nullable;
1354 static_assert(
1355 json_details::has_unnamed_default_type_mapping_v<JsonElement>,
1356 "Missing specialization of daw::json::json_data_contract for class "
1357 "mapping or specialization of daw::json::json_link_basic_type_map" );
1359 static_assert( traits::not_same_v<json_element_t, void>,
1360 "Unknown JsonElement type." );
1361 static_assert( json_details::is_a_json_type_v<json_element_t>,
1362 "Error determining element type" );
1363
1364 using json_element_parse_to_t = typename json_element_t::parse_to_t;
1365
1367 std::conditional_t<std::is_same_v<Container, json_deduce_type>,
1368 std::vector<json_element_parse_to_t>, Container>;
1369 using constructor_t = std::conditional_t<
1370 std::is_same_v<Constructor, json_deduce_type>,
1371 std::conditional_t<nullable == JsonNullable::MustExist,
1374 Constructor>;
1375
1376 static_assert( json_details::is_a_json_type_v<SizeMember>,
1377 "The SizeMember type must have a name and be a "
1378 "member of the same object as this" );
1380 nullable, SizeMember::nullable>,
1381 "The SizeMember cannot be a nullable type" );
1382 using dependent_member = SizeMember;
1383
1385 static_assert( traits::not_same_v<void, base_type>,
1386 "Failed to detect base type" );
1387
1391 std::size_t>::type;
1392
1393 static constexpr daw::string_view name = no_name;
1394
1396 get_parse_type_v<JsonParseTypes::SizedArray, nullable>;
1397
1400
1401 static_assert( json_element_t::name == no_name_sv,
1402 "All elements of json_array must be have no_name" );
1405
1406 template<JSONNAMETYPE NewName>
1408 daw::json::json_sized_array<NewName, JsonElement, SizeMember,
1409 Container, Constructor, Nullable>;
1411 };
1412 } // namespace json_base
1413
1414 template<JSONNAMETYPE Name, typename JsonElement, typename SizeMember,
1415 typename Container, typename Constructor, JsonNullable Nullable>
1417 : json_base::json_sized_array<JsonElement, SizeMember, Container,
1418 Constructor, Nullable> {
1419
1420 static constexpr daw::string_view name = Name;
1421#if not defined( DAW_JSON_NO_FAIL_ON_NO_NAME_NAME )
1422 static_assert(
1423 name != no_name,
1424 "For no_name mappings, use the json_sized_array_no_name variant "
1425 "without a name argument" );
1426#endif
1427 template<JSONNAMETYPE NewName>
1428 using with_name = json_sized_array<NewName, SizeMember, JsonElement,
1429 Container, Constructor, Nullable>;
1430
1432 json_base::json_sized_array<JsonElement, SizeMember, Container,
1433 Constructor, Nullable>;
1434 };
1435
1436 template<typename JsonElement, typename SizeMember,
1437 typename Container = json_deduce_type,
1438 typename Constructor = json_deduce_type,
1441 json_base::json_sized_array<JsonElement, SizeMember, Container,
1442 Constructor, Nullable>;
1443
1444 template<typename JsonElement, typename SizeMember,
1445 typename Container = json_deduce_type,
1446 typename Constructor = json_deduce_type>
1448 json_base::json_sized_array<JsonElement, SizeMember, Container,
1449 Constructor, JsonNullDefault>;
1450
1451 namespace json_base {
1452 template<typename Container, typename JsonValueType, typename JsonKeyType,
1453 typename Constructor, JsonNullable Nullable>
1455 using i_am_a_json_type = void;
1456 static constexpr bool must_be_class_member = false;
1460
1461 static_assert( traits::not_same_v<void, base_type>,
1462 "Failed to detect base type" );
1463
1464 static_assert(
1465 json_details::has_unnamed_default_type_mapping_v<JsonValueType>,
1466 "Missing specialization of daw::json::json_data_contract for class "
1467 "mapping or specialization of daw::json::json_link_basic_type_map" );
1468
1470
1471 static_assert( traits::not_same_v<json_element_t, void>,
1472 "Unknown JsonValueType type." );
1473 static_assert( json_element_t::name == no_name_sv,
1474 "Value member name must be the default no_name" );
1475 static_assert(
1476 json_details::has_unnamed_default_type_mapping_v<JsonKeyType>,
1477 "Missing specialization of daw::json::json_data_contract for class "
1478 "mapping or specialization of daw::json::json_link_basic_type_map" );
1479
1481
1482 static_assert( traits::not_same_v<json_key_t, void>,
1483 "Unknown JsonKeyType type." );
1484 static_assert( json_details::is_no_name_v<json_key_t>,
1485 "Key member name must be the default no_name" );
1486
1488 Container; /*typename json_details::construction_result<
1489Nullable != JsonNullable::MustExist, Constructor,
1490
1491std::pair<typename json_key_t::parse_to_t const,
1492 typename json_element_t::parse_to_t> const *,
1493std::pair<typename json_key_t::parse_to_t const,
1494 typename json_element_t::parse_to_t> const *>::type;*/
1495
1496 static constexpr daw::string_view name = no_name;
1498 get_parse_type_v<JsonParseTypes::KeyValue, Nullable>;
1503 static constexpr JsonNullable nullable = Nullable;
1504
1505 template<JSONNAMETYPE NewName>
1507 daw::json::json_key_value<NewName, Container, JsonValueType,
1508 JsonKeyType, Constructor, Nullable>;
1510 };
1511 } // namespace json_base
1512
1527 template<JSONNAMETYPE Name, typename Container, typename JsonValueType,
1528 typename JsonKeyType, typename Constructor, JsonNullable Nullable>
1530 : json_base::json_key_value<Container, JsonValueType, JsonKeyType,
1531 Constructor, Nullable> {
1532
1533 static constexpr daw::string_view name = Name;
1534#if not defined( DAW_JSON_NO_FAIL_ON_NO_NAME_NAME )
1535 static_assert( name != no_name,
1536 "For no_name mappings, use the json_key_value_no_name "
1537 "variant without a name argument" );
1538#endif
1539
1540 template<JSONNAMETYPE NewName>
1541 using with_name = json_key_value<NewName, Container, JsonValueType,
1542 JsonKeyType, Constructor, Nullable>;
1544 json_base::json_key_value<Container, JsonValueType, JsonKeyType,
1545 Constructor, Nullable>;
1546 };
1547
1548 template<typename Container,
1549 typename JsonValueType = typename Container::mapped_type,
1550 typename JsonKeyType = typename Container::key_type,
1551 typename Constructor = default_constructor<Container>,
1554 json_base::json_key_value<Container, JsonValueType, JsonKeyType,
1555 Constructor, Nullable>;
1556
1557 template<typename Container,
1558 typename JsonValueType = typename Container::mapped_type,
1559 typename JsonKeyType = typename Container::key_type,
1560 typename Constructor = nullable_constructor<Container>>
1562 json_base::json_key_value<Container, JsonValueType, JsonKeyType,
1563 Constructor, JsonNullDefault>;
1564
1565 namespace json_base {
1566 template<typename Container, typename JsonValueType, typename JsonKeyType,
1567 typename Constructor, JsonNullable Nullable>
1569 using i_am_a_json_type = void;
1570 static constexpr bool must_be_class_member = false;
1574 static_assert( traits::not_same_v<void, base_type>,
1575 "Failed to detect base type" );
1576
1578 Nullable != JsonNullable::MustExist, Constructor, base_type>::type;
1579
1583
1584 static_assert( traits::not_same_v<json_key_t, void>,
1585 "Unknown JsonKeyType type." );
1586 static_assert( daw::string_view( json_key_t::name ) !=
1587 daw::string_view( no_name ),
1588 "Must supply a valid key member name" );
1592
1595 std::conditional_t<
1600 static_assert( traits::not_same_v<json_value_t, void>,
1601 "Unknown JsonValueType type." );
1602 static_assert( daw::string_view( json_value_t::name ) !=
1603 daw::string_view( no_name ),
1604 "Must supply a valid value member name" );
1605 static_assert( daw::string_view( json_key_t::name ) !=
1606 daw::string_view( json_value_t::name ),
1607 "Key and Value member names cannot be the same" );
1608 static constexpr daw::string_view name = no_name;
1610 get_parse_type_v<JsonParseTypes::KeyValueArray, Nullable>;
1615 static constexpr JsonNullable nullable = Nullable;
1616
1617 template<JSONNAMETYPE NewName>
1619 daw::json::json_key_value_array<NewName, Container, JsonValueType,
1620 JsonKeyType, Constructor, Nullable>;
1622 };
1623 } // namespace json_base
1624
1640 template<JSONNAMETYPE Name, typename Container, typename JsonValueType,
1641 typename JsonKeyType, typename Constructor, JsonNullable Nullable>
1643 : json_base::json_key_value_array<Container, JsonValueType, JsonKeyType,
1644 Constructor, Nullable> {
1645
1646 static constexpr daw::string_view name = Name;
1647#if not defined( DAW_JSON_NO_FAIL_ON_NO_NAME_NAME )
1648 static_assert(
1649 name != no_name,
1650 "For no_name mappings, use the json_key_value_array_no_name variant "
1651 "without a name argument" );
1652#endif
1653
1654 template<JSONNAMETYPE NewName>
1656 json_key_value_array<NewName, Container, JsonValueType, JsonKeyType,
1657 Constructor, Nullable>;
1659 json_base::json_key_value_array<Container, JsonValueType, JsonKeyType,
1660 Constructor, Nullable>;
1661 };
1662
1663 template<typename Container,
1664 typename JsonValueType = typename Container::mapped_type,
1665 typename JsonKeyType = typename Container::key_type,
1666 typename Constructor = default_constructor<Container>,
1669 json_base::json_key_value_array<Container, JsonValueType, JsonKeyType,
1670 Constructor, Nullable>;
1671
1672 template<typename Container,
1673 typename JsonValueType = typename Container::mapped_type,
1674 typename JsonKeyType = typename Container::key_type,
1675 typename Constructor = nullable_constructor<Container>>
1677 json_base::json_key_value_array<Container, JsonValueType, JsonKeyType,
1678 Constructor, JsonNullDefault>;
1679
1680 namespace json_base {
1681 template<typename Tuple, typename Constructor,
1683 typename JsonTupleTypesList>
1684 struct json_tuple {
1685 using i_am_a_json_type = void;
1686 static constexpr daw::string_view name = no_name;
1687
1689 static constexpr bool must_be_class_member = false;
1690 static constexpr bool force_aggregate_construction = false;
1691
1692 static constexpr JsonNullable nullable =
1693 json_details::get_bits_for<JsonNullable>( tuple_opts, Options );
1694
1696
1697 using sub_member_list = typename std::conditional_t<
1698 std::is_same<JsonTupleTypesList, json_deduce_type>::value,
1699 daw::traits::identity<json_details::tuple_types_list<Tuple>>,
1700 daw::traits::identity<
1702
1703 using constructor_t = std::conditional_t<
1704 std::is_same<Constructor, json_deduce_type>::value,
1705 std::conditional_t<nullable == JsonNullable::MustExist,
1711
1712 static_assert( traits::not_same<void, base_type>::value,
1713 "Failed to detect base type" );
1714
1717
1719 get_parse_type_v<JsonParseTypes::Tuple, nullable>;
1724
1725 template<JSONNAMETYPE NewName>
1729 };
1730 } // namespace json_base
1731
1732 template<JSONNAMETYPE Name, typename Tuple, typename Constructor,
1733 json_details::json_options_t Options, typename JsonTupleTypesList>
1735 : json_base::json_tuple<Tuple, Constructor, Options, JsonTupleTypesList> {
1736 static constexpr daw::string_view name = Name;
1737#if not defined( DAW_JSON_NO_FAIL_ON_NO_NAME_NAME )
1738 static_assert( name != no_name,
1739 "For no_name mappings, use the json_tuple_no_name "
1740 "variant without a name argument" );
1741#endif
1742
1743 template<JSONNAMETYPE NewName>
1746
1749 };
1750
1751 template<typename Tuple, typename Constructor = default_constructor<Tuple>,
1752 json_details::json_options_t Options = tuple_opts_def,
1753 typename JsonTupleTypesList = json_deduce_type>
1755 json_base::json_tuple<Tuple, Constructor, Options, JsonTupleTypesList>;
1756
1757 template<typename Tuple, typename Constructor = default_constructor<Tuple>,
1758 json_details::json_options_t Options = tuple_opts_def,
1759 typename JsonTupleTypesList = json_deduce_type>
1760 using json_tuple_null_no_name = json_base::json_tuple<
1761 Tuple, Constructor,
1762 json_details::tuple_opts_set<Options, JsonNullDefault>,
1763 JsonTupleTypesList>;
1764
1765 namespace json_base {
1766 template<typename Variant, typename TagMember, typename Switcher,
1767 typename AlternativeMappings, typename Constructor,
1768 JsonNullable Nullable>
1770 using i_am_a_json_type = void;
1772 static constexpr JsonNullable nullable = Nullable;
1773 static constexpr bool must_be_class_member = false;
1774
1775 using json_elements = typename std::conditional_t<
1776 std::is_same_v<AlternativeMappings, json_deduce_type>,
1778 daw::traits::identity<AlternativeMappings>>::type;
1779
1780 static_assert(
1781 std::is_same<typename json_elements::i_am_variant_type_list,
1782 void>::value,
1783 "Expected a json_variant_type_list or could not deduce alternatives "
1784 "from Variant" );
1785
1787
1788 using tag_submember = typename std::conditional_t<
1790 daw::traits::identity<TagMember>,
1791 daw::traits::identity<json_details::json_deduced_type<TagMember>>>::
1792 type;
1793
1794 static_assert( json_details::is_a_json_type_v<tag_submember>,
1795 "The TagMember type must have a name and be a "
1796 "member of the same object as this" );
1797
1798 static_assert(
1799 std::is_invocable_v<Switcher, typename tag_submember::parse_to_t>,
1800 "There is a mismatch between the Switcher and the TagMember's parsed "
1801 "result" );
1802
1803 using switcher = Switcher;
1804
1805 using tag_submember_class_wrapper = std::conditional_t<
1808 json_deduce_type, tuple_opts_def,
1811
1815 static_assert( traits::not_same<void, base_type>::value,
1816 "Failed to detect base type" );
1818 static constexpr daw::string_view name = no_name;
1820 get_parse_type_v<JsonParseTypes::VariantIntrusive, nullable>;
1825
1826 using json_container_type = std::conditional_t<
1827 std::disjunction_v<json_details::is_an_ordered_member<
1831 json_tuple<std::tuple<typename json_details::json_deduced_type<
1834 std::tuple<typename json_details::json_deduced_type<
1838
1839 template<JSONNAMETYPE NewName>
1841 daw::json::json_intrusive_variant<NewName, Variant, TagMember,
1842 Switcher, AlternativeMappings,
1843 Constructor, Nullable>;
1845 };
1846 } // namespace json_base
1847 /***
1848 * Link to a nullable variant like data type that is discriminated via
1849 * another member.
1850 * @tparam Name name of JSON member to link to
1851 * @tparam T type of value to construct
1852 * @tparam TagMember JSON element to pass to Switcher. Does not have to be
1853 * declared in member list
1854 * @tparam Switcher A callable that returns an index into JsonElements when
1855 * passed the TagMember object in parent member list
1856 * @tparam JsonElements a json_tagged_variant_type_list, defaults to type
1857 * elements of T when T is a std::variant and they are all auto mappable
1858 * @tparam Constructor A callable used to construct T. The
1859 * default supports normal and aggregate construction
1860 */
1861 template<JSONNAMETYPE Name, typename T, typename TagMember,
1862 typename Switcher, typename JsonElements, typename Constructor,
1865 : json_base::json_intrusive_variant<T, TagMember, Switcher, JsonElements,
1866 Constructor, Nullable> {
1867
1868 static constexpr daw::string_view name = Name;
1869#if not defined( DAW_JSON_NO_FAIL_ON_NO_NAME_NAME )
1870 static_assert(
1871 name != no_name,
1872 "For no_name mappings, use the json_intrusive_variant_no_name variant "
1873 "without a name argument" );
1874#endif
1875
1876 template<JSONNAMETYPE NewName>
1878 json_intrusive_variant<NewName, T, TagMember, Switcher, JsonElements,
1879 Constructor, Nullable>;
1880
1882 json_base::json_intrusive_variant<T, TagMember, Switcher, JsonElements,
1883 Constructor, Nullable>;
1884 };
1885
1886 template<typename T, typename TagMember, typename Switcher,
1887 typename JsonElements = json_details::
1888 determine_variant_element_types<JsonNullable::MustExist, T>,
1889 typename Constructor = default_constructor<T>,
1892 json_base::json_intrusive_variant<T, TagMember, Switcher, JsonElements,
1893 Constructor, Nullable>;
1894
1895 template<typename T, typename TagMember, typename Switcher,
1896 typename JsonElements = json_details::
1897 determine_variant_element_types<JsonNullable::MustExist, T>,
1898 typename Constructor = default_constructor<T>>
1900 json_base::json_intrusive_variant<T, TagMember, Switcher, JsonElements,
1901 Constructor, JsonNullDefault>;
1902
1903 /***
1904 * An untyped JSON value
1905 */
1907
1908 /***
1909 * A name/value pair of string_view/json_value. This is used for iterating
1910 * class members in a json_value
1911 */
1913
1914 /***
1915 * json_raw allows for raw JSON access to the member data. It requires a
1916 * type that is constructable from (char const *, std::size_t) arguments and
1917 * for serialization requires that it can be passed to std::begin/std::end
1918 * and the iterator returned has a value_type of char
1919 * @tparam Name json member name
1920 * @tparam T type to hold raw JSON data, defaults to json_value
1921 * @tparam Constructor A callable used to construct T.
1922 * @tparam Nullable Does the value have to exist in the document or can it
1923 * have a null value
1924 */
1925 template<JSONNAMETYPE Name, typename T = json_value,
1926 typename Constructor = default_constructor<T>,
1928 struct json_raw;
1929
1930 namespace json_base {
1931 /***
1932 * json_raw allows for raw JSON access to the member data. It requires a
1933 * type that is constructable from (char const *, std::size_t) arguments
1934 * and for serialization requires that it can be passed to
1935 * std::begin/std::end and the iterator returned has a value_type of char.
1936 * Any whitespace surrounding the value may not be preserved. The default
1937 * T json_value allows for delaying the parsing of this member until later
1938 * @tparam T type to hold raw JSON data, defaults to json_value
1939 * @tparam Constructor A callable used to construct T.
1940 * @tparam Nullable Does the value have to exist in the document or can it
1941 * have a null value
1942 */
1943 template<typename T, typename Constructor, JsonNullable Nullable>
1944 struct json_raw {
1945 using i_am_a_json_type = void;
1946 static constexpr bool must_be_class_member = false;
1948 using constructor_t = Constructor;
1949 static constexpr JsonNullable nullable = Nullable;
1951 static_assert( traits::not_same_v<void, base_type>,
1952 "Failed to detect base type" );
1953
1955 nullable != JsonNullable::MustExist, Constructor, char const *,
1956 char const *>::type;
1957
1958 static constexpr daw::string_view name = no_name;
1959
1961 get_parse_type_v<JsonParseTypes::Unknown, nullable>;
1964
1967
1968 template<JSONNAMETYPE NewName>
1972 };
1973 } // namespace json_base
1974
1975 /***
1976 * json_raw allows for raw JSON access to the member data. It requires a
1977 * type that is constructable from (char const *, std::size_t) arguments and
1978 * for serialization requires that it can be passed to std::begin/std::end
1979 * and the iterator returned has a value_type of char. Any whitespace
1980 * surrounding the value may not be preserved. The default T json_value
1981 * allows for delaying the parsing of this member until later
1982 * @tparam Name json member name
1983 * @tparam T type to hold raw JSON data, defaults to json_value
1984 * @tparam Constructor A callable used to construct T.
1985 * @tparam Nullable Does the value have to exist in the document or can it
1986 * have a null value
1987 */
1988 template<JSONNAMETYPE Name, typename T, typename Constructor,
1990 struct json_raw : json_base::json_raw<T, Constructor, Nullable> {
1991 static constexpr daw::string_view name = Name;
1992#if not defined( DAW_JSON_NO_FAIL_ON_NO_NAME_NAME )
1993 static_assert( name != no_name,
1994 "For no_name mappings, use the json_raw_no_name "
1995 "variant without a name argument" );
1996#endif
1997
1998 template<JSONNAMETYPE NewName>
2000
2002 };
2003
2004 template<JSONNAMETYPE Name, typename T = json_value,
2005 typename Constructor = default_constructor<T>,
2008 [[deprecated( "Was renamed to json_raw, will be removed in v4" )]] =
2010
2011 /***
2012 * json_raw_null allows for raw JSON access to the nullable member data.
2013 * It requires a type that is constructable from (char const *,
2014 * std::size_t) arguments and for serialization requires that it can be
2015 * passed to std::begin/std::end and the iterator returned has a
2016 * value_type of char. Any whitespace
2017 * surrounding the value may not be preserved. The default T json_value
2018 * allows for delaying the parsing of this member until later
2019 * @tparam Name json member name
2020 * @tparam T type to hold raw JSON data, defaults to json_value
2021 * @tparam Constructor A callable used to construct T.
2022 */
2023 template<JSONNAMETYPE Name, typename T = std::optional<json_value>,
2024 typename Constructor = nullable_constructor<T>>
2026
2027 template<JSONNAMETYPE Name, typename T = std::optional<json_value>,
2028 typename Constructor = nullable_constructor<T>>
2030 [[deprecated( "Was renamed to json_raw_null, will be removed in v4" )]] =
2032
2033 /***
2034 * json_raw allows for raw JSON access to the member data. It requires a
2035 * type that is constructable from (char const *, std::size_t) arguments and
2036 * for serialization requires that it can be passed to std::begin/std::end
2037 * and the iterator returned has a value_type of char. Any whitespace
2038 * surrounding the value may not be preserved. The default T json_value
2039 * allows for delaying the parsing of this member until later
2040 * @tparam T type to hold raw JSON data, defaults to json_value
2041 * @tparam Constructor A callable used to construct T.
2042 * @tparam Nullable Does the value have to exist in the document or can it
2043 * have a null value
2044 */
2045 template<typename T = json_value,
2046 typename Constructor = default_constructor<T>,
2048 using json_raw_no_name = json_base::json_raw<T, Constructor, Nullable>;
2049
2050 /***
2051 * json_raw_null allows for raw JSON access to the nullable member data.
2052 * It requires a type that is constructable from (char const *,
2053 * std::size_t) arguments and for serialization requires that it can be
2054 * passed to std::begin/std::end and the iterator returned has a
2055 * value_type of char. Any whitespace
2056 * surrounding the value may not be preserved. The default T json_value
2057 * allows for delaying the parsing of this member until later
2058 * @tparam T type to hold raw JSON data, defaults to json_value
2059 * @tparam Constructor A callable used to construct T.
2060 */
2061 template<typename T = std::optional<json_value>,
2062 typename Constructor = nullable_constructor<T>>
2064 json_base::json_raw<T, Constructor, JsonNullDefault>;
2065
2066 template<typename ParseState>
2068 using type =
2070 };
2071
2075 template<JSONNAMETYPE Name, typename T>
2077 json_details::json_deduced_type<T>>::template with_name<Name>;
2078
2083 template<typename T>
2085 json_details::ensure_mapped_t<json_details::json_deduced_type<T>>;
2086 } // namespace DAW_JSON_VER
2087} // namespace daw::json
Definition: daw_json_value.h:320
#define daw_json_assert_weak(Bool,...)
Definition: daw_json_assert.h:190
#define JSONNAMETYPE
Definition: daw_json_name.h:111
ParseState & parse_state
Definition: daw_json_parse_class.h:182
Iterator & it
Definition: daw_json_traits.h:251
std::conditional_t< Nullable, std::conditional_t< std::is_invocable_v< Constructor, Args... >, std::conditional_t< std::is_invocable_v< Constructor >, std::invoke_result< Constructor >, traits::identity< nullable_constructor_cannot_be_invoked< Constructor > > >, traits::identity< nullable_constructor_cannot_be_invoked< Constructor, Args... > > >, std::conditional_t< std::is_invocable_v< Constructor, Args... >, std::invoke_result< Constructor, Args... >, traits::identity< constructor_cannot_be_invoked< Constructor, Args... > > > > construction_result
Definition: daw_json_traits.h:98
constexpr bool has_json_data_contract_trait_v
Definition: daw_json_parse_common.h:180
std::conditional_t< is_an_ordered_member_v< JsonMember >, JsonMember, json_deduced_type< JsonMember > > json_tuple_member_wrapper
Definition: daw_json_link_types.h:209
constexpr json_result< JsonClass > parse_json_class(ParseState &parse_state, std::index_sequence< Is... >)
Definition: daw_json_parse_class.h:220
copy_name_when< JsonMember, NewName, is_no_name_v< JsonMember > > copy_name_when_noname
Definition: daw_json_traits.h:112
constexpr DAW_ATTRIB_INLINE json_result< JsonMember > parse_value(ParseState &parse_state, ParseTag< JsonParseTypes::Real >)
Definition: daw_json_parse_value.h:75
constexpr OutputIterator member_to_string(template_param< JsonMember >, OutputIterator it, T const &value)
Definition: to_daw_json_string.h:1340
daw::not_trait< std::is_same< json_deduced_type< T >, missing_json_data_contract_for< T > > > has_json_deduced_type
Definition: daw_json_parse_common.h:969
constexpr char const default_value_name[]
Definition: daw_json_name.h:118
static constexpr json_result< JsonClass > parse_json_tuple_class(template_params< JsonClass, JsonMembers... >, ParseState &parse_state)
Definition: daw_json_parse_class.h:317
std::bool_constant<(JsonMember::name==no_name_sv)> is_no_name
Definition: daw_json_name.h:124
std::bool_constant< daw::is_detected_v< json_type_t, T > > is_a_json_type
Definition: daw_json_traits.h:446
typename daw::detected_or_t< T, ordered_member_subtype_test, T > ordered_member_subtype_t
Definition: daw_json_parse_common.h:51
constexpr DAW_ATTRIB_INLINE json_result< JsonClass > parse_nth_class(std::size_t idx, ParseState &parse_state)
Definition: daw_json_parse_value.h:1264
std::uint32_t json_options_t
Definition: daw_json_option_bits.h:23
typename ensure_mapped< T >::type ensure_mapped_t
Definition: daw_json_link_types_fwd.h:693
daw::is_detected< ordered_member_t, T > is_an_ordered_member
Definition: daw_json_traits.h:460
constexpr serialization_policy< OutputIterator, SerializationOptions > serialize_json_class(serialization_policy< OutputIterator, SerializationOptions > it, Tuple const &args, Value const &value, std::index_sequence< Is... >)
Definition: daw_json_serialize_impl.h:91
constexpr char const default_key_name[]
Definition: daw_json_name.h:117
constexpr serialization_policy< OutputIterator, SerializerOptions > serialize_ordered_json_class(serialization_policy< OutputIterator, SerializerOptions > it, Tuple const &args, Value const &value, std::index_sequence< Is... >)
Definition: daw_json_serialize_impl.h:150
constexpr json_options_t number_opts_set
Definition: daw_json_parse_common.h:298
static constexpr DAW_ATTRIB_FLATINLINE auto construct_value(template_params< Value, Constructor >, ParseState &parse_state, Args &&...args)
Definition: daw_json_parse_common.h:60
typename JsonMember::parse_to_t json_result
Definition: daw_json_parse_common.h:200
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
typename std::conditional_t< is_nullable_json_value_v< Nullable >, unwrapped_impl::unwrapped_t_impl< T >, T > unwrapped_t
Definition: daw_json_traits.h:764
typename json_type_deducer< T, is_an_ordered_member_v< T >, has_json_data_contract_trait_v< T >, json_details::is_a_json_type_v< T >, has_json_link_quick_map_v< T >, is_container_v< T > >::type json_deduced_type
Definition: daw_json_parse_common.h:953
daw::remove_cvref_t< json_class_parse_result_impl< Constructor, Members... > > json_class_parse_result_t
Definition: daw_json_parse_common.h:988
constexpr json_options_t json_custom_opts_set
Definition: daw_json_parse_common.h:314
daw::detected_or_t< Default, json_class_constructor_t_impl, T > json_class_constructor_t
Definition: daw_json_traits.h:516
constexpr bool is_nullability_compatable_v
Definition: daw_json_traits.h:647
constexpr json_details::json_options_t string_opts_def
Definition: daw_json_type_options.h:163
EightBitModes
Definition: daw_json_type_options.h:143
JsonParseTypes
The tags used by the parser to determine what parser to call.
Definition: daw_json_enums.h:22
@ KeyValueArray
Class - Member names form the string key into a key/value,map, or dictionary like type.
@ Array
A class type with named members.
@ Date
String - Fully processed string.
@ Variant
Can be a literal, string, or either and allows for some customized parsing.
@ VariantIntrusive
A variant with up to N types and a Switcher callable that takes uses another member to determine what...
@ SizedArray
An array type with homogenous members.
@ Unknown
Array - An array type where each element is mapped to the member of a C++ class.
@ Custom
Array - Each element has a key and a value submember.
@ Tuple
A variant type where the Switcher is based on a submember of the class being parsed.
@ StringEscaped
String - A raw string as is. Escapes are left in.
@ Bool
Number - Unsigned Integer.
@ VariantTagged
Any one of the basic json types class/array/boolean/number/string.
daw::constant< v > ParseTag
Definition: daw_json_enums.h:119
json_base::json_key_value< Container, JsonValueType, JsonKeyType, Constructor, Nullable > json_key_value_no_name
Definition: daw_json_link_types.h:1555
LiteralAsStringOpt
Definition: daw_json_type_options.h:38
json_base::json_class< T, Constructor, Options > json_class_no_name
Definition: daw_json_link_types.h:874
json_base::json_key_value< Container, JsonValueType, JsonKeyType, Constructor, JsonNullDefault > json_key_value_null_no_name
Definition: daw_json_link_types.h:1563
constexpr json_details::json_options_t json_custom_opts_def
Definition: daw_json_type_options.h:253
constexpr auto bool_opts
Definition: daw_json_type_options.h:120
json_base::json_number< T, json_details::number_opts_set< Options, JsonRangeCheck::CheckForNarrowing, JsonNullDefault >, Constructor > json_checked_number_null_no_name
Definition: daw_json_link_types.h:505
json_base::json_custom< T, FromJsonConverter, ToJsonConverter, Options > json_custom_no_name
Definition: daw_json_link_types.h:1221
JsonCustomTypes
Definition: daw_json_type_options.h:237
typename json_data_contract< T >::type json_data_contract_trait_t
Definition: daw_json_traits.h:135
json_base::json_number< T, json_details::number_opts_set< Options, JsonRangeCheck::CheckForNarrowing >, Constructor > json_checked_number_no_name
Definition: daw_json_link_types.h:488
json_base::json_string_raw< T, json_details::string_raw_opts_set< Options, JsonNullDefault >, Constructor > json_string_raw_null_no_name
Definition: daw_json_link_types.h:665
json_base::json_key_value_array< Container, JsonValueType, JsonKeyType, Constructor, JsonNullDefault > json_key_value_array_null_no_name
Definition: daw_json_link_types.h:1678
json_base::json_bool< T, Options, Constructor > json_bool_no_name
Definition: daw_json_link_types.h:570
json_base::json_custom< T, FromJsonConverter, ToJsonConverter, json_details::json_custom_opts_set< Options, JsonCustomTypes::Literal, JsonNullDefault > > json_custom_lit_null_no_name
Definition: daw_json_link_types.h:1246
json_base::json_number< T, Options, Constructor > json_number_no_name
Definition: daw_json_link_types.h:466
json_base::json_array< JsonElement, Container, Constructor, JsonNullDefault > json_array_null_no_name
Definition: daw_json_link_types.h:1345
constexpr daw::string_view no_name_sv
Definition: daw_json_name.h:114
constexpr auto string_raw_opts
Definition: daw_json_type_options.h:195
json_base::json_date< T, Constructor, JsonNullDefault > json_date_null_no_name
Definition: daw_json_link_types.h:805
constexpr json_details::json_options_t tuple_opts_def
Definition: daw_json_type_options.h:219
JsonNumberErrors
Definition: daw_json_type_options.h:63
json_base::json_array< JsonElement, Container, Constructor, Nullable > json_array_no_name
Definition: daw_json_link_types.h:1339
json_base::json_variant< Variant, JsonElements, Constructor, JsonNullDefault > json_variant_null_no_name
Definition: daw_json_link_types.h:1010
json_base::json_bool< T, json_details::bool_opts_set< Options, JsonNullDefault >, Constructor > json_bool_null_no_name
Definition: daw_json_link_types.h:576
json_details::ensure_mapped_t< json_details::json_deduced_type< T > > json_link_no_name
Deduce the json type mapping based on common types and types already mapped. This version is for when...
Definition: daw_json_link_types.h:2085
json_base::json_tagged_variant< T, TagMember, Switcher, JsonElements, Constructor, JsonNullDefault > json_tagged_variant_null_no_name
Definition: daw_json_link_types.h:1139
JsonNullable
Definition: daw_json_enums.h:90
json_base::json_raw< T, Constructor, Nullable > json_raw_no_name
Definition: daw_json_link_types.h:2048
json_base::json_tuple< Tuple, Constructor, Options, JsonTupleTypesList > json_tuple_no_name
Definition: daw_json_link_types.h:1755
json_base::json_string< T, Options, Constructor > json_string_no_name
Definition: daw_json_link_types.h:737
json_base::json_sized_array< JsonElement, SizeMember, Container, Constructor, Nullable > json_sized_array_no_name
Definition: daw_json_link_types.h:1442
constexpr char const no_name[]
Definition: daw_json_name.h:113
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
json_base::json_intrusive_variant< T, TagMember, Switcher, JsonElements, Constructor, JsonNullDefault > json_intrusive_variant_null_no_name
Definition: daw_json_link_types.h:1901
json_base::json_number< T, json_details::number_opts_set< Options, JsonNullDefault >, Constructor > json_number_null_no_name
Definition: daw_json_link_types.h:472
json_base::json_string< T, json_details::string_opts_set< Options, JsonNullDefault >, Constructor > json_string_null_no_name
Definition: daw_json_link_types.h:743
typename json_details::ensure_mapped_t< json_details::json_deduced_type< T > >::template with_name< Name > json_link
Deduce the json type mapping based on common types and types already mapped.
Definition: daw_json_link_types.h:2077
JsonBaseParseTypes
The fundamental JSON types.
Definition: daw_json_enums.h:53
AllowEscapeCharacter
Definition: daw_json_type_options.h:175
json_base::json_key_value_array< Container, JsonValueType, JsonKeyType, Constructor, Nullable > json_key_value_array_no_name
Definition: daw_json_link_types.h:1670
json_base::json_class< T, Constructor, json_details::class_opts_set< Options, JsonNullDefault > > json_class_null_no_name
Definition: daw_json_link_types.h:879
std::bool_constant< std::disjunction_v< daw::is_detected< json_details::force_aggregate_construction_test, T >, daw::is_detected< json_details::force_aggregate_construction_test2, T > > > force_aggregate_construction
Definition: daw_json_traits.h:176
EmptyStringNull
Definition: daw_json_type_options.h:132
constexpr auto tuple_opts
Definition: daw_json_type_options.h:218
JsonRangeCheck
Definition: daw_json_type_options.h:52
constexpr json_details::json_options_t string_raw_opts_def
Definition: daw_json_type_options.h:196
json_base::json_raw< T, Constructor, JsonNullDefault > json_raw_null_no_name
Definition: daw_json_link_types.h:2064
json_base::json_tuple< Tuple, Constructor, json_details::tuple_opts_set< Options, JsonNullDefault >, JsonTupleTypesList > json_tuple_null_no_name
Definition: daw_json_link_types.h:1763
constexpr JsonNullable JsonNullDefault
Definition: daw_json_enums.h:96
json_base::json_intrusive_variant< T, TagMember, Switcher, JsonElements, Constructor, Nullable > json_intrusive_variant_no_name
Definition: daw_json_link_types.h:1893
json_base::json_custom< T, FromJsonConverter, ToJsonConverter, json_details::json_custom_opts_set< Options, JsonNullDefault > > json_custom_null_no_name
Definition: daw_json_link_types.h:1237
constexpr auto json_custom_opts
Definition: daw_json_type_options.h:252
json_base::json_variant< Variant, JsonElements, Constructor, JsonNullable::MustExist > json_variant_no_name
Definition: daw_json_link_types.h:1004
json_base::json_tagged_variant< T, TagMember, Switcher, JsonElements, Constructor, Nullable > json_tagged_variant_no_name
Definition: daw_json_link_types.h:1132
json_base::json_date< T, Constructor, Nullable > json_date_no_name
Definition: daw_json_link_types.h:801
basic_json_value< NoCommentSkippingPolicyChecked > json_value
Definition: daw_json_link_types.h:1906
constexpr auto class_opts
Definition: daw_json_type_options.h:207
constexpr auto string_opts
Definition: daw_json_type_options.h:162
json_base::json_sized_array< JsonElement, SizeMember, Container, Constructor, JsonNullDefault > json_sized_array_null_no_name
Definition: daw_json_link_types.h:1449
FPOutputFormat
Definition: daw_json_type_options.h:83
constexpr json_details::json_options_t number_opts_def
Definition: daw_json_type_options.h:108
constexpr auto number_opts
Definition: daw_json_type_options.h:107
json_base::json_string_raw< T, Options, Constructor > json_string_raw_no_name
Definition: daw_json_link_types.h:658
json_base::json_custom< T, FromJsonConverter, ToJsonConverter, json_details::json_custom_opts_set< Options, JsonCustomTypes::Literal > > json_custom_lit_no_name
Definition: daw_json_link_types.h:1229
Definition: daw_from_json.h:22
Definition: daw_json_value.h:42
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
static constexpr daw::string_view name
Definition: daw_json_link_types.h:1321
Definition: daw_json_link_types.h:1251
static constexpr JsonParseTypes expected_type
Definition: daw_json_link_types.h:1287
static constexpr JsonNullable nullable
Definition: daw_json_link_types.h:1268
static constexpr daw::string_view name
Definition: daw_json_link_types.h:1285
void i_am_a_json_type
Definition: daw_json_link_types.h:1252
std::conditional_t< std::is_same_v< Constructor, json_deduce_type >, std::conditional_t< nullable==JsonNullable::MustExist, default_constructor< container_t >, nullable_constructor< container_t > >, Constructor > constructor_t
Definition: daw_json_link_types.h:1274
static constexpr JsonBaseParseTypes underlying_json_type
Definition: daw_json_link_types.h:1295
typename json_details::construction_result< nullable !=JsonNullable::MustExist, constructor_t, json_element_parse_to_t const *, json_element_parse_to_t const * >::type parse_to_t
Definition: daw_json_link_types.h:1283
typename json_element_t::parse_to_t json_element_parse_to_t
Definition: daw_json_link_types.h:1259
std::conditional_t< std::is_same_v< Container, json_deduce_type >, std::vector< json_element_parse_to_t >, Container > container_t
Definition: daw_json_link_types.h:1267
static constexpr JsonParseTypes base_expected_type
Definition: daw_json_link_types.h:1290
json_details::unwrapped_t< container_t, nullable > base_type
Definition: daw_json_link_types.h:1276
json_details::json_deduced_type< JsonElement > json_element_t
Definition: daw_json_link_types.h:1258
static constexpr bool must_be_class_member
Definition: daw_json_link_types.h:1253
Definition: daw_json_link_types.h:510
static constexpr JsonParseTypes expected_type
Definition: daw_json_link_types.h:526
static constexpr daw::string_view name
Definition: daw_json_link_types.h:512
static constexpr bool must_be_class_member
Definition: daw_json_link_types.h:515
static constexpr JsonBaseParseTypes underlying_json_type
Definition: daw_json_link_types.h:534
Constructor constructor_t
Definition: daw_json_link_types.h:524
static constexpr LiteralAsStringOpt literal_as_string
Definition: daw_json_link_types.h:531
void i_am_a_json_type
Definition: daw_json_link_types.h:511
static constexpr JsonNullable nullable
Definition: daw_json_link_types.h:513
json_details::unwrapped_t< T, nullable > base_type
Definition: daw_json_link_types.h:517
typename json_details::construction_result< nullable !=JsonNullable::MustExist, Constructor, base_type >::type parse_to_t
Definition: daw_json_link_types.h:522
static constexpr JsonParseTypes base_expected_type
Definition: daw_json_link_types.h:528
T wrapped_type
Definition: daw_json_link_types.h:516
Definition: daw_json_link_types.h:810
json_details::json_class_constructor_t< base_type, Constructor > constructor_t
Definition: daw_json_link_types.h:819
static constexpr JsonParseTypes expected_type
Definition: daw_json_link_types.h:833
json_data_contract_trait_t< base_type > json_member_list
Definition: daw_json_link_types.h:821
json_details::unwrapped_t< T, nullable > base_type
Definition: daw_json_link_types.h:817
static constexpr JsonBaseParseTypes underlying_json_type
Definition: daw_json_link_types.h:837
T wrapped_type
Definition: daw_json_link_types.h:813
typename std::conditional_t< force_aggregate_construction< base_type >::value, daw::traits::identity< base_type >, daw::traits::identity< typename data_contract::template result_type< constructor_t > > >::type parse_to_t
Definition: daw_json_link_types.h:831
json_data_contract_trait_t< base_type > data_contract
Definition: daw_json_link_types.h:825
static constexpr daw::string_view name
Definition: daw_json_link_types.h:812
static constexpr bool must_be_class_member
Definition: daw_json_link_types.h:814
void i_am_a_json_type
Definition: daw_json_link_types.h:811
static constexpr JsonParseTypes base_expected_type
Definition: daw_json_link_types.h:835
static constexpr JsonNullable nullable
Definition: daw_json_link_types.h:815
Definition: daw_json_link_types.h:1144
static constexpr JsonNullable nullable
Definition: daw_json_link_types.h:1151
static constexpr daw::string_view name
Definition: daw_json_link_types.h:1167
static constexpr JsonParseTypes expected_type
Definition: daw_json_link_types.h:1168
FromJsonConverter from_converter_t
Definition: daw_json_link_types.h:1147
static constexpr bool must_be_class_member
Definition: daw_json_link_types.h:1149
static constexpr JsonCustomTypes custom_json_type
Definition: daw_json_link_types.h:1173
typename json_details::construction_result< nullable !=JsonNullable::MustExist, FromJsonConverter, std::string_view >::type parse_to_t
Definition: daw_json_link_types.h:1160
ToJsonConverter to_converter_t
Definition: daw_json_link_types.h:1146
FromJsonConverter constructor_t
Definition: daw_json_link_types.h:1148
void i_am_a_json_type
Definition: daw_json_link_types.h:1145
static constexpr JsonBaseParseTypes underlying_json_type
Definition: daw_json_link_types.h:1177
static constexpr JsonParseTypes base_expected_type
Definition: daw_json_link_types.h:1170
json_details::unwrapped_t< T, nullable > base_type
Definition: daw_json_link_types.h:1154
Definition: daw_json_link_types.h:747
static constexpr bool must_be_class_member
Definition: daw_json_link_types.h:751
json_details::unwrapped_t< T, Nullable > base_type
Definition: daw_json_link_types.h:752
typename json_details::construction_result< Nullable !=JsonNullable::MustExist, Constructor, char const *, std::size_t >::type parse_to_t
Definition: daw_json_link_types.h:758
static constexpr daw::string_view name
Definition: daw_json_link_types.h:760
static constexpr JsonNullable nullable
Definition: daw_json_link_types.h:767
void i_am_a_json_type
Definition: daw_json_link_types.h:748
Constructor constructor_t
Definition: daw_json_link_types.h:749
T wrapped_type
Definition: daw_json_link_types.h:750
static constexpr JsonParseTypes base_expected_type
Definition: daw_json_link_types.h:763
static constexpr JsonBaseParseTypes underlying_json_type
Definition: daw_json_link_types.h:765
static constexpr JsonParseTypes expected_type
Definition: daw_json_link_types.h:761
Variant wrapped_type
Definition: daw_json_link_types.h:1786
static constexpr daw::string_view name
Definition: daw_json_link_types.h:1818
static constexpr JsonParseTypes expected_type
Definition: daw_json_link_types.h:1819
void i_am_a_tagged_variant
Definition: daw_json_link_types.h:1771
std::conditional_t< std::disjunction_v< json_details::is_an_ordered_member< json_details::json_deduced_type< tag_submember > >, json_details::is_no_name< json_details::json_deduced_type< tag_submember > > >, json_tuple< std::tuple< typename json_details::json_deduced_type< tag_submember >::parse_to_t >, default_constructor< std::tuple< typename json_details::json_deduced_type< tag_submember >::parse_to_t > >, tuple_opts_def, json_tuple_types_list< tag_submember > >, tuple_json_mapping< tag_submember > > json_container_type
Definition: daw_json_link_types.h:1837
static constexpr JsonBaseParseTypes underlying_json_type
Definition: daw_json_link_types.h:1823
static constexpr JsonNullable nullable
Definition: daw_json_link_types.h:1772
void i_am_a_json_type
Definition: daw_json_link_types.h:1770
json_details::json_class_constructor_t< Variant, Constructor > constructor_t
Definition: daw_json_link_types.h:1814
json_details::unwrapped_t< Variant, nullable > base_type
Definition: daw_json_link_types.h:1812
typename std::conditional_t< std::is_same_v< AlternativeMappings, json_deduce_type >, json_details::determine_variant_element_types< nullable, Variant >, daw::traits::identity< AlternativeMappings > >::type json_elements
Definition: daw_json_link_types.h:1778
Switcher switcher
Definition: daw_json_link_types.h:1803
Variant parse_to_t
Definition: daw_json_link_types.h:1817
std::conditional_t< json_details::is_an_ordered_member< tag_submember >::value, json_tuple< std::tuple< typename tag_submember::parse_to_t >, json_deduce_type, tuple_opts_def, json_tuple_types_list< tag_submember > >, json_details::json_deduced_type< tuple_json_mapping< tag_submember > > > tag_submember_class_wrapper
Definition: daw_json_link_types.h:1810
typename std::conditional_t< json_details::is_an_ordered_member< TagMember >::value, daw::traits::identity< TagMember >, daw::traits::identity< json_details::json_deduced_type< TagMember > > >::type tag_submember
Definition: daw_json_link_types.h:1792
static constexpr bool must_be_class_member
Definition: daw_json_link_types.h:1773
static constexpr JsonParseTypes base_expected_type
Definition: daw_json_link_types.h:1821
Definition: daw_json_link_types.h:1568
static constexpr JsonNullable nullable
Definition: daw_json_link_types.h:1615
static constexpr JsonParseTypes base_expected_type
Definition: daw_json_link_types.h:1611
static constexpr JsonBaseParseTypes underlying_json_type
Definition: daw_json_link_types.h:1613
static constexpr bool must_be_class_member
Definition: daw_json_link_types.h:1570
json_details::copy_name_when_noname< json_details::json_deduced_type< JsonKeyType >, json_details::default_key_name > json_key_t
Definition: daw_json_link_types.h:1582
json_details::copy_name_when_noname< json_details::json_deduced_type< JsonValueType >, json_details::default_value_name > json_value_t
Definition: daw_json_link_types.h:1591
static constexpr JsonParseTypes expected_type
Definition: daw_json_link_types.h:1609
json_details::json_class_constructor_t< base_type, Constructor > constructor_t
Definition: daw_json_link_types.h:1573
json_details::unwrapped_t< Container, Nullable > base_type
Definition: daw_json_link_types.h:1571
typename json_details::construction_result< Nullable !=JsonNullable::MustExist, Constructor, base_type >::type parse_to_t
Definition: daw_json_link_types.h:1578
void i_am_a_json_type
Definition: daw_json_link_types.h:1569
static constexpr daw::string_view name
Definition: daw_json_link_types.h:1608
Definition: daw_json_link_types.h:1454
static constexpr JsonParseTypes expected_type
Definition: daw_json_link_types.h:1497
json_details::json_class_constructor_t< base_type, Constructor > constructor_t
Definition: daw_json_link_types.h:1459
void i_am_a_json_type
Definition: daw_json_link_types.h:1455
json_details::json_deduced_type< JsonValueType > json_element_t
Definition: daw_json_link_types.h:1469
static constexpr bool must_be_class_member
Definition: daw_json_link_types.h:1456
static constexpr daw::string_view name
Definition: daw_json_link_types.h:1496
json_details::json_deduced_type< JsonKeyType > json_key_t
Definition: daw_json_link_types.h:1480
static constexpr JsonParseTypes base_expected_type
Definition: daw_json_link_types.h:1499
Container parse_to_t
Definition: daw_json_link_types.h:1488
static constexpr JsonNullable nullable
Definition: daw_json_link_types.h:1503
json_details::unwrapped_t< Container, Nullable > base_type
Definition: daw_json_link_types.h:1457
static constexpr JsonBaseParseTypes underlying_json_type
Definition: daw_json_link_types.h:1501
Definition: daw_json_link_types.h:377
T wrapped_type
Definition: daw_json_link_types.h:379
Constructor constructor_t
Definition: daw_json_link_types.h:400
static constexpr JsonParseTypes expected_type
Definition: daw_json_link_types.h:402
typename json_details::construction_result< nullable !=JsonNullable::MustExist, Constructor, base_type >::type parse_to_t
Definition: daw_json_link_types.h:393
static constexpr LiteralAsStringOpt literal_as_string
Definition: daw_json_link_types.h:409
static constexpr JsonParseTypes base_expected_type
Definition: daw_json_link_types.h:406
static constexpr JsonRangeCheck range_check
Definition: daw_json_link_types.h:413
static constexpr JsonBaseParseTypes underlying_json_type
Definition: daw_json_link_types.h:427
static constexpr daw::string_view name
Definition: daw_json_link_types.h:380
static constexpr JsonNullable nullable
Definition: daw_json_link_types.h:383
static constexpr FPOutputFormat fp_output_format
Definition: daw_json_link_types.h:416
void i_am_a_json_type
Definition: daw_json_link_types.h:378
static constexpr bool must_be_class_member
Definition: daw_json_link_types.h:381
static constexpr JsonNumberErrors allow_number_errors
Definition: daw_json_link_types.h:419
json_details::unwrapped_t< T, nullable > base_type
Definition: daw_json_link_types.h:385
Definition: daw_json_link_types.h:1944
static constexpr daw::string_view name
Definition: daw_json_link_types.h:1958
Constructor constructor_t
Definition: daw_json_link_types.h:1948
json_details::unwrapped_t< T, nullable > base_type
Definition: daw_json_link_types.h:1950
static constexpr JsonNullable nullable
Definition: daw_json_link_types.h:1949
static constexpr JsonParseTypes expected_type
Definition: daw_json_link_types.h:1960
static constexpr JsonParseTypes base_expected_type
Definition: daw_json_link_types.h:1962
typename json_details::construction_result< nullable !=JsonNullable::MustExist, Constructor, char const *, char const * >::type parse_to_t
Definition: daw_json_link_types.h:1956
static constexpr JsonBaseParseTypes underlying_json_type
Definition: daw_json_link_types.h:1965
static constexpr bool must_be_class_member
Definition: daw_json_link_types.h:1946
void i_am_a_json_type
Definition: daw_json_link_types.h:1945
Definition: daw_json_link_types.h:1350
static constexpr daw::string_view name
Definition: daw_json_link_types.h:1393
static constexpr bool must_be_class_member
Definition: daw_json_link_types.h:1352
static constexpr JsonNullable nullable
Definition: daw_json_link_types.h:1353
typename json_element_t::parse_to_t json_element_parse_to_t
Definition: daw_json_link_types.h:1364
static constexpr JsonBaseParseTypes underlying_json_type
Definition: daw_json_link_types.h:1403
static constexpr JsonParseTypes expected_type
Definition: daw_json_link_types.h:1395
SizeMember dependent_member
Definition: daw_json_link_types.h:1382
json_details::unwrapped_t< Container, nullable > base_type
Definition: daw_json_link_types.h:1384
typename json_details::construction_result< nullable !=JsonNullable::MustExist, constructor_t, json_element_parse_to_t const *, json_element_parse_to_t const *, std::size_t >::type parse_to_t
Definition: daw_json_link_types.h:1391
void i_am_a_json_type
Definition: daw_json_link_types.h:1351
std::conditional_t< std::is_same_v< Constructor, json_deduce_type >, std::conditional_t< nullable==JsonNullable::MustExist, default_constructor< container_t >, nullable_constructor< container_t > >, Constructor > constructor_t
Definition: daw_json_link_types.h:1374
std::conditional_t< std::is_same_v< Container, json_deduce_type >, std::vector< json_element_parse_to_t >, Container > container_t
Definition: daw_json_link_types.h:1368
json_details::json_deduced_type< JsonElement > json_element_t
Definition: daw_json_link_types.h:1358
static constexpr JsonParseTypes base_expected_type
Definition: daw_json_link_types.h:1398
String - A raw string as is. Escapes are left in.
Definition: daw_json_link_types.h:582
static constexpr JsonParseTypes base_expected_type
Definition: daw_json_link_types.h:599
static constexpr daw::string_view name
Definition: daw_json_link_types.h:596
static constexpr AllowEscapeCharacter allow_escape_character
Definition: daw_json_link_types.h:610
static constexpr JsonNullable nullable
Definition: daw_json_link_types.h:584
static constexpr JsonBaseParseTypes underlying_json_type
Definition: daw_json_link_types.h:601
typename json_details::construction_result< nullable !=JsonNullable::MustExist, Constructor, base_type >::type parse_to_t
Definition: daw_json_link_types.h:594
static constexpr bool must_be_class_member
Definition: daw_json_link_types.h:586
static constexpr JsonParseTypes expected_type
Definition: daw_json_link_types.h:597
static constexpr EightBitModes eight_bit_mode
Definition: daw_json_link_types.h:607
json_details::unwrapped_t< String, nullable > base_type
Definition: daw_json_link_types.h:589
Constructor constructor_t
Definition: daw_json_link_types.h:587
String wrapped_type
Definition: daw_json_link_types.h:588
void i_am_a_json_type
Definition: daw_json_link_types.h:583
static constexpr EmptyStringNull empty_is_null
Definition: daw_json_link_types.h:604
Definition: daw_json_link_types.h:670
static constexpr daw::string_view name
Definition: daw_json_link_types.h:685
static constexpr JsonParseTypes base_expected_type
Definition: daw_json_link_types.h:688
String wrapped_type
Definition: daw_json_link_types.h:676
json_details::unwrapped_t< String, nullable > base_type
Definition: daw_json_link_types.h:677
static constexpr EightBitModes eight_bit_mode
Definition: daw_json_link_types.h:692
void i_am_a_json_type
Definition: daw_json_link_types.h:671
static constexpr JsonBaseParseTypes underlying_json_type
Definition: daw_json_link_types.h:695
static constexpr JsonParseTypes expected_type
Definition: daw_json_link_types.h:686
static constexpr JsonNullable nullable
Definition: daw_json_link_types.h:672
static constexpr EmptyStringNull empty_is_null
Definition: daw_json_link_types.h:690
typename json_details::construction_result< nullable !=JsonNullable::MustExist, Constructor, char const *, char const * >::type parse_to_t
Definition: daw_json_link_types.h:683
static constexpr bool must_be_class_member
Definition: daw_json_link_types.h:674
Constructor constructor_t
Definition: daw_json_link_types.h:675
Definition: daw_json_link_types.h:1016
std::conditional_t< json_details::is_an_ordered_member_v< tag_member >, json_tuple< std::tuple< typename tag_member::parse_to_t >, json_deduce_type, tuple_opts_def, json_tuple_types_list< tag_member > >, json_details::json_deduced_type< tuple_json_mapping< tag_member > > > tag_member_class_wrapper
Definition: daw_json_link_types.h:1062
T wrapped_type
Definition: daw_json_link_types.h:1032
Switcher switcher
Definition: daw_json_link_types.h:1064
void i_am_a_tagged_variant
Definition: daw_json_link_types.h:1018
static constexpr JsonNullable nullable
Definition: daw_json_link_types.h:1019
static constexpr bool must_be_class_member
Definition: daw_json_link_types.h:1020
void i_am_a_json_type
Definition: daw_json_link_types.h:1017
static constexpr JsonBaseParseTypes underlying_json_type
Definition: daw_json_link_types.h:1076
static constexpr JsonParseTypes base_expected_type
Definition: daw_json_link_types.h:1074
static constexpr daw::string_view name
Definition: daw_json_link_types.h:1071
T parse_to_t
Definition: daw_json_link_types.h:1070
typename std::conditional_t< json_details::is_a_json_type< TagMember >::value, daw::traits::identity< TagMember >, daw::traits::identity< json_details::json_deduced_type< TagMember > > >::type tag_member
Definition: daw_json_link_types.h:1055
static constexpr JsonParseTypes expected_type
Definition: daw_json_link_types.h:1072
json_details::unwrapped_t< T, nullable > base_type
Definition: daw_json_link_types.h:1065
typename std::conditional_t< std::is_same< JsonElements, json_deduce_type >::value, json_details::determine_variant_element_types< nullable, T >, daw::traits::identity< JsonElements > >::type json_elements
Definition: daw_json_link_types.h:1025
json_details::json_class_constructor_t< T, Constructor > constructor_t
Definition: daw_json_link_types.h:1067
TagMember dependent_member
Definition: daw_json_link_types.h:1040
Definition: daw_json_link_types.h:1684
static constexpr JsonParseTypes expected_type
Definition: daw_json_link_types.h:1718
static constexpr JsonParseTypes base_expected_type
Definition: daw_json_link_types.h:1720
Tuple wrapped_type
Definition: daw_json_link_types.h:1688
static constexpr JsonNullable nullable
Definition: daw_json_link_types.h:1692
static constexpr bool must_be_class_member
Definition: daw_json_link_types.h:1689
static constexpr daw::string_view name
Definition: daw_json_link_types.h:1686
static constexpr JsonBaseParseTypes underlying_json_type
Definition: daw_json_link_types.h:1722
json_details::unwrapped_t< Tuple, nullable > base_type
Definition: daw_json_link_types.h:1695
typename json_details::construction_result< nullable !=JsonNullable::MustExist, constructor_t, base_type >::type parse_to_t
Definition: daw_json_link_types.h:1716
std::conditional_t< std::is_same< Constructor, json_deduce_type >::value, std::conditional_t< nullable==JsonNullable::MustExist, json_details::json_class_constructor_t< base_type, default_constructor< Tuple > >, json_details::json_class_constructor_t< base_type, nullable_constructor< Tuple > > >, json_details::json_class_constructor_t< base_type, Constructor > > constructor_t
Definition: daw_json_link_types.h:1710
void i_am_a_json_type
Definition: daw_json_link_types.h:1685
typename std::conditional_t< std::is_same< JsonTupleTypesList, json_deduce_type >::value, daw::traits::identity< json_details::tuple_types_list< Tuple > >, daw::traits::identity< json_details::tuple_types_list< JsonTupleTypesList > > >::type::types sub_member_list
Definition: daw_json_link_types.h:1701
Definition: daw_json_link_types.h:932
static constexpr JsonParseTypes base_expected_type
Definition: daw_json_link_types.h:957
static constexpr bool must_be_class_member
Definition: daw_json_link_types.h:934
void i_am_a_json_type
Definition: daw_json_link_types.h:933
static constexpr JsonNullable nullable
Definition: daw_json_link_types.h:935
Variant parse_to_t
Definition: daw_json_link_types.h:953
static constexpr JsonBaseParseTypes underlying_json_type
Definition: daw_json_link_types.h:960
static constexpr JsonParseTypes expected_type
Definition: daw_json_link_types.h:955
json_details::unwrapped_t< Variant, nullable > base_type
Definition: daw_json_link_types.h:948
typename std::conditional_t< std::is_same< JsonElements, json_deduce_type >::value, json_details::determine_variant_element_types< nullable, Variant >, daw::traits::identity< JsonElements > >::type json_elements
Definition: daw_json_link_types.h:940
static constexpr daw::string_view name
Definition: daw_json_link_types.h:954
Variant wrapped_type
Definition: daw_json_link_types.h:947
json_details::json_class_constructor_t< Variant, Constructor > constructor_t
Definition: daw_json_link_types.h:950
Definition: daw_json_link_types.h:553
static constexpr daw::string_view name
Definition: daw_json_link_types.h:555
Definition: daw_json_link_types.h:108
void i_am_a_json_member_list
Definition: daw_json_link_types.h:109
static constexpr DAW_ATTRIB_FLATTEN json_details::json_result< JsonClass > parse_to_class(ParseState &parse_state, template_param< JsonClass >)
Definition: daw_json_link_types.h:136
json_details::json_class_parse_result_t< Constructor, json_member > result_type
Definition: daw_json_link_types.h:130
json_details::json_deduced_type< JsonMember > json_member
Definition: daw_json_link_types.h:111
void i_am_a_json_map_alias
Definition: daw_json_link_types.h:110
static constexpr OutputIterator serialize(OutputIterator it, Member const &m, Value const &)
Definition: daw_json_link_types.h:123
Definition: daw_json_link_types.h:858
static constexpr daw::string_view name
Definition: daw_json_link_types.h:860
Definition: daw_json_link_types.h:1199
static constexpr daw::string_view name
Definition: daw_json_link_types.h:1201
static auto const & to_json_data(tuple_json_mapping< Members... > const &value)
Definition: daw_json_link_types.h:175
Definition: daw_json_traits.h:127
Definition: daw_json_link_types.h:785
static constexpr daw::string_view name
Definition: daw_json_link_types.h:786
Definition: daw_json_parse_common.h:856
Definition: daw_json_link_types_fwd.h:514
Definition: daw_json_link_types.h:1866
static constexpr daw::string_view name
Definition: daw_json_link_types.h:1868
Definition: daw_json_link_types.h:1644
static constexpr daw::string_view name
Definition: daw_json_link_types.h:1646
Definition: daw_json_link_types.h:1531
static constexpr daw::string_view name
Definition: daw_json_link_types.h:1533
Definition: daw_json_link_types.h:33
static constexpr DAW_ATTRIB_FLATTEN json_details::json_result< JsonClass > parse_to_class(ParseState &parse_state, template_param< JsonClass >)
Definition: daw_json_link_types.h:88
json_details::json_class_parse_result_t< Constructor, JsonMembers... > result_type
Definition: daw_json_link_types.h:74
static constexpr OutputIterator serialize(OutputIterator it, Tuple< Ts... > const &args, Value const &v)
Definition: daw_json_link_types.h:57
daw::fwd_pack< JsonMembers... > i_am_a_json_member_list
Definition: daw_json_link_types.h:34
Definition: daw_json_link_types.h:449
static constexpr daw::string_view name
Definition: daw_json_link_types.h:451
Definition: daw_json_link_types.h:1990
static constexpr daw::string_view name
Definition: daw_json_link_types.h:1991
Definition: daw_json_link_types.h:1418
static constexpr daw::string_view name
Definition: daw_json_link_types.h:1420
Definition: daw_json_link_types.h:638
static constexpr daw::string_view name
Definition: daw_json_link_types.h:641
Definition: daw_json_link_types.h:720
static constexpr daw::string_view name
Definition: daw_json_link_types.h:721
Definition: daw_json_link_types.h:303
void i_am_a_submember_tagged_variant
Definition: daw_json_link_types.h:305
json_details::json_class_parse_result_t< Constructor, json_details::json_deduced_type< daw::traits::first_type< JsonClasses... > > > result_type
Definition: daw_json_link_types.h:334
void i_am_a_json_member_list
Definition: daw_json_link_types.h:304
static constexpr OutputIterator serialize(OutputIterator it, Value const &v)
Definition: daw_json_link_types.h:315
static constexpr DAW_ATTRIB_FLATTEN json_details::from_json_result_t< JsonClass > parse_to_class(ParseState &parse_state, template_param< JsonClass >)
Definition: daw_json_link_types.h:348
Definition: daw_json_link_types.h:1106
static constexpr daw::string_view name
Definition: daw_json_link_types.h:1108
Definition: daw_json_link_types.h:224
json_details::json_class_parse_result_t< Constructor, json_details::ordered_member_subtype_t< json_details::json_deduced_type< JsonMembers > >... > result_type
Definition: daw_json_link_types.h:260
static constexpr json_details::json_result< JsonClass > parse_to_class(ParseState &parse_state, template_param< JsonClass >)
Definition: daw_json_link_types.h:273
void i_am_a_json_tuple_member_list
Definition: daw_json_link_types.h:226
static constexpr OutputIterator serialize(OutputIterator it, Tuple< Ts... > const &args, Value const &v)
Definition: daw_json_link_types.h:239
daw::fwd_pack< JsonMembers... > i_am_a_json_member_list
Definition: daw_json_link_types.h:225
Definition: daw_json_link_types.h:187
static constexpr std::size_t member_index
Definition: daw_json_link_types.h:191
static constexpr JSONNAMETYPE name
Definition: daw_json_link_types.h:190
json_details::json_deduced_type< JsonMember > json_member
Definition: daw_json_link_types.h:196
void i_am_a_json_type
Definition: daw_json_link_types.h:189
typename json_member::parse_to_t parse_to_t
Definition: daw_json_link_types.h:197
void i_am_an_ordered_member
Definition: daw_json_link_types.h:188
Definition: daw_json_link_types_fwd.h:656
Map a tuple like type to a a JSON tuple/heterogeneous array.
Definition: daw_json_link_types.h:1735
static constexpr daw::string_view name
Definition: daw_json_link_types.h:1736
Definition: daw_json_link_types_fwd.h:316
Definition: daw_json_link_types.h:984
static constexpr daw::string_view name
Definition: daw_json_link_types.h:985
Definition: daw_json_traits.h:351
Definition: daw_json_link_types.h:162
std::tuple< typename Members::parse_to_t... > members
Definition: daw_json_link_types.h:163
constexpr tuple_json_mapping(Ts &&...values)
Definition: daw_json_link_types.h:166
#define DAW_JSON_VER
The version string used in namespace definitions. Must be a valid namespace name.
Definition: version.h:16