Lodestone.Common
Loading...
Searching...
No Matches
lodestone::common::registry::Identifier Class Reference

#include <Identifier.h>

Inheritance diagram for lodestone::common::registry::Identifier:
Collaboration diagram for lodestone::common::registry::Identifier:

Public Member Functions

constexpr Identifier (const char *_namespace, const char *path) noexcept
constexpr const char * getPath () const noexcept
constexpr std::string_view getPathView () const noexcept
constexpr const char * getNamespace () const noexcept
constexpr std::string_view getNamespaceView () const noexcept
constexpr std::string getString () const noexcept
constexpr std::string toString () const override
constexpr bool operator== (const Identifier &rhs) const noexcept
constexpr operator std::string () const noexcept
Public Member Functions inherited from lodestone::common::string::StringSerializable
constexpr StringSerializable ()=default
virtual constexpr ~StringSerializable ()=default

Protected Member Functions

constexpr Identifier (const char *name) noexcept

Private Attributes

const char * m_namespace
const char * m_path

Friends

constexpr friend std::ostream & operator<< (std::ostream &os, const Identifier &s) noexcept

Constructor & Destructor Documentation

◆ Identifier() [1/2]

lodestone::common::registry::Identifier::Identifier ( const char * name)
inlineexplicitconstexprprotectednoexcept
17 : m_namespace("lodestone"), m_path(name) {};
const char * m_namespace
Definition Identifier.h:54
const char * m_path
Definition Identifier.h:55

◆ Identifier() [2/2]

lodestone::common::registry::Identifier::Identifier ( const char * _namespace,
const char * path )
inlineconstexprnoexcept
21 : m_namespace(_namespace), m_path(path) {};

Member Function Documentation

◆ getNamespace()

const char * lodestone::common::registry::Identifier::getNamespace ( ) const
inlineconstexprnoexcept
27{ return m_namespace; }

◆ getNamespaceView()

std::string_view lodestone::common::registry::Identifier::getNamespaceView ( ) const
inlineconstexprnoexcept
29{ return m_namespace; }

◆ getPath()

const char * lodestone::common::registry::Identifier::getPath ( ) const
inlineconstexprnoexcept
23{ return m_path; }

◆ getPathView()

std::string_view lodestone::common::registry::Identifier::getPathView ( ) const
inlineconstexprnoexcept
25{ return m_path; }

◆ getString()

std::string lodestone::common::registry::Identifier::getString ( ) const
inlineconstexprnoexcept
31 {
32 return std::string(m_namespace) + ":" + m_path;
33 }

◆ operator std::string()

lodestone::common::registry::Identifier::operator std::string ( ) const
inlineconstexprnoexcept
43 {
44 return getString();
45 }
constexpr std::string getString() const noexcept
Definition Identifier.h:31

◆ operator==()

bool lodestone::common::registry::Identifier::operator== ( const Identifier & rhs) const
inlineconstexprnoexcept
37 {
38 return util::Util::strcmpConstexpr(this->m_path, rhs.m_path) &&
40 rhs.m_namespace);
41 }
static constexpr bool strcmpConstexpr(const char *lhs, const char *rhs)
Definition Util.h:15

◆ toString()

std::string lodestone::common::registry::Identifier::toString ( ) const
inlineconstexproverridevirtual

◆ operator<<

friend std::ostream & operator<< ( std::ostream & os,
const Identifier & s )
friend
48 {
49 os << s.getString();
50 return os;
51 }

Member Data Documentation

◆ m_namespace

const char* lodestone::common::registry::Identifier::m_namespace
private

◆ m_path

const char* lodestone::common::registry::Identifier::m_path
private

The documentation for this class was generated from the following file: