Skip to content

Class endstone::Identifier

template <typename T>

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.

constexpr std::string_view endstone::Identifier< T >::Minecraft;


Public Functions Documentation

function Identifier [¼]

Constructs an identifier by parsing a string.

inline constexpr endstone::Identifier::Identifier (
    const  char * s
) noexcept

See the string_view overload for the parsing rules.

Parameters:

  • s The identifier string.

function Identifier [2/4]

Constructs an identifier by parsing a string.

inline constexpr endstone::Identifier::Identifier (
    const std::string & s
) noexcept

See the string_view overload for the parsing rules.

Parameters:

  • s The identifier string.

function Identifier [¾]

Constructs an identifier by parsing a string.

inline constexpr endstone::Identifier::Identifier (
    const std::string_view & identifier
) noexcept

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:

  • identifier The 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.
  • key The key component.

function getKey

Gets the key component of this identifier.

inline constexpr std::string_view endstone::Identifier::getKey () noexcept const

Returns:

the key


function getNamespace

Gets the namespace component of this identifier.

inline constexpr std::string_view endstone::Identifier::getNamespace () noexcept const

Returns:

the namespace


function string

inline endstone::Identifier::string () const

function operator!=

inline constexpr  bool endstone::Identifier::operator!= (
    const  Identifier & other
) noexcept const

function operator==

inline constexpr  bool endstone::Identifier::operator== (
    const  Identifier & other
) noexcept const

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:

  • key The 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