HashedString.h 488 B

12345678910111213141516171819202122232425
  1. #ifndef HASHEDSTRING_H
  2. #define HASHEDSTRING_H
  3. #include <unordered_map>
  4. #include "common/utils/Types.h"
  5. class HashedString {
  6. public:
  7. HashedString(const char* str);
  8. bool operator==(const HashedString& other) const;
  9. bool operator!=(const HashedString& other) const;
  10. operator const char*() const;
  11. u32 hashCode() const;
  12. private:
  13. static constexpr uint LENGTH = 32 - sizeof (u8) - sizeof (u32);
  14. char data[LENGTH];
  15. u8 length;
  16. u32 hash;
  17. };
  18. #endif