NeBuild dev
|
Represents a single component of a complete 'TOML-path': either a key or an array index. More...
#include <path.hpp>
Public Member Functions | |
TOML_NODISCARD_CTOR TOML_EXPORTED_MEMBER_FUNCTION | path_component () |
Default constructor (creates an empty key). | |
TOML_NODISCARD_CTOR TOML_EXPORTED_MEMBER_FUNCTION | path_component (size_t index) noexcept |
Constructor for a path component that is an array index. | |
TOML_NODISCARD_CTOR TOML_EXPORTED_MEMBER_FUNCTION | path_component (std::string_view key) |
Constructor for a path component that is a key string. | |
TOML_NODISCARD_CTOR TOML_EXPORTED_MEMBER_FUNCTION | path_component (std::wstring_view key) |
Constructor for a path component that is a key string. | |
TOML_NODISCARD_CTOR TOML_EXPORTED_MEMBER_FUNCTION | path_component (const path_component &pc) |
Copy constructor. | |
TOML_NODISCARD_CTOR TOML_EXPORTED_MEMBER_FUNCTION | path_component (path_component &&pc) noexcept |
Move constructor. | |
TOML_EXPORTED_MEMBER_FUNCTION path_component & | operator= (const path_component &rhs) |
Copy-assignment operator. | |
TOML_EXPORTED_MEMBER_FUNCTION path_component & | operator= (path_component &&rhs) noexcept |
Move-assignment operator. | |
TOML_EXPORTED_MEMBER_FUNCTION path_component & | operator= (size_t new_index) noexcept |
Assigns an array index to this path component. | |
TOML_EXPORTED_MEMBER_FUNCTION path_component & | operator= (std::string_view new_key) |
Assigns a path key to this path component. | |
TOML_EXPORTED_MEMBER_FUNCTION path_component & | operator= (std::wstring_view new_key) |
Assigns a path key to this path component. | |
~path_component () noexcept | |
Destructor. | |
TOML_PURE_INLINE_GETTER path_component_type | type () const noexcept |
Retrieve the type of this path component, either path_component::key or path_component::array_index. | |
Array index accessors | |
| |
TOML_PURE_GETTER size_t | index () const noexcept |
Returns the array index (const lvalue overload). | |
TOML_PURE_INLINE_GETTER | operator size_t () const noexcept |
Returns the array index (const lvalue). | |
Key accessors | |
| |
TOML_PURE_GETTER const std::string & | key () const noexcept |
Returns the key string. | |
TOML_PURE_INLINE_GETTER | operator const std::string & () const noexcept |
Returns the key string. | |
Friends | |
Equality | |
TOML_PURE_INLINE_GETTER friend bool | operator== (const path_component &lhs, const path_component &rhs) noexcept |
Returns true if two path components represent the same key or array index. | |
TOML_PURE_INLINE_GETTER friend bool | operator!= (const path_component &lhs, const path_component &rhs) noexcept |
Returns true if two path components do not represent the same key or array index. | |
Represents a single component of a complete 'TOML-path': either a key or an array index.
TOML_NODISCARD_CTOR TOML_EXPORTED_MEMBER_FUNCTION path_component::path_component | ( | ) |
Default constructor (creates an empty key).
|
noexcept |
Constructor for a path component that is an array index.
TOML_NODISCARD_CTOR TOML_EXPORTED_MEMBER_FUNCTION path_component::path_component | ( | std::string_view | key | ) |
Constructor for a path component that is a key string.
TOML_NODISCARD_CTOR TOML_EXPORTED_MEMBER_FUNCTION path_component::path_component | ( | std::wstring_view | key | ) |
Constructor for a path component that is a key string.
\availability This constructor is only available when TOML_ENABLE_WINDOWS_COMPAT is enabled.
TOML_NODISCARD_CTOR TOML_EXPORTED_MEMBER_FUNCTION path_component::path_component | ( | const path_component & | pc | ) |
Copy constructor.
|
noexcept |
Move constructor.
|
inlinenoexcept |
Destructor.
|
inlinenoexcept |
Returns the array index (const lvalue overload).
|
inlinenoexcept |
Returns the key string.
|
inlineexplicitnoexcept |
Returns the key string.
|
inlineexplicitnoexcept |
Returns the array index (const lvalue).
TOML_EXPORTED_MEMBER_FUNCTION path_component & path_component::operator= | ( | const path_component & | rhs | ) |
Copy-assignment operator.
|
noexcept |
Move-assignment operator.
|
noexcept |
Assigns an array index to this path component.
TOML_EXPORTED_MEMBER_FUNCTION path_component & path_component::operator= | ( | std::string_view | new_key | ) |
Assigns a path key to this path component.
TOML_EXPORTED_MEMBER_FUNCTION path_component & path_component::operator= | ( | std::wstring_view | new_key | ) |
Assigns a path key to this path component.
\availability This overload is only available when TOML_ENABLE_WINDOWS_COMPAT is enabled.
|
inlinenoexcept |
Retrieve the type of this path component, either path_component::key or path_component::array_index.
|
friend |
Returns true if two path components do not represent the same key or array index.
|
friend |
Returns true if two path components represent the same key or array index.