8#if TOML_ENABLE_FORMATTERS
47 using base = impl::formatter;
48 std::vector<const key*> key_path_;
49 bool pending_table_separator_ =
false;
52 void print_pending_table_separator();
55 void print(
const key&);
58 void print_inline(
const toml::table&);
61 void print(
const toml::array&);
64 void print(
const toml::table&);
69 static constexpr impl::formatter_constants constants = {format_flags::none,
81 static constexpr format_flags default_flags = constants.mandatory_flags
82 | format_flags::allow_literal_strings
83 | format_flags::allow_multi_line_strings
84 | format_flags::allow_unicode_strings
85 | format_flags::allow_real_tabs_in_strings
86 | format_flags::allow_binary_integers
87 | format_flags::allow_octal_integers
88 | format_flags::allow_hexadecimal_integers
89 | format_flags::indentation;
96 explicit toml_formatter(
const toml::node& source,
format_flags flags = default_flags) noexcept
97 :
base{&source,
nullptr, constants, {
flags,
" "sv}} {}
99#if TOML_DOXYGEN || (TOML_ENABLE_PARSER && !TOML_EXCEPTIONS)
125 explicit toml_formatter(
const toml::parse_result&
result,
134 rhs.key_path_.clear();
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