mirror of
https://github.com/thunderbrewhq/squall.git
synced 2026-04-30 05:03:51 +00:00
feat: sync with Whoa implementation
This commit is contained in:
parent
12ab8f7721
commit
6928bf3f0c
46 changed files with 2980 additions and 441 deletions
|
|
@ -7,20 +7,45 @@ bool HASHKEY_NONE::operator==(const HASHKEY_NONE& key) {
|
|||
return true;
|
||||
}
|
||||
|
||||
bool HASHKEY_PTR::operator==(const HASHKEY_PTR& key) {
|
||||
HASHKEY_PTR::HASHKEY_PTR() {
|
||||
this->m_key = nullptr;
|
||||
}
|
||||
|
||||
HASHKEY_PTR::HASHKEY_PTR(void* key) {
|
||||
this->m_key = key;
|
||||
}
|
||||
|
||||
HASHKEY_PTR& HASHKEY_PTR::operator=(const HASHKEY_PTR& key) {
|
||||
this->m_key = key.m_key;
|
||||
return *this;
|
||||
}
|
||||
|
||||
bool HASHKEY_PTR::operator==(const HASHKEY_PTR& key) const {
|
||||
return this->m_key == key.m_key;
|
||||
}
|
||||
|
||||
void* HASHKEY_PTR::GetPtr() const {
|
||||
return this->m_key;
|
||||
}
|
||||
|
||||
HASHKEY_STR::HASHKEY_STR() {
|
||||
this->m_str = nullptr;
|
||||
}
|
||||
|
||||
HASHKEY_STR::HASHKEY_STR(const char* str) {
|
||||
this->m_str = SStrDupA(str, __FILE__, __LINE__);
|
||||
}
|
||||
|
||||
HASHKEY_STR::~HASHKEY_STR() {
|
||||
if (this->m_str) {
|
||||
SMemFree(this->m_str, __FILE__, __LINE__, 0x0);
|
||||
STORM_FREE(this->m_str);
|
||||
}
|
||||
}
|
||||
|
||||
HASHKEY_STR& HASHKEY_STR::operator=(const char* str) {
|
||||
if (this->m_str != str) {
|
||||
if (this->m_str) {
|
||||
SMemFree(this->m_str, __FILE__, __LINE__, 0x0);
|
||||
STORM_FREE(this->m_str);
|
||||
}
|
||||
|
||||
this->m_str = SStrDupA(str, __FILE__, __LINE__);
|
||||
|
|
@ -29,15 +54,91 @@ HASHKEY_STR& HASHKEY_STR::operator=(const char* str) {
|
|||
return *this;
|
||||
}
|
||||
|
||||
bool HASHKEY_STR::operator==(const char* str) {
|
||||
return SStrCmp(this->m_str, str, STORM_MAX_STR) == 0;
|
||||
HASHKEY_STR& HASHKEY_STR::operator=(const HASHKEY_STR& key) {
|
||||
this->operator=(key.m_str);
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
bool HASHKEY_STR::operator==(const char* str) const {
|
||||
return SStrCmp(this->m_str, str) == 0;
|
||||
}
|
||||
|
||||
bool HASHKEY_STR::operator==(const HASHKEY_STR& key) const {
|
||||
return this->operator==(key.m_str);
|
||||
}
|
||||
|
||||
const char* HASHKEY_STR::GetString() const {
|
||||
return this->m_str;
|
||||
}
|
||||
|
||||
HASHKEY_STRI& HASHKEY_STRI::operator=(const char* str) {
|
||||
static_cast<HASHKEY_STR&>(*this) = str;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
bool HASHKEY_STRI::operator==(const char* str) {
|
||||
return SStrCmpI(this->m_str, str, STORM_MAX_STR) == 0;
|
||||
HASHKEY_STRI& HASHKEY_STRI::operator=(const HASHKEY_STRI& key) {
|
||||
static_cast<HASHKEY_STR&>(*this) = key.m_str;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
bool HASHKEY_STRI::operator==(const char* str) const {
|
||||
return SStrCmpI(this->m_str, str) == 0;
|
||||
}
|
||||
|
||||
bool HASHKEY_STRI::operator==(const HASHKEY_STRI& key) const {
|
||||
return this->operator==(key.m_str);
|
||||
}
|
||||
|
||||
HASHKEY_CONSTSTR::HASHKEY_CONSTSTR() {
|
||||
this->m_str = nullptr;
|
||||
}
|
||||
|
||||
HASHKEY_CONSTSTR::HASHKEY_CONSTSTR(const char* str) {
|
||||
this->m_str = str;
|
||||
}
|
||||
|
||||
HASHKEY_CONSTSTR::~HASHKEY_CONSTSTR() {
|
||||
}
|
||||
|
||||
HASHKEY_CONSTSTR& HASHKEY_CONSTSTR::operator=(const char* str) {
|
||||
this->m_str = str;
|
||||
return *this;
|
||||
}
|
||||
|
||||
HASHKEY_CONSTSTR& HASHKEY_CONSTSTR::operator=(const HASHKEY_CONSTSTR& key) {
|
||||
this->operator=(key.m_str);
|
||||
return *this;
|
||||
}
|
||||
|
||||
bool HASHKEY_CONSTSTR::operator==(const char* str) const {
|
||||
return this->m_str == str || SStrCmp(this->m_str, str) == 0;
|
||||
}
|
||||
|
||||
bool HASHKEY_CONSTSTR::operator==(const HASHKEY_CONSTSTR& key) const {
|
||||
return this->operator==(key.m_str);
|
||||
}
|
||||
|
||||
const char* HASHKEY_CONSTSTR::GetString() const {
|
||||
return this->m_str;
|
||||
}
|
||||
|
||||
HASHKEY_CONSTSTRI& HASHKEY_CONSTSTRI::operator=(const char* str) {
|
||||
static_cast<HASHKEY_CONSTSTR&>(*this) = str;
|
||||
return *this;
|
||||
}
|
||||
|
||||
HASHKEY_CONSTSTRI& HASHKEY_CONSTSTRI::operator=(const HASHKEY_CONSTSTRI& key) {
|
||||
static_cast<HASHKEY_CONSTSTR&>(*this) = key.m_str;
|
||||
return *this;
|
||||
}
|
||||
|
||||
bool HASHKEY_CONSTSTRI::operator==(const char* str) const {
|
||||
return this->m_str == str || SStrCmpI(this->m_str, str) == 0;
|
||||
}
|
||||
|
||||
bool HASHKEY_CONSTSTRI::operator==(const HASHKEY_CONSTSTRI& key) const {
|
||||
return this->operator==(key.m_str);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue