String.h 538 B

123456789101112131415161718192021222324252627
  1. #ifndef STRING_H
  2. #define STRING_H
  3. #include "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. char operator[](uint index) const;
  12. uint getLength() const;
  13. String& append(char c);
  14. String& append(const char* str);
  15. String& append(int i);
  16. private:
  17. static constexpr uint MAX_LENGTH = 255;
  18. char data[MAX_LENGTH];
  19. u8 length;
  20. };
  21. #endif