Class endstone::Identifier¶
ClassList > endstone > Identifier
Represents a identifier consisting of two components: a namespace and a key.
#include <endstone/identifier.h>
Public Static Attributes¶
| Type | Name |
|---|---|
| constexpr std::string_view | Minecraft = "minecraft"The namespace representing all inbuilt keys. |
Public Functions¶
| Type | Name |
|---|---|
| constexpr | Identifier (const char * s) noexcept Constructs an identifier by parsing a string. |
| constexpr | Identifier (const std::string & s) noexcept Constructs an identifier by parsing a string. |
| constexpr | Identifier (const std::string_view & identifier) noexcept Constructs an identifier by parsing a string. |
| constexpr | Identifier (const std::string_view & namespace_, const std::string_view & key) noexcept Constructs an identifier from a separate namespace and key. |
| constexpr std::string_view | getKey () noexcept const Gets the key component of this identifier. |
| constexpr std::string_view | getNamespace () noexcept const Gets the namespace component of this identifier. |
| string () const |
|
| constexpr bool | operator!= (const Identifier & other) noexcept const |
| constexpr bool | operator== (const Identifier & other) noexcept const |
Public Static Functions¶
| Type | Name |
|---|---|
| constexpr Identifier | minecraft (const std::string_view key) noexcept Creates an identifier in the minecraft namespace with the given key. |
Public Static Attributes Documentation¶
variable Minecraft¶
The namespace representing all inbuilt keys.
Public Functions Documentation¶
function Identifier [¼]¶
Constructs an identifier by parsing a string.
See the string_view overload for the parsing rules.
Parameters:
sThe identifier string.
function Identifier [2/4]¶
Constructs an identifier by parsing a string.
See the string_view overload for the parsing rules.
Parameters:
sThe identifier string.
function Identifier [¾]¶
Constructs an identifier by parsing a string.
If the string contains a colon, the part before the last colon is taken as the namespace and the remainder as the key. Otherwise the whole string is the key and the namespace defaults to minecraft.
Parameters:
identifierThe identifier string.
function Identifier [4/4]¶
Constructs an identifier from a separate namespace and key.
inline constexpr endstone::Identifier::Identifier (
const std::string_view & namespace_,
const std::string_view & key
) noexcept
Parameters:
namespace_The namespace component.keyThe key component.
function getKey¶
Gets the key component of this identifier.
Returns:
the key
function getNamespace¶
Gets the namespace component of this identifier.
Returns:
the namespace
function string¶
function operator!=¶
function operator==¶
Public Static Functions Documentation¶
function minecraft¶
Creates an identifier in the minecraft namespace with the given key.
static inline constexpr Identifier endstone::Identifier::minecraft (
const std::string_view key
) noexcept
Parameters:
keyThe key component.
Returns:
an identifier with the namespace set to minecraft.
The documentation for this class was generated from the following file include/endstone/identifier.h