String.h 567 B

12345678910111213141516171819202122232425262728
  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. String& append(float f);
  17. private:
  18. static constexpr uint MAX_LENGTH = 255;
  19. char data[MAX_LENGTH];
  20. u8 length;
  21. };
  22. #endif