| 44 | class TestMemoryAllocator; |
| 45 | |
| 46 | class SimpleString |
| 47 | { |
| 48 | friend bool operator==(const SimpleString& left, const SimpleString& right); |
| 49 | friend bool operator!=(const SimpleString& left, const SimpleString& right); |
| 50 | |
| 51 | public: |
| 52 | SimpleString(const char *value = ""); |
| 53 | SimpleString(const char *value, size_t repeatCount); |
| 54 | SimpleString(const SimpleString& other); |
| 55 | ~SimpleString(); |
| 56 | |
| 57 | SimpleString& operator=(const SimpleString& other); |
| 58 | SimpleString operator+(const SimpleString&) const; |
| 59 | SimpleString& operator+=(const SimpleString&); |
| 60 | SimpleString& operator+=(const char*); |
| 61 | |
| 62 | static const size_t npos = (size_t) -1; |
| 63 | |
| 64 | char at(size_t pos) const; |
| 65 | size_t find(char ch) const; |
| 66 | size_t findFrom(size_t starting_position, char ch) const; |
| 67 | bool contains(const SimpleString& other) const; |
| 68 | bool containsNoCase(const SimpleString& other) const; |
| 69 | bool startsWith(const SimpleString& other) const; |
| 70 | bool endsWith(const SimpleString& other) const; |
| 71 | void split(const SimpleString& split, |
| 72 | SimpleStringCollection& outCollection) const; |
| 73 | bool equalsNoCase(const SimpleString& str) const; |
| 74 | |
| 75 | size_t count(const SimpleString& str) const; |
| 76 | |
| 77 | void replace(char to, char with); |
| 78 | void replace(const char* to, const char* with); |
| 79 | |
| 80 | SimpleString lowerCase() const; |
| 81 | SimpleString subString(size_t beginPos) const; |
| 82 | SimpleString subString(size_t beginPos, size_t amount) const; |
| 83 | SimpleString subStringFromTill(char startChar, char lastExcludedChar) const; |
| 84 | void copyToBuffer(char* buffer, size_t bufferSize) const; |
| 85 | |
| 86 | const char *asCharString() const; |
| 87 | size_t size() const; |
| 88 | bool isEmpty() const; |
| 89 | |
| 90 | static void padStringsToSameLength(SimpleString& str1, SimpleString& str2, char ch); |
| 91 | |
| 92 | static TestMemoryAllocator* getStringAllocator(); |
| 93 | static void setStringAllocator(TestMemoryAllocator* allocator); |
| 94 | |
| 95 | static int AtoI(const char*str); |
| 96 | static unsigned AtoU(const char*str); |
| 97 | static int StrCmp(const char* s1, const char* s2); |
| 98 | static size_t StrLen(const char*); |
| 99 | static int StrNCmp(const char* s1, const char* s2, size_t n); |
| 100 | static char* StrNCpy(char* s1, const char* s2, size_t n); |
| 101 | static const char* StrStr(const char* s1, const char* s2); |
| 102 | static char ToLower(char ch); |
| 103 | static int MemCmp(const void* s1, const void *s2, size_t n); |
no outgoing calls