3 #include <opals/fwd.hpp>
10 struct random_access_iterator_tag;
41 template<
bool Const,
bool Forward>
49 using value_type = char;
50 using pointer =
char*;
51 using reference =
char&;
52 using const_reference =
char const&;
53 using size_type = std::size_t;
54 using difference_type = std::ptrdiff_t;
56 static const size_type& npos();
61 String(
const String& other, size_type pos = 0, size_type n = npos());
63 String(
const char* s, size_type n);
64 String(size_type n,
char c);
75 String& operator=(
const char* other);
78 String& assign(
const String& s, size_type pos, size_type n);
79 String& assign(
const char* s, size_type n);
80 String& assign(
const char* s);
81 String& assign(size_type n,
char c);
111 reference at(size_type n);
112 const_reference at(size_type n)
const;
113 reference operator[](size_type n);
114 const_reference operator[](size_type n)
const;
116 const_reference front()
const;
118 const_reference back()
const;
119 const char* c_str()
const;
120 const char* data()
const;
125 size_type size()
const;
126 size_type length()
const;
127 size_type max_size()
const;
128 size_type capacity()
const;
131 void resize(size_type n,
char c =
char());
137 String& append(
const String& s, size_type pos, size_type n);
138 String& append(
const char* s);
139 String& append(
const char* s, size_type n);
140 String& append(size_type n,
char c);
146 void push_back(
char c);
149 String& operator+=(
const char* s);
150 String& operator+=(
char c);
156 void insert(
iterator pos, size_type n,
const char& s);
158 String& insert(size_type pos,
const String& s, size_type pos1, size_type n);
159 String& insert(size_type pos,
const char* s);
160 String& insert(size_type pos,
const char* s, size_type n);
161 String& insert(size_type pos, size_type n,
char c);
172 String& erase(size_type pos = 0, size_type n = npos());
177 String& replace(size_type pos, size_type n,
const String& s);
178 String& replace(size_type pos, size_type n,
const String& s, size_type pos1, size_type n1);
179 String& replace(size_type pos, size_type n,
const char* s, size_type n1);
180 String& replace(size_type pos, size_type n,
const char* s);
181 String& replace(size_type pos, size_type n, size_type n1,
char c);
195 size_type find(
const String& s, size_type pos = 0)
const;
196 size_type find(
const char* s, size_type pos, size_type n)
const;
197 size_type find(
const char* s, size_type pos = 0)
const;
198 size_type find(
char c, size_type pos = 0)
const;
199 size_type rfind(
const String& s, size_type pos = npos())
const;
200 size_type rfind(
const char* s, size_type pos, size_type n)
const;
201 size_type rfind(
const char* s, size_type pos = npos())
const;
202 size_type rfind(
char c, size_type pos = npos())
const;
203 size_type find_first_of(
const String& s, size_type pos = 0)
const;
204 size_type find_first_of(
const char* s, size_type pos, size_type n)
const;
205 size_type find_first_of(
const char* s, size_type pos = 0)
const;
206 size_type find_first_of(
char c, size_type pos = 0)
const;
207 size_type find_first_not_of(
const String& s, size_type pos = 0)
const;
208 size_type find_first_not_of(
const char* s, size_type pos, size_type n)
const;
209 size_type find_first_not_of(
const char* s, size_type pos = 0)
const;
210 size_type find_first_not_of(
char c, size_type pos = 0)
const;
211 size_type find_last_of(
const String& s, size_type pos = npos())
const;
212 size_type find_last_of(
const char* s, size_type pos, size_type n)
const;
213 size_type find_last_of(
const char* s, size_type pos = npos())
const;
214 size_type find_last_of(
char c, size_type pos = npos())
const;
215 size_type find_last_not_of(
const String& s, size_type pos = npos())
const;
216 size_type find_last_not_of(
const char* s, size_type pos, size_type n)
const;
217 size_type find_last_not_of(
const char* s, size_type pos = npos())
const;
218 size_type find_last_not_of(
char c, size_type pos = npos())
const;
223 String substr(size_type pos = 0, size_type n = npos())
const;
228 size_type copy(
char* buf, size_type n, size_type pos = 0)
const;
233 int compare(
const String& s)
const;
234 int compare(size_type pos, size_type n,
const String& s)
const;
235 int compare(size_type pos, size_type n,
const String& s, size_type pos1, size_type n1)
const;
236 int compare(
const char* s)
const;
237 int compare(size_type pos, size_type n,
const char* s, size_type len = npos())
const;
250 template<
bool Const,
bool Forward>
253 using Char =
typename std::conditional<Const, const char, char>::type;
258 using iterator_category = std::random_access_iterator_tag;
259 using value_type = char;
260 using difference_type = String::difference_type;
261 using reference = Char&;
262 using pointer = Char*;
270 reference operator* ()
const;
271 pointer operator->()
const;
276 Iterator& operator+=(difference_type offset);
277 Iterator operator+ (difference_type offset)
const;
278 Iterator& operator-=(difference_type offset);
279 Iterator operator- (difference_type offset)
const;
282 reference operator[](difference_type offset)
const;
303 OPALS_API
String operator+(
const char* s1,
const String& s2);
305 OPALS_API
String operator+(
const String& s1,
const char* s2);
312 OPALS_API
bool operator==(
const String& s1,
const String& s2);
314 OPALS_API
bool operator==(
const char* s1,
const String& s2);
316 OPALS_API
bool operator==(
const String& s1,
const char* s2);
319 OPALS_API
bool operator!=(
const String& s1,
const String& s2);
321 OPALS_API
bool operator!=(
const char* s1,
const String& s2);
323 OPALS_API
bool operator!=(
const String& s1,
const char* s2);
326 OPALS_API
bool operator<(
const String& s1,
const String& s2);
328 OPALS_API
bool operator<(
const char* s1,
const String& s2);
330 OPALS_API
bool operator<(
const String& s1,
const char* s2);