15 using source_index = uint32_t;
52 explicit constexpr operator bool() const noexcept {
53 return line > source_index{}
54 && column > source_index{};
61 return lhs.line ==
rhs.line
62 &&
lhs.column ==
rhs.column;
77 return static_cast<uint64_t
>(
pos.line) << 32 |
static_cast<uint64_t
>(
pos.column);
87 return pack(
lhs) < pack(
rhs);
94 return pack(
lhs) <= pack(
rhs);
101 return pack(
lhs) > pack(
rhs);
108 return pack(
lhs) >= pack(
rhs);
130 impl::print_to_stream(
lhs,
rhs);
173#if TOML_ENABLE_WINDOWS_COMPAT
183 return {impl::widen(*
path)};
207 impl::print_to_stream(
lhs,
rhs);
TOML_PURE_INLINE_GETTER bool empty() const noexcept
Whether (true) or not (false) the path is empty.
#define TOML_PURE_INLINE_GETTER
std::shared_ptr< const std::string > source_path_ptr
A pointer to a shared string resource containing a source path.
A source document line-and-column pair.
TOML_PURE_GETTER friend constexpr bool operator>=(const source_position &lhs, const source_position &rhs) noexcept
Greater-than-or-equal-to operator.
TOML_PURE_INLINE_GETTER friend constexpr bool operator!=(const source_position &lhs, const source_position &rhs) noexcept
Inequality operator.
source_index line
The line number.
source_index column
The column number.
TOML_PURE_GETTER friend constexpr bool operator==(const source_position &lhs, const source_position &rhs) noexcept
Equality 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
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.
friend std::ostream & operator<<(std::ostream &lhs, const source_position &rhs)
Prints a source_position to a stream.
A source document region.
source_path_ptr path
The path to the corresponding source document.
friend std::ostream & operator<<(std::ostream &lhs, const source_region &rhs)
Prints a source_region to a stream.
source_position end
The end of the region (exclusive).
TOML_NODISCARD optional< std::wstring > wide_path() const
The path to the corresponding source document as a wide-string.
source_position begin
The beginning of the region (inclusive).