#include <apibaseid.h>
Id represents an identifier consisting of a c-string. Such identifiers are used mainly to identify entities such as interfaces, components, classes, registries, entries, modules or published objects.
Public Member Functions | |
constexpr | Id () |
Id (const volatile Char *str) | |
template<UInt N> | |
constexpr | Id (const Char(&str)[N]) |
Id (Id &&other) | |
Id (const Id &other) | |
~Id () | |
void | Reset () |
MAXON_OPERATOR_MOVE_ASSIGNMENT (Id) | |
Id & | operator= (const Id &other) |
ResultMem | Init (const Char *str, Bool copyString) |
ResultMem | Init (const Block< const Char > &str) |
ResultMem | Init (const CString &str) |
ResultMem | Init (const String &str) |
void | Init (const InternedId &id) |
![]() | |
constexpr | LiteralId () |
LiteralId (const LiteralId &)=default | |
MAXON_IMPLICIT | LiteralId (const Id &)=delete |
LiteralId & | operator= (const LiteralId &)=default |
LiteralId & | operator= (const Id &)=delete |
template<UInt N> | |
constexpr | LiteralId (const Char(&str)[N]) |
Bool | operator== (const LiteralId &other) const |
Bool | operator< (const LiteralId &other) const |
MAXON_OPERATOR_COMPARISON (LiteralId) | |
COMPARERESULT | Compare (const LiteralId &other) const |
UInt | GetHashCode () const |
Bool | IsEmpty () const |
Bool | IsPopulated () const |
const Char * | GetCString () const |
Int | GetCStringLength () const |
String | ToString (const FormatStatement *formatStatement) const |
CString | ToCString () const |
Block< const Char > | ToBlock () const |
const Id & | Get () const |
operator const Id & () const | |
Bool | UsesRefCountedCString () const |
template<UInt N> | |
constexpr | LiteralId (bool dummy, const Char(&str)[N]) |
constexpr | LiteralId (bool dummy, const LiteralId &src) |
template<typename T , typename = typename T::DeclarationHelper> | |
constexpr | LiteralId (bool dummy, const T &decl) |
Static Public Member Functions | |
static const Id & | NullValue () |
Private Member Functions | |
Id (const CString &)=delete | |
const RefCountedCString * | GetRCString () const |
Additional Inherited Members | |
![]() | |
static const Int | MAX_LENGTH_EXPONENT |
static const UInt | LOW_HASH_MASK |
static const Int | MAX_LENGTH |
![]() | |
constexpr | LiteralId (const Char *value, UInt hash) |
LiteralId (ENUM_DONT_INITIALIZE) | |
![]() | |
static UInt | GetHashCode (const Char *str) |
template<UInt N> | |
static constexpr UInt | GetHashCode (const Char(&str)[N], UInt h=0, UInt i=0) |
![]() | |
const Char * | _value |
UInt | _hash |
![]() | |
static const Int | RC_STRING_BIT |
static const UInt | RC_STRING_MASK |
static const UInt | HASH_MASK |
~Id | ( | ) |
Destructs the Id. If the Id uses a RefCountedCString, the reference will be removed.
|
static |
void Reset | ( | void | ) |
Resets the Id. Afterwards, its internal c-string will be nullptr.
MAXON_OPERATOR_MOVE_ASSIGNMENT | ( | Id | ) |
Sets this Id to a new value. If copyString is false, str is used directly for the internal c-string pointer, and it is assumed that the c-string exists at least as long as this Id. Otherwise, if copyString is true, a RefCountedCString is created for str and used for the internal c-string.
[in] | str | Identifier as c-string, may be nullptr. |
[in] | copyString | If true, a copy of str is made at first (as a RefCountedCString). |
Sets this Id to str. A RefCountedCString is created for str and used for the internal c-string.
[in] | str | Identifier as a block of characters (no null termination required). |
Sets this Id to str. A RefCountedCString is created for str and used for the internal c-string.
[in] | str | Identifier as CString. |
void Init | ( | const InternedId & | id | ) |
|
private |