struct
source_regionA source document region.
auto tbl = toml::parse_file("config.toml"sv); if (auto server = tbl.get("server")) { std::cout << "begin: "sv << server->source().begin << "\n"; std::cout << "end: "sv << server->source().end << "\n"; std::cout << "path: "sv << *server->source().path << "\n"; }
begin: line 3, column 1 end: line 3, column 22 path: config.toml
Public functions
-
auto wide_path() const → optional<std::
wstring > - The path to the corresponding source document as a wide-string.
Public variables
-
source_
position begin - The beginning of the region (inclusive).
-
source_
position end - The end of the region (exclusive).
-
source_
path_ pathptr - The path to the corresponding source document.
Friends
-
auto operator<<(std::
ostream & lhs, const source_region & rhs) → std::ostream & - Prints a source_
region to a stream.
Function documentation
optional<std::wstring > toml::source_region:: wide_path() const
The path to the corresponding source document as a wide-string.
std::ostream & operator<<(std::ostream & lhs,
const source_region & rhs)
Prints a source_
Parameters | |
---|---|
lhs | The stream. |
rhs | The source_ |
Returns | The input stream. |
auto tbl = toml::parse("bar = 42", "config.toml"); std::cout << "The value for 'bar' was found on "sv << tbl.get("bar")->source() << "\n";
The value for 'bar' was found on line 1, column 7 of 'config.toml'
Variable documentation
source_path_ptr toml::source_region:: path
The path to the corresponding source document.