34 #include "safe_refcount.h" 54 STRING_TABLE_LEN=1<<STRING_TABLE_BITS,
55 STRING_TABLE_MASK=STRING_TABLE_LEN-1
63 String get_name()
const {
return cname?
String(cname):name; }
68 _Data() { cname=NULL; next=prev=NULL; hash=0; }
72 static _Data *_table[STRING_TABLE_LEN];
83 friend void register_core_types();
84 friend void unregister_core_types();
87 static void cleanup();
88 static bool configured;
94 operator const void*()
const {
return (_data && (_data->cname || !_data->name.empty()))?(
void*)1:0; }
96 bool operator==(
const String& p_name)
const;
97 bool operator==(
const char* p_name)
const;
98 bool operator!=(
const String& p_name)
const;
99 _FORCE_INLINE_
bool operator<(
const StringName& p_name)
const {
101 return _data<p_name._data;
103 _FORCE_INLINE_
bool operator==(
const StringName& p_name)
const {
106 return _data==p_name._data;
108 _FORCE_INLINE_ uint32_t hash()
const {
115 bool operator!=(
const StringName& p_name)
const;
117 _FORCE_INLINE_
operator String()
const {
121 return String(_data->cname);
130 static StringName search(
const CharType *p_name);
152 static _FORCE_INLINE_ uint32_t hash(
const StringName &p_string) {
return p_string.hash(); }
158 #define _SCS(m_cstr) _scs_create(m_cstr) Definition: string_db.h:150
Definition: string_db.h:133
Definition: safe_refcount.h:336
Definition: string_db.h:48
Definition: string_db.h:40