Closed Raildex closed 11 months ago
This option is available to you already, using the toml_formatter
and format_flags
:
// given (for exposition purposes):
using namespace toml;
using std::cout;
auto tbl = toml::parse_file("config.toml");
// instead of this:
cout << tbl;
// do this:
cout << toml_formatter{ tbl, toml_formatter::default_flags & ~format_flags::indent_sub_tables };
A toml_formatter
instance is implicitly created when you do a 'raw' operator<<
, so here I'm just making it explicit to modify the format flags.
Hope that helps :)
Is your feature request related to a problem? Please describe. I wam using TOML for config files. Nested tables receive an indendation when using an
std::ostream
like instream << table << std::endl
Describe the solution you'd like
I would like to have an option to alter the indendation/completely remove indentation.
Additional context