String.h 485 B

12345678910111213141516171819202122232425
  1. #ifndef STRING_H
  2. #define STRING_H
  3. #include "common/utils/Types.h"
  4. class String final {
  5. public:
  6. String();
  7. String(const char* str);
  8. bool operator==(const String& other) const;
  9. bool operator!=(const String& other) const;
  10. operator const char*() const;
  11. String& operator+=(char c);
  12. char operator[](uint index) const;
  13. uint getLength() const;
  14. static constexpr uint MAX_LENGTH = 255;
  15. private:
  16. char data[MAX_LENGTH];
  17. u8 length;
  18. };
  19. #endif