51 using base = impl::formatter;
54 void print(
const toml::table&);
57 void print(
const toml::array&);
62 static constexpr impl::formatter_constants constants = {
63 format_flags::quote_dates_and_times,
64 format_flags::allow_literal_strings | format_flags::allow_multi_line_strings,
76 static constexpr format_flags default_flags = constants.mandatory_flags
77 | format_flags::quote_infinities_and_nans
78 | format_flags::allow_unicode_strings
79 | format_flags::indentation;
86 explicit json_formatter(
const toml::node& source,
format_flags flags = default_flags) noexcept
87 : base{ &source,
nullptr, constants, { flags,
" "sv } }
90#if TOML_DOXYGEN || (TOML_ENABLE_PARSER && !TOML_EXCEPTIONS)
117 explicit json_formatter(
const toml::parse_result& result,
format_flags flags = default_flags) noexcept
118 : base{
nullptr, &result, constants, { flags,
" "sv } }
124 friend std::ostream&
operator<<(std::ostream& lhs, json_formatter& rhs)
133 friend std::ostream&
operator<<(std::ostream& lhs, json_formatter&& rhs)
enum TOML_CLOSED_FLAGS_ENUM format_flags
Format flags for modifying how TOML data is printed to streams.
Definition forward_declarations.hpp:297
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
#define TOML_EXPORTED_CLASS
An 'export' annotation to add to classes. \detail Not defined by default.
Definition preprocessor.hpp:979
#define TOML_EXPORTED_MEMBER_FUNCTION
An 'export' annotation to add to non-static class member functions. \detail Not defined by default.
Definition preprocessor.hpp:982