2020-11-15 13:20:10 -06:00
|
|
|
#include "storm/hash/Hashkey.hpp"
|
|
|
|
|
#include "storm/Memory.hpp"
|
|
|
|
|
#include "storm/String.hpp"
|
|
|
|
|
|
|
|
|
|
bool HASHKEY_NONE::operator==(const HASHKEY_NONE& key) {
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
2025-09-02 21:25:37 -05:00
|
|
|
HASHKEY_PTR::HASHKEY_PTR() {
|
|
|
|
|
this->m_key = nullptr;
|
|
|
|
|
}
|
|
|
|
|
|
2025-09-02 20:08:57 -05:00
|
|
|
HASHKEY_PTR::HASHKEY_PTR(void* key) {
|
|
|
|
|
this->m_key = key;
|
|
|
|
|
}
|
|
|
|
|
|
2025-09-03 17:18:13 -05:00
|
|
|
bool HASHKEY_PTR::operator==(const HASHKEY_PTR& key) const {
|
2020-11-15 13:20:10 -06:00
|
|
|
return this->m_key == key.m_key;
|
|
|
|
|
}
|
|
|
|
|
|
2025-09-02 21:25:37 -05:00
|
|
|
HASHKEY_STR::HASHKEY_STR() {
|
|
|
|
|
this->m_str = nullptr;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
HASHKEY_STR::HASHKEY_STR(const char* str) {
|
|
|
|
|
this->m_str = SStrDupA(str, __FILE__, __LINE__);
|
|
|
|
|
}
|
|
|
|
|
|
2020-11-15 13:20:10 -06:00
|
|
|
HASHKEY_STR::~HASHKEY_STR() {
|
|
|
|
|
if (this->m_str) {
|
|
|
|
|
SMemFree(this->m_str, __FILE__, __LINE__, 0x0);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
HASHKEY_STR& HASHKEY_STR::operator=(const char* str) {
|
|
|
|
|
if (this->m_str != str) {
|
|
|
|
|
if (this->m_str) {
|
|
|
|
|
SMemFree(this->m_str, __FILE__, __LINE__, 0x0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
this->m_str = SStrDupA(str, __FILE__, __LINE__);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return *this;
|
|
|
|
|
}
|
|
|
|
|
|
2025-09-03 17:18:13 -05:00
|
|
|
bool HASHKEY_STR::operator==(const char* str) const {
|
2020-11-15 13:20:10 -06:00
|
|
|
return SStrCmp(this->m_str, str, STORM_MAX_STR) == 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
HASHKEY_STRI& HASHKEY_STRI::operator=(const char* str) {
|
|
|
|
|
static_cast<HASHKEY_STR&>(*this) = str;
|
|
|
|
|
return *this;
|
|
|
|
|
}
|
|
|
|
|
|
2025-09-03 17:18:13 -05:00
|
|
|
bool HASHKEY_STRI::operator==(const char* str) const {
|
2020-11-15 13:20:10 -06:00
|
|
|
return SStrCmpI(this->m_str, str, STORM_MAX_STR) == 0;
|
|
|
|
|
}
|