4#ifndef LODESTONE_NAMESPACEDSTRING_H
5#define LODESTONE_NAMESPACEDSTRING_H
20 constexpr Identifier(
const char *_namespace,
const char *path) noexcept
43 constexpr operator std::string() const noexcept {
47 constexpr friend std::ostream &
60struct std::formatter<
lodestone::common::registry::Identifier>
62 std::format_context::iterator
64 format_context &c)
const {
65 return formatter<string>::format(s.
getString(), c);
70struct std::hash<
lodestone::common::registry::Identifier> {
73 return std::hash<std::string_view>{}(s.getPath()) ^
74 (std::hash<std::string_view>{}(s.getNamespace()) << 1);
Definition Identifier.h:14
constexpr std::string_view getPathView() const noexcept
Definition Identifier.h:25
constexpr std::string getString() const noexcept
Definition Identifier.h:31
constexpr Identifier(const char *name) noexcept
Definition Identifier.h:16
const char * m_namespace
Definition Identifier.h:54
constexpr friend std::ostream & operator<<(std::ostream &os, const Identifier &s) noexcept
Definition Identifier.h:48
constexpr const char * getNamespace() const noexcept
Definition Identifier.h:27
constexpr const char * getPath() const noexcept
Definition Identifier.h:23
constexpr std::string_view getNamespaceView() const noexcept
Definition Identifier.h:29
const char * m_path
Definition Identifier.h:55
constexpr bool operator==(const Identifier &rhs) const noexcept
Definition Identifier.h:37
constexpr std::string toString() const override
Definition Identifier.h:35
constexpr Identifier(const char *_namespace, const char *path) noexcept
Definition Identifier.h:20
Java toString clone.
Definition StringSerializable.h:13
static constexpr bool strcmpConstexpr(const char *lhs, const char *rhs)
Definition Util.h:15
Definition Identifiable.h:8
size_t operator()(const lodestone::common::registry::Identifier &s) const noexcept
Definition Identifier.h:71