8#if TOML_ENABLE_FORMATTERS
45 using base = impl::formatter;
48 void print_yaml_string(
const value<std::string>&);
51 void print(
const toml::table&,
bool =
false);
54 void print(
const toml::array&,
bool =
false);
59 static constexpr impl::formatter_constants constants = {
61 format_flags::quote_dates_and_times | format_flags::indentation,
62 format_flags::allow_multi_line_strings,
74 static constexpr format_flags default_flags = constants.mandatory_flags
75 | format_flags::allow_literal_strings
76 | format_flags::allow_unicode_strings
77 | format_flags::allow_octal_integers
78 | format_flags::allow_hexadecimal_integers;
85 explicit yaml_formatter(
const toml::node& source,
format_flags flags = default_flags) noexcept
86 : base{ &source,
nullptr, constants, { flags,
" "sv } }
89#if TOML_DOXYGEN || (TOML_ENABLE_PARSER && !TOML_EXCEPTIONS)
114 explicit yaml_formatter(
const toml::parse_result& result,
format_flags flags = default_flags) noexcept
115 : base{
nullptr, &result, constants, { flags,
" "sv } }
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_CALLCONV
Calling convention to apply to exported free/static functions. \detail Not defined by default (let th...
Definition preprocessor.hpp:1134
#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
#define TOML_NODISCARD_CTOR
Definition preprocessor.hpp:446