toml::source_region struct

A source document region.

Contents

#include <fstream>

auto tbl = toml::parse_file("config.toml"sv);
if (auto server = tbl.get("server"))
{
    std::cout << "begin: "sv << server->source().begin << std::endl;
    std::cout << "end: "sv << server->source().end << std::endl;
    std::cout << "path: "sv << *server->source().path << std::endl;
}
begin: line 3, column 1
end: line 3, column 22
path: config.toml

Public variables

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.

Variable documentation

source_path_ptr toml::source_region::path

The path to the corresponding source document.