class
path_componentRepresents a single component of a complete 'TOML-path': either a key or an array index.
Constructors, destructors, conversion operators
- path_component()
- Default constructor (creates an empty key).
- path_component(size_t index) noexcept
- Constructor for a path component that is an array index.
-
path_component(std::
string_view key) - Constructor for a path component that is a key string.
-
path_component(std::
wstring_view key) - Constructor for a path component that is a key string.
-
path_component(const path_
component& pc) - Copy constructor.
-
path_component(path_
component&& pc) noexcept - Move constructor.
- ~path_component() noexcept
- Destructor.
Public functions
-
auto operator=(const path_
component& rhs) → path_ component& - Copy-assignment operator.
-
auto operator=(path_
component&& rhs) → path_ component& noexcept - Move-assignment operator.
-
auto operator=(size_t new_index) → path_
component& noexcept - Assigns an array index to this path component.
-
auto operator=(std::
string_view new_key) → path_ component& - Assigns a path key to this path component.
-
auto operator=(std::
wstring_view new_key) → path_ component& - Assigns a path key to this path component.
-
auto type() const → path_
component_ type noexcept - Retrieve the type of this path component, either path_component::
key or path_component::array_index.
Array index accessors
- auto index() const → size_t noexcept
- Returns the array index (const lvalue overload).
- operator size_t() const explicit noexcept
- Returns the array index (const lvalue).
Equality
-
auto operator!=(const path_
component& lhs, const path_ component& rhs) → bool noexcept - Returns true if two path components do not represent the same key or array index.
-
auto operator==(const path_
component& lhs, const path_ component& rhs) → bool noexcept - Returns true if two path components represent the same key or array index.
Key accessors
-
auto key() const → const std::
string& noexcept - Returns the key string.
- operator const std::string&() const explicit noexcept
- Returns the key string.
Function documentation
toml:: path_component:: path_component(std:: wstring_view key)
Constructor for a path component that is a key string.
path_ component& toml:: path_component:: operator=(std:: wstring_view new_key)
Assigns a path key to this path component.