mirror of https://github.com/zeldaret/botw.git
ksys/util: Add StrTreeMapKey(const SafeString&) for convenience
This commit is contained in:
parent
cb1b70bb03
commit
cdf27ca63c
|
@ -10,12 +10,12 @@ class StrTreeMapKey {
|
|||
public:
|
||||
StrTreeMapKey() = default;
|
||||
StrTreeMapKey(u32 key_hash, const sead::SafeString& key) : mKeyHash(key_hash), mKey(key) {}
|
||||
explicit StrTreeMapKey(const sead::SafeString& key)
|
||||
: StrTreeMapKey(sead::HashCRC32::calcStringHash(key.cstr()), key) {}
|
||||
|
||||
const sead::SafeString& key() const { return mKey; }
|
||||
|
||||
void setKey(const sead::SafeString& key) {
|
||||
*this = {sead::HashCRC32::calcStringHash(key.cstr()), key};
|
||||
}
|
||||
void setKey(const sead::SafeString& key) { *this = StrTreeMapKey{key}; }
|
||||
|
||||
s32 compare(const StrTreeMapKey& rhs) const {
|
||||
if (mKeyHash < rhs.mKeyHash)
|
||||
|
|
Loading…
Reference in New Issue