16 using source_index = uint32_t;
54 explicit constexpr operator bool() const noexcept
56 return line > source_index{}
57 && column > source_index{};
64 return lhs.line == rhs.line
65 && lhs.column == rhs.column;
81 return static_cast<uint64_t
>(pos.line) << 32 |
static_cast<uint64_t
>(pos.column);
91 return pack(lhs) < pack(rhs);
98 return pack(lhs) <= pack(rhs);
105 return pack(lhs) > pack(rhs);
112 return pack(lhs) >= pack(rhs);
135 impl::print_to_stream(lhs, rhs);
179#if TOML_ENABLE_WINDOWS_COMPAT
191 return { impl::widen(*
path) };
216 impl::print_to_stream(lhs, rhs);
A TOML path.
Definition path.hpp:239
TOML_PURE_INLINE_GETTER bool empty() const noexcept
Whether (true) or not (false) the path is empty.
Definition path.hpp:302
#define TOML_TRIVIAL_ABI
Definition preprocessor.hpp:430
#define TOML_NODISCARD
Definition preprocessor.hpp:439
#define TOML_PURE_GETTER
Definition preprocessor.hpp:474
#define TOML_PURE_INLINE_GETTER
Definition preprocessor.hpp:479
TOML_NAMESPACE_START
Definition source_region.hpp:14
std::shared_ptr< const std::string > source_path_ptr
A pointer to a shared string resource containing a source path.
Definition source_region.hpp:19
TOML_NAMESPACE_END
Definition source_region.hpp:221
A source document line-and-column pair.
Definition source_region.hpp:43
TOML_PURE_GETTER friend constexpr bool operator>=(const source_position &lhs, const source_position &rhs) noexcept
Greater-than-or-equal-to operator.
Definition source_region.hpp:110
TOML_PURE_INLINE_GETTER friend constexpr bool operator!=(const source_position &lhs, const source_position &rhs) noexcept
Inequality operator.
Definition source_region.hpp:70
source_index line
The line number.
Definition source_region.hpp:46
source_index column
The column number.
Definition source_region.hpp:50
TOML_PURE_GETTER friend constexpr bool operator==(const source_position &lhs, const source_position &rhs) noexcept
Equality operator.
Definition source_region.hpp:62
TOML_PURE_GETTER friend constexpr bool operator>(const source_position &lhs, const source_position &rhs) noexcept
Greater-than operator.
Definition source_region.hpp:103
TOML_PURE_GETTER friend constexpr bool operator<(const source_position &lhs, const source_position &rhs) noexcept
Less-than operator.
Definition source_region.hpp:89
TOML_PURE_GETTER friend constexpr bool operator<=(const source_position &lhs, const source_position &rhs) noexcept
Less-than-or-equal-to operator.
Definition source_region.hpp:96
friend std::ostream & operator<<(std::ostream &lhs, const source_position &rhs)
Prints a source_position to a stream.
Definition source_region.hpp:133
A source document region.
Definition source_region.hpp:167
source_path_ptr path
The path to the corresponding source document.
Definition source_region.hpp:177
friend std::ostream & operator<<(std::ostream &lhs, const source_region &rhs)
Prints a source_region to a stream.
Definition source_region.hpp:214
source_position end
The end of the region (exclusive).
Definition source_region.hpp:172
TOML_NODISCARD optional< std::wstring > wide_path() const
The path to the corresponding source document as a wide-string.
Definition source_region.hpp:187
source_position begin
The beginning of the region (inclusive).
Definition source_region.hpp:169