38 key()
noexcept =
default;
43 : key_{
k}, source_{std::move(src)} {}
48 : key_{
k}, source_{src} {}
53 : key_{std::move(
k)}, source_{std::move(src)} {}
58 : key_{std::move(
k)}, source_{src} {}
63 : key_{
k}, source_{std::move(src)} {}
68 : key_{
k}, source_{src} {}
70#if TOML_ENABLE_WINDOWS_COMPAT
78 : key_{impl::narrow(
k)}, source_{std::move(src)} {}
86 : key_{impl::narrow(
k)}, source_{src} {}
95 std::string_view
str()
const noexcept {
return std::string_view{key_}; }
99 operator std::string_view()
const noexcept {
return str(); }
103 bool empty()
const noexcept {
return key_.empty(); }
107 const char*
data()
const noexcept {
return key_.data(); }
111 size_t length()
const noexcept {
return key_.length(); }
120 const source_region& source()
const noexcept {
return source_; }
143 friend bool operator<=(
const key&
lhs,
const key&
rhs)
noexcept {
return lhs.key_ <=
rhs.key_; }
151 friend bool operator>=(
const key&
lhs,
const key&
rhs)
noexcept {
return lhs.key_ >=
rhs.key_; }
171 friend bool operator<=(
const key&
lhs, std::string_view
rhs)
noexcept {
181 friend bool operator>=(
const key&
lhs, std::string_view
rhs)
noexcept {
203 friend bool operator<=(std::string_view
lhs,
const key&
rhs)
noexcept {
213 friend bool operator>=(std::string_view
lhs,
const key&
rhs)
noexcept {
223 using const_iterator =
const char*;
226 using iterator = const_iterator;
230 const_iterator begin()
const noexcept {
return key_.data(); }
234 const_iterator
end()
const noexcept {
return key_.data() + key_.length(); }
240 impl::print_to_stream(
lhs,
rhs.key_);
246 template <
typename T>
247 inline constexpr bool is_key = std::is_same_v<impl::remove_cvref<T>, toml::key>;
251 template <
typename T>
254 || impl::is_constructible_or_convertible<toml::key, T>;
std::basic_ostream< Char > & operator<<(std::basic_ostream< Char > &lhs, node_type rhs)
Pretty-prints the value of a node_type to a stream.
bool operator>(const DistancePair &lhs, const DistancePair &rhs)
bool operator==(const json_pointer< RefStringTypeLhs > &lhs, const json_pointer< RefStringTypeRhs > &rhs) noexcept
bool operator!=(const json_pointer< RefStringTypeLhs > &lhs, const json_pointer< RefStringTypeRhs > &rhs) noexcept
bool operator<(const json_pointer< RefStringTypeLhs > &lhs, const json_pointer< RefStringTypeRhs > &rhs) noexcept
constexpr bool is_key
Metafunction for determining if a type is, or is a reference to, a toml::key.
constexpr bool is_key_or_convertible
Metafunction for determining if a type is, or is a reference to, a toml::key, or is implicitly or exp...
#define TOML_NODISCARD_CTOR
#define TOML_PURE_INLINE_GETTER
A source document region.