NeBuild dev
|
A source document region. More...
#include <source_region.hpp>
Public Member Functions | |
TOML_NODISCARD optional< std::wstring > | wide_path () const |
The path to the corresponding source document as a wide-string. | |
Public Attributes | |
source_position | begin |
The beginning of the region (inclusive). | |
source_position | end |
The end of the region (exclusive). | |
source_path_ptr | path |
The path to the corresponding source document. | |
Friends | |
std::ostream & | operator<< (std::ostream &lhs, const source_region &rhs) |
Prints a source_region to a stream. | |
A source document region.
\detail \cpp 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"; } \ecpp
\out begin: line 3, column 1 end: line 3, column 22 path: config.toml \eout
|
inline |
The path to the corresponding source document as a wide-string.
\availability This function is only available when TOML_ENABLE_WINDOWS_COMPAT is enabled.
|
friend |
Prints a source_region to a stream.
\detail \cpp auto tbl = toml::parse("bar = 42", "config.toml");
std::cout << "The value for 'bar' was found on "sv << tbl.get("bar")->source() << "\n"; \ecpp
\out The value for 'bar' was found on line 1, column 7 of 'config.toml' \eout
lhs | The stream. |
rhs | The source_position. |
source_position source_region::begin |
The beginning of the region (inclusive).
source_position source_region::end |
The end of the region (exclusive).
source_path_ptr source_region::path |
The path to the corresponding source document.
nullptr
if no path was provided to toml::parse().