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 " \
31 "doesn't conform to " \
32 "one of the 'ground truths' assumed by the library. Essentially this just means that I don't " \
34 "resources to test on more platforms, but I wish I did! You can try disabling the checks by " \
36 "TOML_DISABLE_ENVIRONMENT_CHECKS, but your mileage may vary. Please consider filing an issue " \
38 "https://github.com/marzer/tomlplusplus/issues to help me improve support for your target " \
42static_assert(
CHAR_BIT == 8, TOML_ENV_MESSAGE);
44static_assert(
FLT_RADIX == 2, TOML_ENV_MESSAGE);
46static_assert(
'A' == 65, TOML_ENV_MESSAGE);
47static_assert(
sizeof(double) == 8, TOML_ENV_MESSAGE);
48static_assert(std::numeric_limits<double>::is_iec559, TOML_ENV_MESSAGE);
49static_assert(std::numeric_limits<double>::digits == 53, TOML_ENV_MESSAGE);
50static_assert(std::numeric_limits<double>::digits10 == 15, TOML_ENV_MESSAGE);
51static_assert(std::numeric_limits<double>::radix == 2, TOML_ENV_MESSAGE);
53#undef TOML_ENV_MESSAGE
71using ::std::nullptr_t;
72using ::std::ptrdiff_t;
78using ::std::uint_least32_t;
79using ::std::uint_least64_t;
80using ::std::uintptr_t;
107 class toml_formatter;
108 class json_formatter;
109 class yaml_formatter;
122 using node_ptr = std::unique_ptr<node>;
130 inline constexpr std::string_view control_char_escapes[] =
166 inline constexpr std::string_view node_type_friendly_names[] =
184#if TOML_ABI_NAMESPACES
186#define TOML_PARSER_TYPENAME TOML_NAMESPACE::impl::impl_ex::parser
188#define TOML_PARSER_TYPENAME TOML_NAMESPACE::impl::impl_noex::parser
191#define TOML_PARSER_TYPENAME TOML_NAMESPACE::impl::parser
253 template <
typename Char>
254 inline std::basic_ostream<Char>&
operator<<(std::basic_ostream<Char>&
lhs, node_type
rhs) {
256 impl::node_type_friendly_names[
static_cast<std::underlying_type_t<node_type>
>(
rhs)];
257 using str_char_t =
decltype(
str)::value_type;
258 if constexpr (std::is_same_v<Char, str_char_t>)
261 if constexpr (
sizeof(
Char) ==
sizeof(str_char_t))
262 return lhs << std::basic_string_view<Char>{
reinterpret_cast<const Char*
>(
str.data()),
367 template <
typename T>
369 static_assert(std::is_reference_v<T>);
373 template <
typename T>
375 template <
typename T>
389 template <
typename T>
390 using remove_cvref = std::remove_cv_t<std::remove_reference_t<T>>;
392 template <
typename...
T>
393 using common_signed_type = std::common_type_t<std::make_signed_t<T>...>;
395 template <
typename T,
typename...
U>
396 inline constexpr bool is_one_of = (
false || ... || std::is_same_v<T, U>);
398 template <
typename...
T>
399 inline constexpr bool all_integral = (std::is_integral_v<T> && ...);
401 template <
typename T>
402 inline constexpr bool is_cvref =
403 std::is_reference_v<T> || std::is_const_v<T> || std::is_volatile_v<T>;
405 template <
typename T>
406 inline constexpr bool is_wide_string =
407 is_one_of<std::decay_t<T>,
const wchar_t*,
wchar_t*, std::wstring_view, std::wstring>;
409 template <
typename T>
410 inline constexpr bool value_retrieval_is_nothrow =
411 !std::is_same_v<remove_cvref<T>, std::string>
413 && !std::is_same_v<remove_cvref<T>, std::u8string>
416 && !is_wide_string<T>;
418 template <
typename,
typename>
420 template <
typename Dest,
typename Src>
421 using copy_ref =
typename copy_ref_<Dest, Src>::type;
423 template <
typename Dest,
typename Src>
428 template <
typename Dest,
typename Src>
429 struct copy_ref_<Dest, Src&> {
430 using type = std::add_lvalue_reference_t<Dest>;
433 template <
typename Dest,
typename Src>
434 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>
448 template <
typename Dest,
typename Src>
449 struct copy_cv_<Dest, const Src> {
450 using type = std::add_const_t<Dest>;
453 template <
typename Dest,
typename Src>
454 struct copy_cv_<Dest, volatile Src> {
455 using type = std::add_volatile_t<Dest>;
458 template <
typename Dest,
typename Src>
459 struct copy_cv_<Dest, const volatile Src> {
460 using type = std::add_cv_t<Dest>;
463 template <
typename Dest,
typename Src>
465 copy_ref<copy_ref<copy_cv<std::remove_reference_t<Dest>, std::remove_reference_t<Src>>, Dest>,
468 template <
typename...>
469 inline constexpr bool always_false =
false;
471 template <
typename T,
typename...
U>
472 inline constexpr bool first_is_same =
false;
473 template <
typename T,
typename...
U>
474 inline constexpr bool first_is_same<
T,
T,
U...> =
true;
476 template <
typename T,
bool = std::is_enum_v<T>>
477 struct underlying_type_ {
478 using type = std::underlying_type_t<T>;
480 template <
typename T>
481 struct underlying_type_<
T,
false> {
484 template <
typename T>
485 using underlying_type =
typename underlying_type_<T>::type;
489 struct default_value_traits {
490 using native_type = void;
491 static constexpr bool is_native =
false;
492 static constexpr bool is_losslessly_convertible_to_native =
false;
493 static constexpr bool can_represent_native =
false;
494 static constexpr bool can_partially_represent_native =
false;
495 static constexpr auto type = node_type::none;
498 template <
typename T>
501 template <
typename T,
bool = std::is_enum_v<T>>
502 struct value_traits_base_selector {
503 static_assert(!is_cvref<T>);
505 using type = default_value_traits;
507 template <
typename T>
508 struct value_traits_base_selector<
T,
true> {
509 static_assert(!is_cvref<T>);
511 using type = value_traits<underlying_type<T>>;
514 template <
typename T>
515 struct value_traits : value_traits_base_selector<T>::type {};
516 template <
typename T>
517 struct value_traits<const
T> : value_traits<T> {};
518 template <
typename T>
519 struct value_traits<volatile
T> : value_traits<T> {};
520 template <
typename T>
521 struct value_traits<const volatile
T> : value_traits<T> {};
522 template <
typename T>
523 struct value_traits<
T&> : value_traits<T> {};
524 template <
typename T>
525 struct value_traits<
T&&> : value_traits<T> {};
528 template <
typename T>
529 struct integer_limits {
530 static constexpr T min =
T{(std::numeric_limits<underlying_type<T>>
::min)()};
531 static constexpr T max =
T{(std::numeric_limits<underlying_type<T>>
::max)()};
533 template <
typename T>
534 struct integer_traits_base : integer_limits<T> {
535 using native_type = int64_t;
536 static constexpr bool is_native = std::is_same_v<underlying_type<T>, native_type>;
537 static constexpr bool is_signed =
static_cast<underlying_type<T>
>(-1) < underlying_type<T>{};
538 static constexpr auto type = node_type::integer;
539 static constexpr bool can_partially_represent_native =
true;
541 template <
typename T>
542 struct unsigned_integer_traits : integer_traits_base<T> {
543 static constexpr bool is_losslessly_convertible_to_native =
544 integer_limits<underlying_type<T>>
::max <= 9223372036854775807ULL;
545 static constexpr bool can_represent_native =
false;
547 template <
typename T>
548 struct signed_integer_traits : integer_traits_base<T> {
549 using native_type = int64_t;
550 static constexpr bool is_losslessly_convertible_to_native =
551 integer_limits<underlying_type<T>>
::min >= (-9223372036854775807LL - 1LL) &&
552 integer_limits<underlying_type<T>>
::max <= 9223372036854775807LL;
553 static constexpr bool can_represent_native =
554 integer_limits<underlying_type<T>>
::min <= (-9223372036854775807LL - 1LL) &&
555 integer_limits<underlying_type<T>>
::max >= 9223372036854775807LL;
557 template <typename T, bool S = integer_traits_base<T>::is_signed>
558 struct integer_traits : signed_integer_traits<T> {};
559 template <
typename T>
560 struct integer_traits<
T,
false> : unsigned_integer_traits<T> {};
562 struct value_traits<signed char> : integer_traits<signed char> {};
564 struct value_traits<unsigned char> : integer_traits<unsigned char> {};
566 struct value_traits<signed short> : integer_traits<signed short> {};
568 struct value_traits<unsigned short> : integer_traits<unsigned short> {};
570 struct value_traits<signed int> : integer_traits<signed int> {};
572 struct value_traits<unsigned int> : integer_traits<unsigned int> {};
574 struct value_traits<signed long> : integer_traits<signed long> {};
576 struct value_traits<unsigned long> : integer_traits<unsigned long> {};
578 struct value_traits<signed long long> : integer_traits<signed long long> {};
580 struct value_traits<unsigned long long> : integer_traits<unsigned long long> {};
581 static_assert(value_traits<int64_t>::is_native);
582 static_assert(value_traits<int64_t>::is_signed);
583 static_assert(value_traits<int64_t>::is_losslessly_convertible_to_native);
584 static_assert(value_traits<int64_t>::can_represent_native);
585 static_assert(value_traits<int64_t>::can_partially_represent_native);
590 struct integer_limits<TOML_INT128> {
591 static constexpr TOML_INT128
max =
592 static_cast<TOML_INT128
>((TOML_UINT128{1u} << ((__SIZEOF_INT128__ *
CHAR_BIT) - 1)) - 1);
593 static constexpr TOML_INT128
min = -
max - TOML_INT128{1};
596 struct integer_limits<TOML_UINT128> {
597 static constexpr TOML_UINT128
min = TOML_UINT128{};
598 static constexpr TOML_UINT128
max =
599 (2u *
static_cast<TOML_UINT128
>(integer_limits<TOML_INT128>::max)) + 1u;
602 struct value_traits<TOML_INT128> : integer_traits<TOML_INT128> {};
604 struct value_traits<TOML_UINT128> : integer_traits<TOML_UINT128> {};
606#ifdef TOML_SMALL_INT_TYPE
608 struct value_traits<TOML_SMALL_INT_TYPE> : signed_integer_traits<TOML_SMALL_INT_TYPE> {};
612 template <
typename T,
int MantissaDigits,
int DecimalDigits>
613 struct float_traits_base {
614 static constexpr auto type = node_type::floating_point;
615 using native_type = double;
616 static constexpr bool is_native = std::is_same_v<T, native_type>;
617 static constexpr bool is_signed =
true;
619 static constexpr int bits =
static_cast<int>(
sizeof(
T) *
CHAR_BIT);
620 static constexpr int digits = MantissaDigits;
621 static constexpr int digits10 = DecimalDigits;
623 static constexpr bool is_losslessly_convertible_to_native = bits <= 64
627 static constexpr bool can_represent_native =
digits >= 53
630 static constexpr bool can_partially_represent_native =
digits > 0 && digits10 > 0;
632 template <
typename T>
634 : float_traits_base<T, std::numeric_limits<T>::digits, std::numeric_limits<T>::digits10> {};
635#if TOML_ENABLE_FLOAT16
637 struct float_traits<_Float16> : float_traits_base<_Float16, __FLT16_MANT_DIG__, __FLT16_DIG__> {};
641 struct float_traits<TOML_FLOAT128>
642 : float_traits_base<TOML_FLOAT128, __FLT128_MANT_DIG__, __FLT128_DIG__> {};
647 struct value_traits<float> : float_traits<float> {};
649 struct value_traits<double> : float_traits<double> {};
651 struct value_traits<long double> : float_traits<long double> {};
652#if TOML_ENABLE_FLOAT16
654 struct value_traits<_Float16> : float_traits<_Float16> {};
658 struct value_traits<TOML_FLOAT128> : float_traits<TOML_FLOAT128> {};
660#ifdef TOML_SMALL_FLOAT_TYPE
662 struct value_traits<TOML_SMALL_FLOAT_TYPE> : float_traits<TOML_SMALL_FLOAT_TYPE> {};
664 static_assert(value_traits<double>::is_native);
665 static_assert(value_traits<double>::is_losslessly_convertible_to_native);
666 static_assert(value_traits<double>::can_represent_native);
667 static_assert(value_traits<double>::can_partially_represent_native);
670 template <
typename T>
671 struct string_traits {
672 using native_type = std::string;
673 static constexpr bool is_native = std::is_same_v<T, native_type>;
674 static constexpr bool is_losslessly_convertible_to_native =
true;
675 static constexpr bool can_represent_native =
676 !std::is_array_v<T> && (!std::is_pointer_v<T> || std::is_const_v<std::remove_pointer_t<T>>);
677 static constexpr bool can_partially_represent_native = can_represent_native;
678 static constexpr auto type = node_type::string;
681 struct value_traits<
std::string> : string_traits<std::string> {};
683 struct value_traits<
std::string_view> : string_traits<std::string_view> {};
685 struct value_traits<const char*> : string_traits<const char*> {};
687 struct value_traits<const char[
N]> : string_traits<const char[N]> {};
689 struct value_traits<char*> : string_traits<char*> {};
691 struct value_traits<char[
N]> : string_traits<char[N]> {};
696 struct value_traits<
std::u8string> : string_traits<std::u8string> {};
698 struct value_traits<
std::u8string_view> : string_traits<std::u8string_view> {};
700 struct value_traits<const char8_t*> : string_traits<const char8_t*> {};
702 struct value_traits<const char8_t[
N]> : string_traits<const char8_t[N]> {};
704 struct value_traits<char8_t*> : string_traits<char8_t*> {};
706 struct value_traits<char8_t[
N]> : string_traits<char8_t[N]> {};
710#if TOML_ENABLE_WINDOWS_COMPAT
711 template <
typename T>
712 struct wstring_traits {
713 using native_type = std::string;
714 static constexpr bool is_native =
false;
715 static constexpr bool is_losslessly_convertible_to_native =
true;
716 static constexpr bool can_represent_native = std::is_same_v<T, std::wstring>;
717 static constexpr bool can_partially_represent_native = can_represent_native;
718 static constexpr auto type = node_type::string;
721 struct value_traits<
std::wstring> : wstring_traits<std::wstring> {};
723 struct value_traits<
std::wstring_view> : wstring_traits<std::wstring_view> {};
725 struct value_traits<const
wchar_t*> : wstring_traits<const wchar_t*> {};
727 struct value_traits<const
wchar_t[
N]> : wstring_traits<const wchar_t[N]> {};
729 struct value_traits<
wchar_t*> : wstring_traits<wchar_t*> {};
731 struct value_traits<
wchar_t[
N]> : wstring_traits<wchar_t[N]> {};
735 template <
typename T, node_type NodeType>
736 struct native_value_traits {
737 using native_type =
T;
738 static constexpr bool is_native =
true;
739 static constexpr bool is_losslessly_convertible_to_native =
true;
740 static constexpr bool can_represent_native =
true;
741 static constexpr bool can_partially_represent_native =
true;
742 static constexpr auto type = NodeType;
745 struct value_traits<
bool> : native_value_traits<bool, node_type::boolean> {};
747 struct value_traits<date> : native_value_traits<date, node_type::date> {};
749 struct value_traits<
time> : native_value_traits<time, node_type::time> {};
751 struct value_traits<
date_time> : native_value_traits<date_time, node_type::date_time> {};
754 template <
typename T>
755 using native_type_of =
typename value_traits<T>::native_type;
756 template <
typename T>
757 inline constexpr bool is_native = value_traits<T>::is_native;
758 template <
typename T>
759 inline constexpr bool can_represent_native = value_traits<T>::can_represent_native;
760 template <
typename T>
761 inline constexpr bool can_partially_represent_native =
762 value_traits<T>::can_partially_represent_native;
763 template <
typename T>
764 inline constexpr bool is_losslessly_convertible_to_native =
765 value_traits<T>::is_losslessly_convertible_to_native;
766 template <
typename T,
typename...
U>
767 inline constexpr bool is_natively_one_of = is_one_of<native_type_of<T>,
U...>;
770 template <
typename T>
771 struct node_wrapper {
774 template <
typename T>
775 struct node_wrapper<const
T> {
776 using type = std::add_const_t<typename node_wrapper<T>::type>;
778 template <
typename T>
779 struct node_wrapper<volatile
T> {
780 using type = std::add_volatile_t<typename node_wrapper<T>::type>;
782 template <
typename T>
783 struct node_wrapper<const volatile
T> {
784 using type = std::add_const_t<std::add_volatile_t<typename node_wrapper<T>::type>>;
787 struct node_wrapper<
std::string> {
788 using type = value<std::string>;
791 struct node_wrapper<int64_t> {
792 using type = value<int64_t>;
795 struct node_wrapper<double> {
796 using type = value<double>;
799 struct node_wrapper<
bool> {
800 using type = value<bool>;
803 struct node_wrapper<date> {
804 using type = value<date>;
807 struct node_wrapper<
time> {
808 using type = value<time>;
812 using type = value<date_time>;
814 template <
typename T>
815 using wrap_node =
typename node_wrapper<std::remove_reference_t<T>>::type;
818 template <
typename T>
819 struct node_unwrapper {
822 template <
typename T>
823 struct node_unwrapper<
value<
T>> {
826 template <
typename T>
827 struct node_unwrapper<const
value<
T>> {
828 using type = std::add_const_t<T>;
830 template <
typename T>
831 struct node_unwrapper<volatile
value<
T>> {
832 using type = std::add_volatile_t<T>;
834 template <
typename T>
835 struct node_unwrapper<const volatile
value<
T>> {
836 using type = std::add_volatile_t<std::add_const_t<T>>;
838 template <
typename T>
839 using unwrap_node =
typename node_unwrapper<std::remove_reference_t<T>>::type;
841 template <
typename T>
842 struct node_type_getter {
843 static constexpr auto value = value_traits<T>::type;
846 struct node_type_getter<
table> {
847 static constexpr auto value = node_type::table;
850 struct node_type_getter<
array> {
851 static constexpr auto value = node_type::array;
854 struct node_type_getter<void> {
855 static constexpr auto value = node_type::none;
857 template <
typename T>
858 inline constexpr node_type node_type_of = node_type_getter<unwrap_node<remove_cvref<T>>>
::value;
860 template <
typename T,
typename ConvertFrom>
861 inline constexpr bool is_constructible_or_convertible =
862 std::is_constructible_v<T, ConvertFrom>
863 || std::is_convertible_v<ConvertFrom, T>;
870 template <
typename T>
871 inline constexpr bool is_table = std::is_same_v<impl::remove_cvref<T>,
table>;
874 template <
typename T>
875 inline constexpr bool is_array = std::is_same_v<impl::remove_cvref<T>,
array>;
879 template <
typename T>
884 template <
typename T>
886 impl::remove_cvref<impl::wrap_node<impl::remove_cvref<T>>>,
891 template <
typename T>
893 impl::remove_cvref<impl::wrap_node<impl::remove_cvref<T>>>,
898 template <
typename T>
900 impl::remove_cvref<impl::wrap_node<impl::remove_cvref<T>>>,
905 template <
typename T>
906 inline constexpr bool is_number = is_integer<T> || is_floating_point<T>;
910 template <
typename T>
912 impl::remove_cvref<impl::wrap_node<impl::remove_cvref<T>>>,
917 template <
typename T>
918 inline constexpr bool is_date = std::is_same_v<
919 impl::remove_cvref<impl::wrap_node<impl::remove_cvref<T>>>,
924 template <
typename T>
925 inline constexpr bool is_time = std::is_same_v<
926 impl::remove_cvref<impl::wrap_node<impl::remove_cvref<T>>>,
931 template <
typename T>
933 impl::remove_cvref<impl::wrap_node<impl::remove_cvref<T>>>,
938 template <
typename T>
943 template <
typename T>
945 is_string<T> || is_number<T> || is_boolean<T> || is_chronological<T>;
949 template <
typename T>
950 inline constexpr bool is_node = std::is_same_v<toml::node, impl::remove_cvref<T>>
951 || std::is_base_of_v<toml::node, impl::remove_cvref<T>>;
954 template <
typename T>
956 impl::is_one_of<impl::remove_cvref<T>, node_view<node>, node_view<const node>>;
965 template <
typename T>
967 return static_cast<std::underlying_type_t<T>
>(
val);
972 enum class TOML_CLOSED_ENUM fp_class :
unsigned { ok, neg_inf, pos_inf, nan };
975 inline fp_class fpclassify(
const double&
val)
noexcept {
976 static_assert(
sizeof(uint64_t) ==
sizeof(
double));
978 static constexpr uint64_t sign =
979 0b1000000000000000000000000000000000000000000000000000000000000000ull;
980 static constexpr uint64_t exponent =
981 0b0111111111110000000000000000000000000000000000000000000000000000ull;
982 static constexpr uint64_t mantissa =
983 0b0000000000001111111111111111111111111111111111111111111111111111ull;
986 std::memcpy(&val_bits, &
val,
sizeof(
val));
987 if ((val_bits & exponent) != exponent)
return fp_class::ok;
988 if ((val_bits & mantissa))
return fp_class::nan;
989 return (val_bits & sign) ? fp_class::neg_inf : fp_class::pos_inf;
996 template <
typename Iterator,
typename T>
998 ->
decltype(&(*start)) {
1000 if (*
start == needle)
return &(*start);
1004 template <
typename T>
1007 return a <
b ?
a :
b;
The result of a parsing operation.
enum TOML_OPEN_FLAGS_ENUM format_as_hexadecimal
Format integer values as hexadecimal.
toml_formatter default_formatter
The 'default' formatter used by TOML objects when they are printed to a stream. \detail This is an al...
enum TOML_OPEN_FLAGS_ENUM value_flags
Metadata associated with TOML values.
constexpr bool is_number
Metafunction for determining if a type satisfies either toml::is_integer or toml::is_floating_point.
enum TOML_OPEN_FLAGS_ENUM format_as_octal
Format integer values as octal.
enum TOML_CLOSED_FLAGS_ENUM allow_multi_line_strings
Strings containing newlines will be emitted as triple-quoted 'multi-line' strings where possible.
enum TOML_CLOSED_FLAGS_ENUM quote_dates_and_times
Dates and times will be emitted as quoted strings.
enum TOML_CLOSED_FLAGS_ENUM allow_unicode_strings
Allow non-ASCII characters in strings (as opposed to their escaped form, e.g. \u00DA).
constexpr bool is_boolean
Metafunction for determining if a type is, or is a reference to, a bool or toml::value<bool>.
enum TOML_CLOSED_FLAGS_ENUM allow_real_tabs_in_strings
Allow real tab characters in string literals (as opposed to the escaped form \t).
constexpr bool is_floating_point
Metafunction for determining if a type is, or is a reference to, a double or toml::value<double>.
constexpr bool is_date
Metafunction for determining if a type is, or is a reference to, a toml::date or toml::value<date>.
enum TOML_CLOSED_FLAGS_ENUM allow_octal_integers
Allow integers with #value_flags::format_as_octal to be emitted as octal.
enum TOML_CLOSED_FLAGS_ENUM allow_binary_integers
Allow integers with #value_flags::format_as_binary to be emitted as binary.
constexpr bool is_string
Metafunction for determining if a type is, or is a reference to, a std::string or toml::value<std::st...
constexpr bool is_array
Metafunction for determining if a type is, or is a reference to, a toml::array.
enum TOML_CLOSED_FLAGS_ENUM quote_infinities_and_nans
Infinities and NaNs will be emitted as quoted strings.
constexpr bool is_chronological
Metafunction for determining if a type satisfies any of toml::is_date, toml::is_time or toml::is_date...
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...
enum TOML_CLOSED_FLAGS_ENUM allow_hexadecimal_integers
Allow integers with #value_flags::format_as_hexadecimal to be emitted as hexadecimal.
enum TOML_CLOSED_FLAGS_ENUM allow_literal_strings
Strings will be emitted as single-quoted literal strings where possible.
constexpr bool is_integer
Metafunction for determining if a type is, or is a reference to, a int64_t or toml::value<int64_t>.
enum TOML_CLOSED_FLAGS_ENUM terse_key_value_pairs
Avoids the use of whitespace around key-value pairs.
constexpr bool is_container
Metafunction for determining if a type satisfies either toml::is_table or toml::is_array.
constexpr value_flags preserve_source_value_flags
Special #toml::value_flags constant used for array + table insert functions to specify that any value...
enum TOML_CLOSED_FLAGS_ENUM relaxed_float_precision
Emit floating-point values with relaxed (human-friendly) precision.
enum TOML_OPEN_FLAGS_ENUM format_as_binary
Format integer values as binary.
constexpr bool is_node_view
Metafunction for determining if a type is, or is a reference to, a toml::node_view.
enum TOML_CLOSED_FLAGS_ENUM format_flags
Format flags for modifying how TOML data is printed to streams.
constexpr bool is_node
Metafunction for determining if a type is, or is a reference to, a toml::node (or one of its subclass...
std::basic_ostream< Char > & operator<<(std::basic_ostream< Char > &lhs, node_type rhs)
Pretty-prints the value of a node_type to a stream.
enum TOML_CLOSED_FLAGS_ENUM indent_sub_tables
Apply indentation to tables nested within other tables/arrays.
constexpr bool is_time
Metafunction for determining if a type is, or is a reference to, a toml::time or toml::value<time>.
enum TOML_CLOSED_FLAGS_ENUM indentation
Combination mask of all indentation-enabling flags.
enum TOML_CLOSED_FLAGS_ENUM indent_array_elements
Apply indentation to array elements when the array is forced to wrap over multiple lines.
constexpr bool is_value
Metafunction for determining if a type is, or is a reference to, any of the toml value types....
#define TOML_HAS_CUSTOM_OPTIONAL_TYPE
#define TOML_EXCEPTIONS
Sets whether the library uses exceptions to report parsing failures. \detail Defaults to 1 or 0 accor...
The root namespace for all toml++ functions and types.
#define POXY_IMPLEMENTATION_DETAIL(...)
#define TOML_ABI_NAMESPACE_BOOL(cond, T, F)
#define TOML_ABI_NAMESPACE_END
#define TOML_OPEN_FLAGS_ENUM
#define TOML_CLOSED_FLAGS_ENUM
#define TOML_PURE_INLINE_GETTER
#define TOML_IMPL_NAMESPACE_END
#define TOML_IMPL_NAMESPACE_START
#define TOML_CONST_INLINE_GETTER
#define TOML_MAKE_FLAGS(T)
Helper class for suppressing move-construction in single-argument array constructors.
A source document line-and-column pair.
A source document region.