NeBuild dev
|
A source document line-and-column pair. More...
#include <source_region.hpp>
Public Member Functions | |
TOML_PURE_GETTER constexpr | operator bool () const noexcept |
Returns true if both line and column numbers are non-zero. | |
Public Attributes | |
source_index | line |
The line number. | |
source_index | column |
The column number. | |
Friends | |
TOML_PURE_GETTER friend constexpr bool | operator== (const source_position &lhs, const source_position &rhs) noexcept |
Equality operator. | |
TOML_PURE_INLINE_GETTER friend constexpr bool | operator!= (const source_position &lhs, const source_position &rhs) noexcept |
Inequality operator. | |
TOML_PURE_GETTER friend constexpr bool | operator< (const source_position &lhs, const source_position &rhs) noexcept |
Less-than operator. | |
TOML_PURE_GETTER friend constexpr bool | operator<= (const source_position &lhs, const source_position &rhs) noexcept |
Less-than-or-equal-to operator. | |
TOML_PURE_GETTER friend constexpr bool | operator> (const source_position &lhs, const source_position &rhs) noexcept |
Greater-than operator. | |
TOML_PURE_GETTER friend constexpr bool | operator>= (const source_position &lhs, const source_position &rhs) noexcept |
Greater-than-or-equal-to operator. | |
std::ostream & | operator<< (std::ostream &lhs, const source_position &rhs) |
Prints a source_position to a stream. | |
A source document line-and-column pair.
\detail \cpp auto table = toml::parse_file("config.toml"sv); std::cout << "The node 'description' was defined at "sv << table.get("description")->source().begin() << "\n"; \ecpp
\out The value 'description' was defined at line 7, column 15 \eout
|
inlineexplicitconstexprnoexcept |
Returns true if both line and column numbers are non-zero.
|
friend |
Inequality operator.
|
friend |
Less-than operator.
|
friend |
Prints a source_position to a stream.
\detail \cpp auto tbl = toml::parse("bar = 42"sv);
std::cout << "The value for 'bar' was found on "sv << tbl.get("bar")->source().begin() << "\n"; \ecpp
\out The value for 'bar' was found on line 1, column 7 \eout
lhs | The stream. |
rhs | The source_position. |
|
friend |
Less-than-or-equal-to operator.
|
friend |
Equality operator.
|
friend |
Greater-than operator.
|
friend |
Greater-than-or-equal-to operator.
source_index source_position::column |
The column number.
source_index source_position::line |
The line number.