HashedString.h 480 B

123456789101112131415161718192021222324
  1. #ifndef HASHEDSTRING_H
  2. #define HASHEDSTRING_H
  3. #include "common/utils/Types.h"
  4. class HashedString final {
  5. public:
  6. HashedString();
  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