12345678910111213141516171819202122232425262728 |
- #ifndef HASHEDSTRING_H
- #define HASHEDSTRING_H
- #include "common/utils/Types.h"
- class HashedString final {
- public:
- HashedString();
- HashedString(const char* str);
- bool operator==(const HashedString& other) const;
- bool operator!=(const HashedString& other) const;
- operator const char*() const;
- u32 hashCode() const;
- struct Hasher final {
- u32 operator()(const HashedString& key) const;
- };
- private:
- static constexpr uint LENGTH = 32 - sizeof (u8) - sizeof (u32);
- char data[LENGTH];
- u8 length;
- u32 hash;
- };
- #endif
|