123456789101112131415161718192021222324252627282930 |
- #ifndef STRING_H
- #define STRING_H
- #include <cstddef>
- class String final {
- public:
- String();
- String(const char* str);
- String& operator+=(const char* str);
- String& operator+=(char c);
- String& operator+=(char32_t c);
- String& operator+=(unsigned int i);
- String& operator+=(double d);
- String operator+(const char* str) const;
- operator const char*() const;
- size_t getLength() const;
- bool isFull() const;
- bool operator==(const String& other) const;
- bool operator!=(const String& other) const;
- bool operator==(const char* other) const;
- bool operator!=(const char* other) const;
-
- private:
- static constexpr size_t capacity = 4096;
- size_t usedCapacity;
- char data[capacity];
- };
- #endif
|