28#ifndef TOML_DISABLE_ENVIRONMENT_CHECKS
29#define TOML_ENV_MESSAGE \
30 "If you're seeing this error it's because you're building toml++ for an environment that doesn't conform to " \
31 "one of the 'ground truths' assumed by the library. Essentially this just means that I don't have the " \
32 "resources to test on more platforms, but I wish I did! You can try disabling the checks by defining " \
33 "TOML_DISABLE_ENVIRONMENT_CHECKS, but your mileage may vary. Please consider filing an issue at " \
34 "https://github.com/marzer/tomlplusplus/issues to help me improve support for your target environment. " \
37static_assert(CHAR_BIT == 8, TOML_ENV_MESSAGE);
39static_assert(FLT_RADIX == 2, TOML_ENV_MESSAGE);
41static_assert(
'A' == 65, TOML_ENV_MESSAGE);
42static_assert(
sizeof(double) == 8, TOML_ENV_MESSAGE);
43static_assert(std::numeric_limits<double>::is_iec559, TOML_ENV_MESSAGE);
44static_assert(std::numeric_limits<double>::digits == 53, TOML_ENV_MESSAGE);
45static_assert(std::numeric_limits<double>::digits10 == 15, TOML_ENV_MESSAGE);
46static_assert(std::numeric_limits<double>::radix == 2, TOML_ENV_MESSAGE);
48#undef TOML_ENV_MESSAGE
62 using ::std::intptr_t;
63 using ::std::uintptr_t;
64 using ::std::ptrdiff_t;
65 using ::std::nullptr_t;
71 using ::std::uint16_t;
72 using ::std::uint32_t;
73 using ::std::uint64_t;
74 using ::std::uint_least32_t;
75 using ::std::uint_least64_t;
103 class toml_formatter;
104 class json_formatter;
105 class yaml_formatter;
119 using node_ptr = std::unique_ptr<node>;
127 inline constexpr std::string_view control_char_escapes[] =
163 inline constexpr std::string_view node_type_friendly_names[] =
181#if TOML_ABI_NAMESPACES
183#define TOML_PARSER_TYPENAME TOML_NAMESPACE::impl::impl_ex::parser
185#define TOML_PARSER_TYPENAME TOML_NAMESPACE::impl::impl_noex::parser
188#define TOML_PARSER_TYPENAME TOML_NAMESPACE::impl::parser
255 template <
typename Char>
256 inline std::basic_ostream<Char>&
operator<<(std::basic_ostream<Char>& lhs, node_type rhs)
258 const auto str = impl::node_type_friendly_names[
static_cast<std::underlying_type_t<node_type>
>(rhs)];
259 using str_char_t =
decltype(str)::value_type;
260 if constexpr (std::is_same_v<Char, str_char_t>)
264 if constexpr (
sizeof(Char) ==
sizeof(str_char_t))
265 return lhs << std::basic_string_view<Char>{
reinterpret_cast<const Char*
>(str.data()), str.length() };
267 return lhs << str.data();
364 template <
typename T>
367 static_assert(std::is_reference_v<T>);
371 template <
typename T>
373 template <
typename T>
388 template <
typename T>
389 using remove_cvref = std::remove_cv_t<std::remove_reference_t<T>>;
391 template <
typename... T>
392 using common_signed_type = std::common_type_t<std::make_signed_t<T>...>;
394 template <
typename T,
typename... U>
395 inline constexpr bool is_one_of = (
false || ... || std::is_same_v<T, U>);
397 template <
typename... T>
398 inline constexpr bool all_integral = (std::is_integral_v<T> && ...);
400 template <
typename T>
401 inline constexpr bool is_cvref = std::is_reference_v<T> || std::is_const_v<T> || std::is_volatile_v<T>;
403 template <
typename T>
404 inline constexpr bool is_wide_string =
405 is_one_of<std::decay_t<T>,
const wchar_t*,
wchar_t*, std::wstring_view, std::wstring>;
407 template <
typename T>
408 inline constexpr bool value_retrieval_is_nothrow = !std::is_same_v<remove_cvref<T>, std::string>
410 && !std::is_same_v<remove_cvref<T>, std::u8string>
413 && !is_wide_string<T>;
415 template <
typename,
typename>
417 template <
typename Dest,
typename Src>
418 using copy_ref =
typename copy_ref_<Dest, Src>::type;
420 template <
typename Dest,
typename Src>
426 template <
typename Dest,
typename Src>
427 struct copy_ref_<Dest, Src&>
429 using type = std::add_lvalue_reference_t<Dest>;
432 template <
typename Dest,
typename Src>
433 struct copy_ref_<Dest, Src&&>
435 using type = std::add_rvalue_reference_t<Dest>;
438 template <
typename,
typename>
440 template <
typename Dest,
typename Src>
441 using copy_cv =
typename copy_cv_<Dest, Src>::type;
443 template <
typename Dest,
typename Src>
449 template <
typename Dest,
typename Src>
450 struct copy_cv_<Dest, const Src>
452 using type = std::add_const_t<Dest>;
455 template <
typename Dest,
typename Src>
456 struct copy_cv_<Dest, volatile Src>
458 using type = std::add_volatile_t<Dest>;
461 template <
typename Dest,
typename Src>
462 struct copy_cv_<Dest, const volatile Src>
464 using type = std::add_cv_t<Dest>;
467 template <
typename Dest,
typename Src>
469 copy_ref<copy_ref<copy_cv<std::remove_reference_t<Dest>, std::remove_reference_t<Src>>, Dest>, Src>;
471 template <
typename...>
472 inline constexpr bool always_false =
false;
474 template <
typename T,
typename... U>
475 inline constexpr bool first_is_same =
false;
476 template <
typename T,
typename... U>
477 inline constexpr bool first_is_same<T, T, U...> =
true;
479 template <
typename T,
bool = std::is_enum_v<T>>
480 struct underlying_type_
482 using type = std::underlying_type_t<T>;
484 template <
typename T>
485 struct underlying_type_<T, false>
489 template <
typename T>
490 using underlying_type =
typename underlying_type_<T>::type;
494 struct default_value_traits
496 using native_type = void;
497 static constexpr bool is_native =
false;
498 static constexpr bool is_losslessly_convertible_to_native =
false;
499 static constexpr bool can_represent_native =
false;
500 static constexpr bool can_partially_represent_native =
false;
501 static constexpr auto type = node_type::none;
504 template <
typename T>
507 template <
typename T,
bool = std::is_enum_v<T>>
508 struct value_traits_base_selector
510 static_assert(!is_cvref<T>);
512 using type = default_value_traits;
514 template <
typename T>
515 struct value_traits_base_selector<T, true>
517 static_assert(!is_cvref<T>);
519 using type = value_traits<underlying_type<T>>;
522 template <
typename T>
523 struct value_traits : value_traits_base_selector<T>::type
525 template <
typename T>
526 struct value_traits<const T> : value_traits<T>
528 template <
typename T>
529 struct value_traits<volatile T> : value_traits<T>
531 template <
typename T>
532 struct value_traits<const volatile T> : value_traits<T>
534 template <
typename T>
535 struct value_traits<T&> : value_traits<T>
537 template <
typename T>
538 struct value_traits<T&&> : value_traits<T>
542 template <
typename T>
543 struct integer_limits
545 static constexpr T min = T{ (std::numeric_limits<underlying_type<T>>::min)() };
546 static constexpr T max = T{ (std::numeric_limits<underlying_type<T>>::max)() };
548 template <
typename T>
549 struct integer_traits_base : integer_limits<T>
551 using native_type = int64_t;
552 static constexpr bool is_native = std::is_same_v<underlying_type<T>, native_type>;
553 static constexpr bool is_signed =
static_cast<underlying_type<T>
>(-1) < underlying_type<T>{};
554 static constexpr auto type = node_type::integer;
555 static constexpr bool can_partially_represent_native =
true;
557 template <
typename T>
558 struct unsigned_integer_traits : integer_traits_base<T>
560 static constexpr bool is_losslessly_convertible_to_native =
561 integer_limits<underlying_type<T>>::max <= 9223372036854775807ULL;
562 static constexpr bool can_represent_native =
false;
564 template <
typename T>
565 struct signed_integer_traits : integer_traits_base<T>
567 using native_type = int64_t;
568 static constexpr bool is_losslessly_convertible_to_native =
569 integer_limits<underlying_type<T>>::min >= (-9223372036854775807LL - 1LL)
570 && integer_limits<underlying_type<T>>::max <= 9223372036854775807LL;
571 static constexpr bool can_represent_native =
572 integer_limits<underlying_type<T>>::min <= (-9223372036854775807LL - 1LL)
573 && integer_limits<underlying_type<T>>::max >= 9223372036854775807LL;
575 template <typename T, bool S = integer_traits_base<T>::is_signed>
576 struct integer_traits : signed_integer_traits<T>
578 template <
typename T>
579 struct integer_traits<T, false> : unsigned_integer_traits<T>
582 struct value_traits<signed char> : integer_traits<signed char>
585 struct value_traits<unsigned char> : integer_traits<unsigned char>
588 struct value_traits<signed short> : integer_traits<signed short>
591 struct value_traits<unsigned short> : integer_traits<unsigned short>
594 struct value_traits<signed int> : integer_traits<signed int>
597 struct value_traits<unsigned int> : integer_traits<unsigned int>
600 struct value_traits<signed long> : integer_traits<signed long>
603 struct value_traits<unsigned long> : integer_traits<unsigned long>
606 struct value_traits<signed long long> : integer_traits<signed long long>
609 struct value_traits<unsigned long long> : integer_traits<unsigned long long>
611 static_assert(value_traits<int64_t>::is_native);
612 static_assert(value_traits<int64_t>::is_signed);
613 static_assert(value_traits<int64_t>::is_losslessly_convertible_to_native);
614 static_assert(value_traits<int64_t>::can_represent_native);
615 static_assert(value_traits<int64_t>::can_partially_represent_native);
620 struct integer_limits<TOML_INT128>
622 static constexpr TOML_INT128 max =
623 static_cast<TOML_INT128
>((TOML_UINT128{ 1u } << ((__SIZEOF_INT128__ * CHAR_BIT) - 1)) - 1);
624 static constexpr TOML_INT128 min = -max - TOML_INT128{ 1 };
627 struct integer_limits<TOML_UINT128>
629 static constexpr TOML_UINT128 min = TOML_UINT128{};
630 static constexpr TOML_UINT128 max = (2u *
static_cast<TOML_UINT128
>(integer_limits<TOML_INT128>::max)) + 1u;
633 struct value_traits<TOML_INT128> : integer_traits<TOML_INT128>
636 struct value_traits<TOML_UINT128> : integer_traits<TOML_UINT128>
639#ifdef TOML_SMALL_INT_TYPE
641 struct value_traits<TOML_SMALL_INT_TYPE> : signed_integer_traits<TOML_SMALL_INT_TYPE>
646 template <
typename T,
int MantissaDigits,
int DecimalDigits>
647 struct float_traits_base
649 static constexpr auto type = node_type::floating_point;
650 using native_type = double;
651 static constexpr bool is_native = std::is_same_v<T, native_type>;
652 static constexpr bool is_signed =
true;
654 static constexpr int bits =
static_cast<int>(
sizeof(T) * CHAR_BIT);
655 static constexpr int digits = MantissaDigits;
656 static constexpr int digits10 = DecimalDigits;
658 static constexpr bool is_losslessly_convertible_to_native = bits <= 64
662 static constexpr bool can_represent_native = digits >= 53
665 static constexpr bool can_partially_represent_native = digits > 0 && digits10 > 0;
667 template <
typename T>
668 struct float_traits : float_traits_base<T, std::numeric_limits<T>::digits, std::numeric_limits<T>::digits10>
670#if TOML_ENABLE_FLOAT16
672 struct float_traits<_Float16> : float_traits_base<_Float16, __FLT16_MANT_DIG__, __FLT16_DIG__>
677 struct float_traits<TOML_FLOAT128> : float_traits_base<TOML_FLOAT128, __FLT128_MANT_DIG__, __FLT128_DIG__>
683 struct value_traits<float> : float_traits<float>
686 struct value_traits<double> : float_traits<double>
689 struct value_traits<long double> : float_traits<long double>
691#if TOML_ENABLE_FLOAT16
693 struct value_traits<_Float16> : float_traits<_Float16>
698 struct value_traits<TOML_FLOAT128> : float_traits<TOML_FLOAT128>
701#ifdef TOML_SMALL_FLOAT_TYPE
703 struct value_traits<TOML_SMALL_FLOAT_TYPE> : float_traits<TOML_SMALL_FLOAT_TYPE>
706 static_assert(value_traits<double>::is_native);
707 static_assert(value_traits<double>::is_losslessly_convertible_to_native);
708 static_assert(value_traits<double>::can_represent_native);
709 static_assert(value_traits<double>::can_partially_represent_native);
712 template <
typename T>
715 using native_type = std::string;
716 static constexpr bool is_native = std::is_same_v<T, native_type>;
717 static constexpr bool is_losslessly_convertible_to_native =
true;
718 static constexpr bool can_represent_native =
719 !std::is_array_v<T> && (!std::is_pointer_v<T> || std::is_const_v<std::remove_pointer_t<T>>);
720 static constexpr bool can_partially_represent_native = can_represent_native;
721 static constexpr auto type = node_type::string;
724 struct value_traits<
std::string> : string_traits<std::string>
727 struct value_traits<
std::string_view> : string_traits<std::string_view>
730 struct value_traits<const char*> : string_traits<const char*>
733 struct value_traits<const char[N]> : string_traits<const char[N]>
736 struct value_traits<char*> : string_traits<char*>
739 struct value_traits<char[N]> : string_traits<char[N]>
745 struct value_traits<
std::u8string> : string_traits<std::u8string>
748 struct value_traits<
std::u8string_view> : string_traits<std::u8string_view>
751 struct value_traits<const char8_t*> : string_traits<const char8_t*>
754 struct value_traits<const char8_t[N]> : string_traits<const char8_t[N]>
757 struct value_traits<char8_t*> : string_traits<char8_t*>
760 struct value_traits<char8_t[N]> : string_traits<char8_t[N]>
765#if TOML_ENABLE_WINDOWS_COMPAT
766 template <
typename T>
767 struct wstring_traits
769 using native_type = std::string;
770 static constexpr bool is_native =
false;
771 static constexpr bool is_losslessly_convertible_to_native =
true;
772 static constexpr bool can_represent_native = std::is_same_v<T, std::wstring>;
773 static constexpr bool can_partially_represent_native = can_represent_native;
774 static constexpr auto type = node_type::string;
777 struct value_traits<
std::wstring> : wstring_traits<std::wstring>
780 struct value_traits<
std::wstring_view> : wstring_traits<std::wstring_view>
783 struct value_traits<const wchar_t*> : wstring_traits<const wchar_t*>
786 struct value_traits<const wchar_t[N]> : wstring_traits<const wchar_t[N]>
789 struct value_traits<wchar_t*> : wstring_traits<wchar_t*>
792 struct value_traits<wchar_t[N]> : wstring_traits<wchar_t[N]>
797 template <
typename T, node_type NodeType>
798 struct native_value_traits
800 using native_type = T;
801 static constexpr bool is_native =
true;
802 static constexpr bool is_losslessly_convertible_to_native =
true;
803 static constexpr bool can_represent_native =
true;
804 static constexpr bool can_partially_represent_native =
true;
805 static constexpr auto type = NodeType;
808 struct value_traits<bool> : native_value_traits<bool, node_type::boolean>
811 struct value_traits<date> : native_value_traits<date, node_type::date>
814 struct value_traits<
time> : native_value_traits<time, node_type::time>
817 struct value_traits<
date_time> : native_value_traits<date_time, node_type::date_time>
821 template <
typename T>
822 using native_type_of =
typename value_traits<T>::native_type;
823 template <
typename T>
824 inline constexpr bool is_native = value_traits<T>::is_native;
825 template <
typename T>
826 inline constexpr bool can_represent_native = value_traits<T>::can_represent_native;
827 template <
typename T>
828 inline constexpr bool can_partially_represent_native = value_traits<T>::can_partially_represent_native;
829 template <
typename T>
830 inline constexpr bool is_losslessly_convertible_to_native = value_traits<T>::is_losslessly_convertible_to_native;
831 template <
typename T,
typename... U>
832 inline constexpr bool is_natively_one_of = is_one_of<native_type_of<T>, U...>;
835 template <
typename T>
840 template <
typename T>
841 struct node_wrapper<const T>
843 using type = std::add_const_t<typename node_wrapper<T>::type>;
845 template <
typename T>
846 struct node_wrapper<volatile T>
848 using type = std::add_volatile_t<typename node_wrapper<T>::type>;
850 template <
typename T>
851 struct node_wrapper<const volatile T>
853 using type = std::add_const_t<std::add_volatile_t<typename node_wrapper<T>::type>>;
856 struct node_wrapper<
std::string>
858 using type = value<std::string>;
861 struct node_wrapper<int64_t>
863 using type = value<int64_t>;
866 struct node_wrapper<double>
868 using type = value<double>;
871 struct node_wrapper<bool>
873 using type = value<bool>;
876 struct node_wrapper<date>
878 using type = value<date>;
881 struct node_wrapper<
time>
883 using type = value<time>;
888 using type = value<date_time>;
890 template <
typename T>
891 using wrap_node =
typename node_wrapper<std::remove_reference_t<T>>::type;
894 template <
typename T>
895 struct node_unwrapper
899 template <
typename T>
900 struct node_unwrapper<value<T>>
904 template <
typename T>
905 struct node_unwrapper<const value<T>>
907 using type = std::add_const_t<T>;
909 template <
typename T>
910 struct node_unwrapper<volatile value<T>>
912 using type = std::add_volatile_t<T>;
914 template <
typename T>
915 struct node_unwrapper<const volatile value<T>>
917 using type = std::add_volatile_t<std::add_const_t<T>>;
919 template <
typename T>
920 using unwrap_node =
typename node_unwrapper<std::remove_reference_t<T>>::type;
922 template <
typename T>
923 struct node_type_getter
925 static constexpr auto value = value_traits<T>::type;
928 struct node_type_getter<
table>
930 static constexpr auto value = node_type::table;
933 struct node_type_getter<
array>
935 static constexpr auto value = node_type::array;
938 struct node_type_getter<void>
940 static constexpr auto value = node_type::none;
942 template <
typename T>
943 inline constexpr node_type node_type_of = node_type_getter<unwrap_node<remove_cvref<T>>>::value;
945 template <
typename T,
typename ConvertFrom>
946 inline constexpr bool is_constructible_or_convertible = std::is_constructible_v<T, ConvertFrom>
947 || std::is_convertible_v<ConvertFrom, T>;
955 template <
typename T>
956 inline constexpr bool is_table = std::is_same_v<impl::remove_cvref<T>,
table>;
959 template <
typename T>
960 inline constexpr bool is_array = std::is_same_v<impl::remove_cvref<T>,
array>;
963 template <
typename T>
967 template <
typename T>
969 impl::remove_cvref<impl::wrap_node<impl::remove_cvref<T>>>,
973 template <
typename T>
975 impl::remove_cvref<impl::wrap_node<impl::remove_cvref<T>>>,
979 template <
typename T>
981 impl::remove_cvref<impl::wrap_node<impl::remove_cvref<T>>>,
985 template <
typename T>
986 inline constexpr bool is_number = is_integer<T> || is_floating_point<T>;
989 template <
typename T>
991 impl::remove_cvref<impl::wrap_node<impl::remove_cvref<T>>>,
995 template <
typename T>
996 inline constexpr bool is_date = std::is_same_v<
997 impl::remove_cvref<impl::wrap_node<impl::remove_cvref<T>>>,
1001 template <
typename T>
1003 impl::remove_cvref<impl::wrap_node<impl::remove_cvref<T>>>,
1007 template <
typename T>
1009 impl::remove_cvref<impl::wrap_node<impl::remove_cvref<T>>>,
1013 template <
typename T>
1017 template <
typename T>
1018 inline constexpr bool is_value = is_string<T> || is_number<T> || is_boolean<T> || is_chronological<T>;
1021 template <
typename T>
1022 inline constexpr bool is_node = std::is_same_v<toml::node, impl::remove_cvref<T>>
1023 || std::is_base_of_v<toml::node, impl::remove_cvref<T>>;
1026 template <
typename T>
1027 inline constexpr bool is_node_view = impl::is_one_of<impl::remove_cvref<T>, node_view<node>, node_view<const node>>;
1037 template <
typename T>
1039 constexpr std::underlying_type_t<T> unwrap_enum(T val)
noexcept
1041 return static_cast<std::underlying_type_t<T>
>(val);
1055 inline fp_class fpclassify(
const double& val)
noexcept
1057 static_assert(
sizeof(uint64_t) ==
sizeof(
double));
1059 static constexpr uint64_t sign = 0b1000000000000000000000000000000000000000000000000000000000000000ull;
1060 static constexpr uint64_t exponent = 0b0111111111110000000000000000000000000000000000000000000000000000ull;
1061 static constexpr uint64_t mantissa = 0b0000000000001111111111111111111111111111111111111111111111111111ull;
1064 std::memcpy(&val_bits, &val,
sizeof(val));
1065 if ((val_bits & exponent) != exponent)
1066 return fp_class::ok;
1067 if ((val_bits & mantissa))
1068 return fp_class::nan;
1069 return (val_bits & sign) ? fp_class::neg_inf : fp_class::pos_inf;
1076 template <
typename Iterator,
typename T>
1078 inline auto find(Iterator start, Iterator end,
const T& needle)
noexcept
1079 ->decltype(&(*start))
1081 for (; start != end; start++)
1082 if (*start == needle)
1087 template <
typename T>
1089 constexpr const T& min(
const T& a,
const T& b)
noexcept
1091 return a < b ? a : b;
A TOML array.
Definition array.hpp:285
The result of a parsing operation.
Definition parse_result.hpp:53
Definition parser.inl:887
A TOML path.
Definition path.hpp:239
A TOML table.
Definition table.hpp:220
enum TOML_OPEN_FLAGS_ENUM format_as_hexadecimal
Format integer values as hexadecimal.
Definition forward_declarations.hpp:284
toml_formatter default_formatter
The 'default' formatter used by TOML objects when they are printed to a stream. \detail This is an al...
Definition forward_declarations.hpp:378
enum TOML_OPEN_FLAGS_ENUM value_flags
Metadata associated with TOML values.
Definition forward_declarations.hpp:272
constexpr bool is_number
Metafunction for determining if a type satisfies either toml::is_integer or toml::is_floating_point.
Definition forward_declarations.hpp:986
enum TOML_OPEN_FLAGS_ENUM format_as_octal
Format integer values as octal.
Definition forward_declarations.hpp:281
enum TOML_CLOSED_FLAGS_ENUM allow_multi_line_strings
Strings containing newlines will be emitted as triple-quoted 'multi-line' strings where possible.
Definition forward_declarations.hpp:312
TOML_NAMESPACE_START
Definition forward_declarations.hpp:203
enum TOML_CLOSED_FLAGS_ENUM quote_dates_and_times
Dates and times will be emitted as quoted strings.
Definition forward_declarations.hpp:303
enum TOML_CLOSED_FLAGS_ENUM allow_unicode_strings
Allow non-ASCII characters in strings (as opposed to their escaped form, e.g. \u00DA).
Definition forward_declarations.hpp:318
constexpr bool is_boolean
Metafunction for determining if a type is, or is a reference to, a bool or toml::value<bool>.
Definition forward_declarations.hpp:990
enum TOML_CLOSED_FLAGS_ENUM allow_real_tabs_in_strings
Allow real tab characters in string literals (as opposed to the escaped form \t).
Definition forward_declarations.hpp:315
constexpr bool is_floating_point
Metafunction for determining if a type is, or is a reference to, a double or toml::value<double>.
Definition forward_declarations.hpp:980
constexpr bool is_date
Metafunction for determining if a type is, or is a reference to, a toml::date or toml::value<date>.
Definition forward_declarations.hpp:996
enum TOML_CLOSED_FLAGS_ENUM allow_octal_integers
Allow integers with #value_flags::format_as_octal to be emitted as octal.
Definition forward_declarations.hpp:324
TOML_ENABLE_WARNINGS
Definition forward_declarations.hpp:20
enum TOML_CLOSED_FLAGS_ENUM allow_binary_integers
Allow integers with #value_flags::format_as_binary to be emitted as binary.
Definition forward_declarations.hpp:321
constexpr bool is_string
Metafunction for determining if a type is, or is a reference to, a std::string or toml::value<std::st...
Definition forward_declarations.hpp:968
TOML_DISABLE_WARNINGS
Definition forward_declarations.hpp:9
constexpr bool is_array
Metafunction for determining if a type is, or is a reference to, a toml::array.
Definition forward_declarations.hpp:960
enum TOML_CLOSED_FLAGS_ENUM quote_infinities_and_nans
Infinities and NaNs will be emitted as quoted strings.
Definition forward_declarations.hpp:306
constexpr bool is_chronological
Metafunction for determining if a type satisfies any of toml::is_date, toml::is_time or toml::is_date...
Definition forward_declarations.hpp:1014
constexpr bool is_date_time
Metafunction for determining if a type is, or is a reference to, a toml::date_time or toml::value<dat...
Definition forward_declarations.hpp:1008
enum TOML_CLOSED_FLAGS_ENUM allow_hexadecimal_integers
Allow integers with #value_flags::format_as_hexadecimal to be emitted as hexadecimal.
Definition forward_declarations.hpp:327
enum TOML_CLOSED_FLAGS_ENUM allow_literal_strings
Strings will be emitted as single-quoted literal strings where possible.
Definition forward_declarations.hpp:309
constexpr bool is_integer
Metafunction for determining if a type is, or is a reference to, a int64_t or toml::value<int64_t>.
Definition forward_declarations.hpp:974
enum TOML_CLOSED_FLAGS_ENUM terse_key_value_pairs
Avoids the use of whitespace around key-value pairs.
Definition forward_declarations.hpp:345
constexpr bool is_container
Metafunction for determining if a type satisfies either toml::is_table or toml::is_array.
Definition forward_declarations.hpp:964
constexpr value_flags preserve_source_value_flags
Special #toml::value_flags constant used for array + table insert functions to specify that any value...
Definition forward_declarations.hpp:290
enum TOML_CLOSED_FLAGS_ENUM relaxed_float_precision
Emit floating-point values with relaxed (human-friendly) precision.
Definition forward_declarations.hpp:342
enum TOML_OPEN_FLAGS_ENUM format_as_binary
Format integer values as binary.
Definition forward_declarations.hpp:278
constexpr bool is_node_view
Metafunction for determining if a type is, or is a reference to, a toml::node_view.
Definition forward_declarations.hpp:1027
enum TOML_CLOSED_FLAGS_ENUM format_flags
Format flags for modifying how TOML data is printed to streams.
Definition forward_declarations.hpp:297
constexpr bool is_node
Metafunction for determining if a type is, or is a reference to, a toml::node (or one of its subclass...
Definition forward_declarations.hpp:1022
std::basic_ostream< Char > & operator<<(std::basic_ostream< Char > &lhs, node_type rhs)
Pretty-prints the value of a node_type to a stream.
Definition forward_declarations.hpp:256
enum TOML_CLOSED_FLAGS_ENUM indent_sub_tables
Apply indentation to tables nested within other tables/arrays.
Definition forward_declarations.hpp:330
constexpr bool is_time
Metafunction for determining if a type is, or is a reference to, a toml::time or toml::value<time>.
Definition forward_declarations.hpp:1002
enum TOML_CLOSED_FLAGS_ENUM indentation
Combination mask of all indentation-enabling flags.
Definition forward_declarations.hpp:336
enum TOML_CLOSED_FLAGS_ENUM indent_array_elements
Apply indentation to array elements when the array is forced to wrap over multiple lines.
Definition forward_declarations.hpp:333
TOML_NAMESPACE_END
Definition forward_declarations.hpp:380
constexpr bool is_value
Metafunction for determining if a type is, or is a reference to, any of the toml value types....
Definition forward_declarations.hpp:1018
#define TOML_HAS_CUSTOM_OPTIONAL_TYPE
Definition preprocessor.hpp:1101
#define TOML_EXCEPTIONS
Sets whether the library uses exceptions to report parsing failures. \detail Defaults to 1 or 0 accor...
Definition preprocessor.hpp:1126
@ value
the parser finished reading a JSON value
@ key
the parser read a key of a value in an object
The root namespace for all toml++ functions and types.
Definition forward_declarations.hpp:199
#define TOML_TRIVIAL_ABI
Definition preprocessor.hpp:430
#define POXY_IMPLEMENTATION_DETAIL(...)
Definition preprocessor.hpp:633
#define TOML_ABI_NAMESPACE_BOOL(cond, T, F)
Definition preprocessor.hpp:1323
#define TOML_ABI_NAMESPACE_END
Definition preprocessor.hpp:1324
#define TOML_CLOSED_ENUM
Definition preprocessor.hpp:557
#define TOML_PURE_GETTER
Definition preprocessor.hpp:474
#define TOML_OPEN_FLAGS_ENUM
Definition preprocessor.hpp:561
#define TOML_CLOSED_FLAGS_ENUM
Definition preprocessor.hpp:562
#define TOML_PURE_INLINE_GETTER
Definition preprocessor.hpp:479
#define TOML_IMPL_NAMESPACE_END
Definition preprocessor.hpp:1334
#define TOML_IMPL_NAMESPACE_START
Definition preprocessor.hpp:1333
#define TOML_CONST_INLINE_GETTER
Definition preprocessor.hpp:490
#define TOML_MAKE_FLAGS(T)
Definition preprocessor.hpp:601
A date-time.
Definition date_time.hpp:327
Helper class for suppressing move-construction in single-argument array constructors.
Definition forward_declarations.hpp:366
T value
Definition forward_declarations.hpp:369
A source document line-and-column pair.
Definition source_region.hpp:43
A source document region.
Definition source_region.hpp:167
A timezone offset.
Definition date_time.hpp:221
A local time-of-day.
Definition date_time.hpp:113