8#if TOML_ENABLE_FORMATTERS
49 using base = impl::formatter;
52 void print(
const toml::table&);
55 void print(
const toml::array&);
60 static constexpr impl::formatter_constants constants = {
61 format_flags::quote_dates_and_times,
62 format_flags::allow_literal_strings | format_flags::allow_multi_line_strings,
73 static constexpr format_flags default_flags = constants.mandatory_flags
74 | format_flags::quote_infinities_and_nans
75 | format_flags::allow_unicode_strings
76 | format_flags::indentation;
83 explicit json_formatter(
const toml::node& source,
format_flags flags = default_flags) noexcept
84 :
base{&source,
nullptr, constants, {
flags,
" "sv}} {}
86#if TOML_DOXYGEN || (TOML_ENABLE_PARSER && !TOML_EXCEPTIONS)
114 explicit json_formatter(
const toml::parse_result&
result,
enum TOML_CLOSED_FLAGS_ENUM format_flags
Format flags for modifying how TOML data is printed to streams.
std::basic_ostream< Char > & operator<<(std::basic_ostream< Char > &lhs, node_type rhs)
Pretty-prints the value of a node_type to a stream.
#define TOML_EXPORTED_CLASS
An 'export' annotation to add to classes. \detail Not defined by default.
#define TOML_EXPORTED_MEMBER_FUNCTION
An 'export' annotation to add to non-static class member functions. \detail Not defined by default.
#define TOML_NODISCARD_CTOR