#ifndef DEF_FWIK_STRING_H #define DEF_FWIK_STRING_H #include class String { private: char *ptr; // zero-terminated for internal purposes. int len; public: String(); String(const String& other); String(const char* ptr); String(const char* ptr, int len); String(char c, int count); ~String(); void operator=(const String &string); void operator=(const char* ptr); const char* c_str() const; bool operator==(const String& other) const; bool operator==(const char* other) const; bool operator<(const String& other) const; char &operator[](int pos); char operator[](int pos) const; int size() const { return len; } operator bool() const { return len != 0; } String substr(int start, int count) const; String operator+(const String& other) const; void operator+=(const String& other); void operator+=(char c); static String dec(int i); static String hex(uint32_t v); static String sprintf(const char* format, ...); }; #endif