struct
source_positionA source document line-and-column pair.
auto table = toml::parse_file("config.toml"sv); std::cout << "The node 'description' was defined at "sv << table.get("description")->source().begin() << "\n";
The value 'description' was defined at line 7, column 15
Constructors, destructors, conversion operators
- operator bool() const explicit constexpr noexcept
- Returns true if both line and column numbers are non-zero.
Public variables
-
source_
index line - The line number.
-
source_
index column - The column number.
Friends
-
auto operator!=(const source_
position& lhs, const source_ position& rhs) → bool constexpr noexcept - Inequality operator.
-
auto operator<(const source_
position& lhs, const source_ position& rhs) → bool constexpr noexcept - Less-than operator.
-
auto operator<<(std::
ostream& lhs, const source_ position& rhs) → std:: ostream& - Prints a source_
position to a stream. -
auto operator<=(const source_
position& lhs, const source_ position& rhs) → bool constexpr noexcept - Less-than-or-equal-to operator.
-
auto operator==(const source_
position& lhs, const source_ position& rhs) → bool constexpr noexcept - Equality operator.
-
auto operator>(const source_
position& lhs, const source_ position& rhs) → bool constexpr noexcept - Greater-than operator.
-
auto operator>=(const source_
position& lhs, const source_ position& rhs) → bool constexpr noexcept - Greater-than-or-equal-to operator.
Function documentation
std:: ostream& operator<<(std:: ostream& lhs,
const source_ position& rhs)
Prints a source_
Parameters | |
---|---|
lhs | The stream. |
rhs | The source_ |
Returns | The input stream. |
auto tbl = toml::parse("bar = 42"sv); std::cout << "The value for 'bar' was found on "sv << tbl.get("bar")->source().begin() << "\n";
The value for 'bar' was found on line 1, column 7
Variable documentation
source_ index toml:: source_position:: line
The line number.
source_ index toml:: source_position:: column
The column number.