26#ifndef TGUI_STRING_HPP
27#define TGUI_STRING_HPP
29#include <TGUI/Config.hpp>
30#include <TGUI/Utf.hpp>
37#include <SFML/System/String.hpp>
64 TGUI_API
int strToInt(
const std::string& str,
int defaultValue = 0);
73 TGUI_API
unsigned int strToUInt(
const std::string& str,
unsigned int defaultValue = 0);
82 TGUI_API
float strToFloat(
const std::string& str,
float defaultValue = 0);
88 TGUI_API std::string
toLower(
const std::string& str);
94 TGUI_API std::string
toUpper(
const std::string& str);
100 TGUI_API std::string
trim(
const std::string& str);
121 std::u32string m_string;
125 static const decltype(std::u32string::npos) npos;
127 using iterator = std::u32string::iterator;
128 using const_iterator = std::u32string::const_iterator;
129 using reverse_iterator = std::u32string::reverse_iterator;
130 using const_reverse_iterator = std::u32string::const_reverse_iterator;
132 using value_type = char32_t;
133 using reference = char32_t&;
134 using const_reference =
const char32_t&;
146 int toInt(
int defaultValue = 0)
const;
156 unsigned int toUInt(
unsigned int defaultValue = 0)
const;
201 String& replace(const String& searchFor, const String& replaceWith);
211 template <
typename T>
214 std::ostringstream oss;
215 oss.imbue(std::locale::classic());
226 String(
const std::string& str);
227 String(
const std::wstring& str);
228 String(
const std::u16string& str);
229 String(
const std::u32string& str);
231 String(std::u32string&& str)
232 : m_string{std::move(str)}
236 String(
char ansiChar);
237 String(
wchar_t wideChar);
238 String(char16_t utfChar);
239 String(char32_t utfChar);
241 String(
const char* str);
242 String(
const wchar_t* str);
243 String(
const char16_t* str);
244 String(
const char32_t* str);
246 String(std::size_t count,
char ch);
247 String(std::size_t count,
wchar_t ch);
248 String(std::size_t count, char16_t ch);
249 String(std::size_t count, char32_t ch);
251 String(
const std::string& str, std::size_t pos);
252 String(
const std::wstring& str, std::size_t pos);
253 String(
const std::u16string& str, std::size_t pos);
254 String(
const std::u32string& str, std::size_t pos);
256 String(
const std::string& str, std::size_t pos, std::size_t count);
257 String(
const std::wstring& str, std::size_t pos, std::size_t count);
258 String(
const std::u16string& str, std::size_t pos, std::size_t count);
259 String(
const std::u32string& str, std::size_t pos, std::size_t count);
261 String(
const char* str, std::size_t count);
262 String(
const wchar_t* str, std::size_t count);
263 String(
const char16_t* str, std::size_t count);
264 String(
const char32_t* str, std::size_t count);
266 String(std::initializer_list<char> chars);
267 String(std::initializer_list<wchar_t> chars);
268 String(std::initializer_list<char16_t> chars);
269 String(std::initializer_list<char32_t> chars);
271 String(std::string::const_iterator first, std::string::const_iterator last);
272 String(std::wstring::const_iterator first, std::wstring::const_iterator last);
273 String(std::u16string::const_iterator first, std::u16string::const_iterator last);
274 String(std::u32string::const_iterator first, std::u32string::const_iterator last);
277 explicit String(
const sf::String& str)
278 : m_string{reinterpret_cast<const char32_t*>(str.toUtf32().c_str())}
282 explicit operator sf::String()
const
284 return sf::String::fromUtf32(m_string.begin(), m_string.end());
287 explicit operator std::string()
const;
288 explicit operator std::wstring()
const;
289 explicit operator std::u16string()
const;
290 explicit operator const std::u32string&()
const
295 std::string toAnsiString()
const;
296 std::wstring toWideString()
const;
297 std::u16string toUtf16()
const;
298 const std::u32string& toUtf32()
const;
300 String& assign(std::size_t count,
char ch);
301 String& assign(std::size_t count,
wchar_t ch);
302 String& assign(std::size_t count, char16_t ch);
303 String& assign(std::size_t count, char32_t ch);
305 String& assign(
const std::string& str);
306 String& assign(
const std::wstring& str);
307 String& assign(
const std::u16string& str);
308 String& assign(
const std::u32string& str);
309 String& assign(
const String& str);
311 String& assign(
const std::string& str, std::size_t pos, std::size_t count = npos);
312 String& assign(
const std::wstring& str, std::size_t pos, std::size_t count = npos);
313 String& assign(
const std::u16string& str, std::size_t pos, std::size_t count = npos);
314 String& assign(
const std::u32string& str, std::size_t pos, std::size_t count = npos);
315 String& assign(
const String& str, std::size_t pos, std::size_t count = npos);
317 String& assign(std::string&& str);
318 String& assign(std::wstring&& str);
319 String& assign(std::u16string&& str);
320 String& assign(std::u32string&& str);
321 String& assign(String&& str);
323 String& assign(
const char* str, std::size_t count);
324 String& assign(
const wchar_t* str, std::size_t count);
325 String& assign(
const char16_t* str, std::size_t count);
326 String& assign(
const char32_t* str, std::size_t count);
328 String& assign(
const char* str);
329 String& assign(
const wchar_t* str);
330 String& assign(
const char16_t* str);
331 String& assign(
const char32_t* str);
333 String& assign(std::initializer_list<char> chars);
334 String& assign(std::initializer_list<wchar_t> chars);
335 String& assign(std::initializer_list<char16_t> chars);
336 String& assign(std::initializer_list<char32_t> chars);
338 String& assign(std::string::const_iterator first, std::string::const_iterator last);
339 String& assign(std::wstring::const_iterator first, std::wstring::const_iterator last);
340 String& assign(std::u16string::const_iterator first, std::u16string::const_iterator last);
341 String& assign(std::u32string::const_iterator first, std::u32string::const_iterator last);
343 reference at(std::size_t pos);
344 const_reference at(std::size_t pos)
const;
346 const_reference operator [](std::size_t index)
const;
347 reference operator [](std::size_t index);
350 const_reference front()
const;
353 const_reference back()
const;
355 const char32_t* data() const noexcept;
356#if __cplusplus >= 201703L
357 char32_t* data() noexcept
359 return m_string.data();
362 const char32_t* c_str() const noexcept;
364 iterator begin() noexcept;
365 const_iterator begin() const noexcept;
366 const_iterator cbegin() const noexcept;
368 iterator end() noexcept;
369 const_iterator end() const noexcept;
370 const_iterator cend() const noexcept;
372 reverse_iterator rbegin() noexcept;
373 const_reverse_iterator rbegin() const noexcept;
374 const_reverse_iterator crbegin() const noexcept;
376 reverse_iterator rend() noexcept;
377 const_reverse_iterator rend() const noexcept;
378 const_reverse_iterator crend() const noexcept;
380 bool empty() const noexcept;
381 std::
size_t size() const noexcept;
382 std::
size_t length() const noexcept;
383 std::
size_t max_size() const noexcept;
385 void reserve(std::
size_t newCap);
386 std::
size_t capacity() const noexcept;
387 void shrink_to_fit();
389 void clear() noexcept;
391 String& insert(std::size_t index, std::size_t count,
char ch);
392 String& insert(std::size_t index, std::size_t count,
wchar_t ch);
393 String& insert(std::size_t index, std::size_t count, char16_t ch);
394 String& insert(std::size_t index, std::size_t count, char32_t ch);
396 String& insert(std::size_t index,
const std::string& str);
397 String& insert(std::size_t index,
const std::wstring& str);
398 String& insert(std::size_t index,
const std::u16string& str);
399 String& insert(std::size_t index,
const std::u32string& str);
400 String& insert(std::size_t index,
const String& str);
402 String& insert(std::size_t index,
const std::string& str, std::size_t pos, std::size_t count = npos);
403 String& insert(std::size_t index,
const std::wstring& str, std::size_t pos, std::size_t count = npos);
404 String& insert(std::size_t index,
const std::u16string& str, std::size_t pos, std::size_t count = npos);
405 String& insert(std::size_t index,
const std::u32string& str, std::size_t pos, std::size_t count = npos);
406 String& insert(std::size_t index,
const String& str, std::size_t pos, std::size_t count = npos);
408 String& insert(std::size_t index,
const char* str, std::size_t count);
409 String& insert(std::size_t index,
const wchar_t* str, std::size_t count);
410 String& insert(std::size_t index,
const char16_t* str, std::size_t count);
411 String& insert(std::size_t index,
const char32_t* str, std::size_t count);
413 String& insert(std::size_t index,
const char* str);
414 String& insert(std::size_t index,
const wchar_t* str);
415 String& insert(std::size_t index,
const char16_t* str);
416 String& insert(std::size_t index,
const char32_t* str);
418 iterator insert(const_iterator pos,
char ch);
419 iterator insert(const_iterator pos,
wchar_t ch);
420 iterator insert(const_iterator pos, char16_t ch);
421 iterator insert(const_iterator pos, char32_t ch);
423 iterator insert(const_iterator pos, std::size_t count,
char ch);
424 iterator insert(const_iterator pos, std::size_t count,
wchar_t ch);
425 iterator insert(const_iterator pos, std::size_t count, char16_t ch);
426 iterator insert(const_iterator pos, std::size_t count, char32_t ch);
428 iterator insert(const_iterator pos, std::initializer_list<char> chars);
429 iterator insert(const_iterator pos, std::initializer_list<wchar_t> chars);
430 iterator insert(const_iterator pos, std::initializer_list<char16_t> chars);
431 iterator insert(const_iterator pos, std::initializer_list<char32_t> chars);
433 iterator insert(const_iterator pos, std::string::const_iterator first, std::string::const_iterator last);
434 iterator insert(const_iterator pos, std::wstring::const_iterator first, std::wstring::const_iterator last);
435 iterator insert(const_iterator pos, std::u16string::const_iterator first, std::u16string::const_iterator last);
436 iterator insert(const_iterator pos, std::u32string::const_iterator first, std::u32string::const_iterator last);
438 String& erase(std::size_t index = 0, std::size_t count = npos);
440 iterator erase(const_iterator position);
441 iterator erase(const_iterator first, const_iterator last);
443 void push_back(
char ch);
444 void push_back(
wchar_t ch);
445 void push_back(char16_t ch);
446 void push_back(char32_t ch);
450 String& append(std::size_t count,
char ch);
451 String& append(std::size_t count,
wchar_t ch);
452 String& append(std::size_t count, char16_t ch);
453 String& append(std::size_t count, char32_t ch);
455 String& append(
const std::string& str);
456 String& append(
const std::wstring& str);
457 String& append(
const std::u16string& str);
458 String& append(
const std::u32string& str);
459 String& append(
const String& str);
461 String& append(
const std::string& str, std::size_t pos, std::size_t count = npos);
462 String& append(
const std::wstring& str, std::size_t pos, std::size_t count = npos);
463 String& append(
const std::u16string& str, std::size_t pos, std::size_t count = npos);
464 String& append(
const std::u32string& str, std::size_t pos, std::size_t count = npos);
465 String& append(
const String& str, std::size_t pos, std::size_t count = npos);
467 String& append(
const char* str, std::size_t count);
468 String& append(
const wchar_t* str, std::size_t count);
469 String& append(
const char16_t* str, std::size_t count);
470 String& append(
const char32_t* str, std::size_t count);
472 String& append(
const char* str);
473 String& append(
const wchar_t* str);
474 String& append(
const char16_t* str);
475 String& append(
const char32_t* str);
477 String& append(std::string::const_iterator first, std::string::const_iterator last);
478 String& append(std::wstring::const_iterator first, std::wstring::const_iterator last);
479 String& append(std::u16string::const_iterator first, std::u16string::const_iterator last);
480 String& append(std::u32string::const_iterator first, std::u32string::const_iterator last);
482 String& append(std::initializer_list<char> chars);
483 String& append(std::initializer_list<wchar_t> chars);
484 String& append(std::initializer_list<char16_t> chars);
485 String& append(std::initializer_list<char32_t> chars);
489 int compare(
const std::string& str)
const noexcept;
490 int compare(
const std::wstring& str)
const noexcept;
491 int compare(
const std::u16string& str)
const noexcept;
492 int compare(
const std::u32string& str)
const noexcept;
493 int compare(
const String& str)
const noexcept;
495 int compare(std::size_t pos1, std::size_t count1,
const std::string& str)
const;
496 int compare(std::size_t pos1, std::size_t count1,
const std::wstring& str)
const;
497 int compare(std::size_t pos1, std::size_t count1,
const std::u16string& str)
const;
498 int compare(std::size_t pos1, std::size_t count1,
const std::u32string& str)
const;
499 int compare(std::size_t pos1, std::size_t count1,
const String& str)
const;
501 int compare(std::size_t pos1, std::size_t count1,
const std::string& str, std::size_t pos2, std::size_t count2 = npos)
const;
502 int compare(std::size_t pos1, std::size_t count1,
const std::wstring& str, std::size_t pos2, std::size_t count2 = npos)
const;
503 int compare(std::size_t pos1, std::size_t count1,
const std::u16string& str, std::size_t pos2, std::size_t count2 = npos)
const;
504 int compare(std::size_t pos1, std::size_t count1,
const std::u32string& str, std::size_t pos2, std::size_t count2 = npos)
const;
505 int compare(std::size_t pos1, std::size_t count1,
const String& str, std::size_t pos2, std::size_t count2 = npos)
const;
507 int compare(
const char* s)
const;
508 int compare(
const wchar_t* s)
const;
509 int compare(
const char16_t* s)
const;
510 int compare(
const char32_t* s)
const;
512 int compare(std::size_t pos1, std::size_t count1,
const char* s)
const;
513 int compare(std::size_t pos1, std::size_t count1,
const wchar_t* s)
const;
514 int compare(std::size_t pos1, std::size_t count1,
const char16_t* s)
const;
515 int compare(std::size_t pos1, std::size_t count1,
const char32_t* s)
const;
517 int compare(std::size_t pos1, std::size_t count1,
const char* s, std::size_t count2)
const;
518 int compare(std::size_t pos1, std::size_t count1,
const wchar_t* s, std::size_t count2)
const;
519 int compare(std::size_t pos1, std::size_t count1,
const char16_t* s, std::size_t count2)
const;
520 int compare(std::size_t pos1, std::size_t count1,
const char32_t* s, std::size_t count2)
const;
522 String& replace(std::size_t pos, std::size_t count,
const std::string& str);
523 String& replace(std::size_t pos, std::size_t count,
const std::wstring& str);
524 String& replace(std::size_t pos, std::size_t count,
const std::u16string& str);
525 String& replace(std::size_t pos, std::size_t count,
const std::u32string& str);
526 String& replace(std::size_t pos, std::size_t count,
const String& str);
528 String& replace(const_iterator first, const_iterator last,
const std::string& str);
529 String& replace(const_iterator first, const_iterator last,
const std::wstring& str);
530 String& replace(const_iterator first, const_iterator last,
const std::u16string& str);
531 String& replace(const_iterator first, const_iterator last,
const std::u32string& str);
532 String& replace(const_iterator first, const_iterator last,
const String& str);
534 String& replace(std::size_t pos, std::size_t count,
const std::string& str, std::size_t pos2, std::size_t count2 = npos);
535 String& replace(std::size_t pos, std::size_t count,
const std::wstring& str, std::size_t pos2, std::size_t count2 = npos);
536 String& replace(std::size_t pos, std::size_t count,
const std::u16string& str, std::size_t pos2, std::size_t count2 = npos);
537 String& replace(std::size_t pos, std::size_t count,
const std::u32string& str, std::size_t pos2, std::size_t count2 = npos);
538 String& replace(std::size_t pos, std::size_t count,
const String& str, std::size_t pos2, std::size_t count2 = npos);
540 String& replace(const_iterator first, const_iterator last, std::string::const_iterator first2, std::string::const_iterator last2);
541 String& replace(const_iterator first, const_iterator last, std::wstring::const_iterator first2, std::wstring::const_iterator last2);
542 String& replace(const_iterator first, const_iterator last, std::u16string::const_iterator first2, std::u16string::const_iterator last2);
543 String& replace(const_iterator first, const_iterator last, std::u32string::const_iterator first2, std::u32string::const_iterator last2);
545 String& replace(std::size_t pos, std::size_t count,
const char* cstr, std::size_t count2);
546 String& replace(std::size_t pos, std::size_t count,
const wchar_t* cstr, std::size_t count2);
547 String& replace(std::size_t pos, std::size_t count,
const char16_t* cstr, std::size_t count2);
548 String& replace(std::size_t pos, std::size_t count,
const char32_t* cstr, std::size_t count2);
550 String& replace(const_iterator first, const_iterator last,
const char* cstr, std::size_t count2);
551 String& replace(const_iterator first, const_iterator last,
const wchar_t* cstr, std::size_t count2);
552 String& replace(const_iterator first, const_iterator last,
const char16_t* cstr, std::size_t count2);
553 String& replace(const_iterator first, const_iterator last,
const char32_t* cstr, std::size_t count2);
555 String& replace(std::size_t pos, std::size_t count,
const char* cstr);
556 String& replace(std::size_t pos, std::size_t count,
const wchar_t* cstr);
557 String& replace(std::size_t pos, std::size_t count,
const char16_t* cstr);
558 String& replace(std::size_t pos, std::size_t count,
const char32_t* cstr);
560 String& replace(const_iterator first, const_iterator last,
const char* cstr);
561 String& replace(const_iterator first, const_iterator last,
const wchar_t* cstr);
562 String& replace(const_iterator first, const_iterator last,
const char16_t* cstr);
563 String& replace(const_iterator first, const_iterator last,
const char32_t* cstr);
565 String& replace(std::size_t pos, std::size_t count, std::size_t count2,
char ch);
566 String& replace(std::size_t pos, std::size_t count, std::size_t count2,
wchar_t ch);
567 String& replace(std::size_t pos, std::size_t count, std::size_t count2, char16_t ch);
568 String& replace(std::size_t pos, std::size_t count, std::size_t count2, char32_t ch);
570 String& replace(const_iterator first, const_iterator last, std::size_t count2,
char ch);
571 String& replace(const_iterator first, const_iterator last, std::size_t count2,
wchar_t ch);
572 String& replace(const_iterator first, const_iterator last, std::size_t count2, char16_t ch);
573 String& replace(const_iterator first, const_iterator last, std::size_t count2, char32_t ch);
575 String& replace(const_iterator first, const_iterator last, std::initializer_list<char> chars);
576 String& replace(const_iterator first, const_iterator last, std::initializer_list<wchar_t> chars);
577 String& replace(const_iterator first, const_iterator last, std::initializer_list<char16_t> chars);
578 String& replace(const_iterator first, const_iterator last, std::initializer_list<char32_t> chars);
580 String substr(std::size_t pos = 0, std::size_t count = npos)
const;
582 std::size_t copy(char32_t* dest, std::size_t count, std::size_t pos = 0)
const;
584 void resize(std::size_t count);
585 void resize(std::size_t count,
char ch);
586 void resize(std::size_t count,
wchar_t ch);
587 void resize(std::size_t count, char16_t ch);
588 void resize(std::size_t count, char32_t ch);
590 void swap(String& other);
592 std::size_t find(
const std::string& str, std::size_t pos = 0) const noexcept;
593 std::
size_t find(const std::wstring& str, std::
size_t pos = 0) const noexcept;
594 std::
size_t find(const std::u16string& str, std::
size_t pos = 0) const noexcept;
595 std::
size_t find(const std::u32string& str, std::
size_t pos = 0) const noexcept;
596 std::
size_t find(const String& str, std::
size_t pos = 0) const noexcept;
598 std::
size_t find(const
char* s, std::
size_t pos, std::
size_t count) const;
599 std::
size_t find(const
wchar_t* s, std::
size_t pos, std::
size_t count) const;
600 std::
size_t find(const char16_t* s, std::
size_t pos, std::
size_t count) const;
601 std::
size_t find(const char32_t* s, std::
size_t pos, std::
size_t count) const;
603 std::
size_t find(const
char* s, std::
size_t pos = 0) const;
604 std::
size_t find(const
wchar_t* s, std::
size_t pos = 0) const;
605 std::
size_t find(const char16_t* s, std::
size_t pos = 0) const;
606 std::
size_t find(const char32_t* s, std::
size_t pos = 0) const;
608 std::
size_t find(
char ch, std::
size_t pos = 0) const noexcept;
609 std::
size_t find(
wchar_t ch, std::
size_t pos = 0) const noexcept;
610 std::
size_t find(char16_t ch, std::
size_t pos = 0) const noexcept;
611 std::
size_t find(char32_t ch, std::
size_t pos = 0) const noexcept;
613 std::
size_t find_first_of(const std::
string& str, std::
size_t pos = 0) const noexcept;
614 std::
size_t find_first_of(const std::wstring& str, std::
size_t pos = 0) const noexcept;
615 std::
size_t find_first_of(const std::u16string& str, std::
size_t pos = 0) const noexcept;
616 std::
size_t find_first_of(const std::u32string& str, std::
size_t pos = 0) const noexcept;
617 std::
size_t find_first_of(const String& str, std::
size_t pos = 0) const noexcept;
619 std::
size_t find_first_of(const
char* s, std::
size_t pos, std::
size_t count) const;
620 std::
size_t find_first_of(const
wchar_t* s, std::
size_t pos, std::
size_t count) const;
621 std::
size_t find_first_of(const char16_t* s, std::
size_t pos, std::
size_t count) const;
622 std::
size_t find_first_of(const char32_t* s, std::
size_t pos, std::
size_t count) const;
624 std::
size_t find_first_of(const
char* s, std::
size_t pos = 0) const;
625 std::
size_t find_first_of(const
wchar_t* s, std::
size_t pos = 0) const;
626 std::
size_t find_first_of(const char16_t* s, std::
size_t pos = 0) const;
627 std::
size_t find_first_of(const char32_t* s, std::
size_t pos = 0) const;
629 std::
size_t find_first_of(
char ch, std::
size_t pos = 0) const noexcept;
630 std::
size_t find_first_of(
wchar_t ch, std::
size_t pos = 0) const noexcept;
631 std::
size_t find_first_of(char16_t ch, std::
size_t pos = 0) const noexcept;
632 std::
size_t find_first_of(char32_t ch, std::
size_t pos = 0) const noexcept;
634 std::
size_t find_first_not_of(const std::
string& str, std::
size_t pos = 0) const noexcept;
635 std::
size_t find_first_not_of(const std::wstring& str, std::
size_t pos = 0) const noexcept;
636 std::
size_t find_first_not_of(const std::u16string& str, std::
size_t pos = 0) const noexcept;
637 std::
size_t find_first_not_of(const std::u32string& str, std::
size_t pos = 0) const noexcept;
638 std::
size_t find_first_not_of(const String& str, std::
size_t pos = 0) const noexcept;
640 std::
size_t find_first_not_of(const
char* s, std::
size_t pos, std::
size_t count) const;
641 std::
size_t find_first_not_of(const
wchar_t* s, std::
size_t pos, std::
size_t count) const;
642 std::
size_t find_first_not_of(const char16_t* s, std::
size_t pos, std::
size_t count) const;
643 std::
size_t find_first_not_of(const char32_t* s, std::
size_t pos, std::
size_t count) const;
645 std::
size_t find_first_not_of(const
char* s, std::
size_t pos = 0) const;
646 std::
size_t find_first_not_of(const
wchar_t* s, std::
size_t pos = 0) const;
647 std::
size_t find_first_not_of(const char16_t* s, std::
size_t pos = 0) const;
648 std::
size_t find_first_not_of(const char32_t* s, std::
size_t pos = 0) const;
650 std::
size_t find_first_not_of(
char ch, std::
size_t pos = 0) const noexcept;
651 std::
size_t find_first_not_of(
wchar_t ch, std::
size_t pos = 0) const noexcept;
652 std::
size_t find_first_not_of(char16_t ch, std::
size_t pos = 0) const noexcept;
653 std::
size_t find_first_not_of(char32_t ch, std::
size_t pos = 0) const noexcept;
655 std::
size_t rfind(const std::
string& str, std::
size_t pos = npos) const noexcept;
656 std::
size_t rfind(const std::wstring& str, std::
size_t pos = npos) const noexcept;
657 std::
size_t rfind(const std::u16string& str, std::
size_t pos = npos) const noexcept;
658 std::
size_t rfind(const std::u32string& str, std::
size_t pos = npos) const noexcept;
659 std::
size_t rfind(const String& str, std::
size_t pos = npos) const noexcept;
661 std::
size_t rfind(const
char* s, std::
size_t pos, std::
size_t count) const;
662 std::
size_t rfind(const
wchar_t* s, std::
size_t pos, std::
size_t count) const;
663 std::
size_t rfind(const char16_t* s, std::
size_t pos, std::
size_t count) const;
664 std::
size_t rfind(const char32_t* s, std::
size_t pos, std::
size_t count) const;
666 std::
size_t rfind(const
char* s, std::
size_t pos = npos) const;
667 std::
size_t rfind(const
wchar_t* s, std::
size_t pos = npos) const;
668 std::
size_t rfind(const char16_t* s, std::
size_t pos = npos) const;
669 std::
size_t rfind(const char32_t* s, std::
size_t pos = npos) const;
671 std::
size_t rfind(
char ch, std::
size_t pos = npos) const noexcept;
672 std::
size_t rfind(
wchar_t ch, std::
size_t pos = npos) const noexcept;
673 std::
size_t rfind(char16_t ch, std::
size_t pos = npos) const noexcept;
674 std::
size_t rfind(char32_t ch, std::
size_t pos = npos) const noexcept;
676 std::
size_t find_last_of(const std::
string& str, std::
size_t pos = npos) const noexcept;
677 std::
size_t find_last_of(const std::wstring& str, std::
size_t pos = npos) const noexcept;
678 std::
size_t find_last_of(const std::u16string& str, std::
size_t pos = npos) const noexcept;
679 std::
size_t find_last_of(const std::u32string& str, std::
size_t pos = npos) const noexcept;
680 std::
size_t find_last_of(const String& str, std::
size_t pos = npos) const noexcept;
682 std::
size_t find_last_of(const
char* s, std::
size_t pos, std::
size_t count) const;
683 std::
size_t find_last_of(const
wchar_t* s, std::
size_t pos, std::
size_t count) const;
684 std::
size_t find_last_of(const char16_t* s, std::
size_t pos, std::
size_t count) const;
685 std::
size_t find_last_of(const char32_t* s, std::
size_t pos, std::
size_t count) const;
687 std::
size_t find_last_of(const
char* s, std::
size_t pos = npos) const;
688 std::
size_t find_last_of(const
wchar_t* s, std::
size_t pos = npos) const;
689 std::
size_t find_last_of(const char16_t* s, std::
size_t pos = npos) const;
690 std::
size_t find_last_of(const char32_t* s, std::
size_t pos = npos) const;
692 std::
size_t find_last_of(
char ch, std::
size_t pos = npos) const noexcept;
693 std::
size_t find_last_of(
wchar_t ch, std::
size_t pos = npos) const noexcept;
694 std::
size_t find_last_of(char16_t ch, std::
size_t pos = npos) const noexcept;
695 std::
size_t find_last_of(char32_t ch, std::
size_t pos = npos) const noexcept;
697 std::
size_t find_last_not_of(const std::
string& str, std::
size_t pos = npos) const noexcept;
698 std::
size_t find_last_not_of(const std::wstring& str, std::
size_t pos = npos) const noexcept;
699 std::
size_t find_last_not_of(const std::u16string& str, std::
size_t pos = npos) const noexcept;
700 std::
size_t find_last_not_of(const std::u32string& str, std::
size_t pos = npos) const noexcept;
701 std::
size_t find_last_not_of(const String& str, std::
size_t pos = npos) const noexcept;
703 std::
size_t find_last_not_of(const
char* s, std::
size_t pos, std::
size_t count) const;
704 std::
size_t find_last_not_of(const
wchar_t* s, std::
size_t pos, std::
size_t count) const;
705 std::
size_t find_last_not_of(const char16_t* s, std::
size_t pos, std::
size_t count) const;
706 std::
size_t find_last_not_of(const char32_t* s, std::
size_t pos, std::
size_t count) const;
708 std::
size_t find_last_not_of(const
char* s, std::
size_t pos = npos) const;
709 std::
size_t find_last_not_of(const
wchar_t* s, std::
size_t pos = npos) const;
710 std::
size_t find_last_not_of(const char16_t* s, std::
size_t pos = npos) const;
711 std::
size_t find_last_not_of(const char32_t* s, std::
size_t pos = npos) const;
713 std::
size_t find_last_not_of(
char ch, std::
size_t pos = npos) const noexcept;
714 std::
size_t find_last_not_of(
wchar_t ch, std::
size_t pos = npos) const noexcept;
715 std::
size_t find_last_not_of(char16_t ch, std::
size_t pos = npos) const noexcept;
716 std::
size_t find_last_not_of(char32_t ch, std::
size_t pos = npos) const noexcept;
718 friend
bool operator==(const String& left, const String& right);
719 friend
bool operator!=(const String& left, const String& right);
720 friend
bool operator<(const String& left, const String& right);
721 friend
bool operator<=(const String& left, const String& right);
722 friend
bool operator>(const String& left, const String& right);
723 friend
bool operator>=(const String& left, const String& right);
724 friend String operator+(const String& left, const String& right);
725 friend String operator+(const String& left, String&& right);
726 friend String operator+(String&& left, const String& right);
727 friend String operator+(String&& left, String&& right);
729#if defined(__cpp_lib_char8_t) && (__cpp_lib_char8_t >= 201811L)
730 String(
const std::u8string& str);
731 String(char8_t utfChar);
732 String(
const char8_t* str);
733 String(std::size_t count, char8_t ch);
734 String(
const std::u8string& str, std::size_t pos);
735 String(
const std::u8string& str, std::size_t pos, std::size_t count);
736 String(
const char8_t* str, std::size_t count);
737 String(std::initializer_list<char8_t> chars);
738 String(std::u8string::const_iterator first, std::u8string::const_iterator last);
740 explicit operator std::u8string()
const;
742 std::u8string toUtf8()
const;
744 String& assign(std::size_t count, char8_t ch);
745 String& assign(
const std::u8string& str);
746 String& assign(
const std::u8string& str, std::size_t pos, std::size_t count = npos);
747 String& assign(std::u8string&& str);
748 String& assign(
const char8_t* str, std::size_t count);
749 String& assign(
const char8_t* str);
750 String& assign(std::initializer_list<char8_t> chars);
751 String& assign(std::u8string::const_iterator first, std::u8string::const_iterator last);
753 String& insert(std::size_t index, std::size_t count, char8_t ch);
754 String& insert(std::size_t index,
const std::u8string& str);
755 String& insert(std::size_t index,
const std::u8string& str, std::size_t pos, std::size_t count = npos);
756 String& insert(std::size_t index,
const char8_t* str, std::size_t count);
757 String& insert(std::size_t index,
const char8_t* str);
758 iterator insert(const_iterator pos, char8_t ch);
759 iterator insert(const_iterator pos, std::size_t count, char8_t ch);
760 iterator insert(const_iterator pos, std::initializer_list<char8_t> chars);
761 iterator insert(const_iterator pos, std::u8string::const_iterator first, std::u8string::const_iterator last);
763 String& append(std::size_t count, char8_t ch);
764 String& append(
const std::u8string& str);
765 String& append(
const std::u8string& str, std::size_t pos, std::size_t count = npos);
766 String& append(
const char8_t* str, std::size_t count);
767 String& append(
const char8_t* str);
768 String& append(std::initializer_list<char8_t> chars);
769 String& append(std::u8string::const_iterator first, std::u8string::const_iterator last);
771 int compare(
const std::u8string& str)
const noexcept;
772 int compare(std::size_t pos1, std::size_t count1,
const std::u8string& str)
const;
773 int compare(std::size_t pos1, std::size_t count1,
const std::u8string& str, std::size_t pos2, std::size_t count2 = npos)
const;
774 int compare(
const char8_t* s)
const;
775 int compare(std::size_t pos1, std::size_t count1,
const char8_t* s)
const;
776 int compare(std::size_t pos1, std::size_t count1,
const char8_t* s, std::size_t count2)
const;
778 String& replace(std::size_t pos, std::size_t count,
const std::u8string& str);
779 String& replace(const_iterator first, const_iterator last,
const std::u8string& str);
780 String& replace(std::size_t pos, std::size_t count,
const std::u8string& str, std::size_t pos2, std::size_t count2 = npos);
781 String& replace(const_iterator first, const_iterator last, std::u8string::const_iterator first2, std::u8string::const_iterator last2);
782 String& replace(std::size_t pos, std::size_t count,
const char8_t* cstr, std::size_t count2);
783 String& replace(const_iterator first, const_iterator last,
const char8_t* cstr, std::size_t count2);
784 String& replace(std::size_t pos, std::size_t count,
const char8_t* cstr);
785 String& replace(const_iterator first, const_iterator last,
const char8_t* cstr);
786 String& replace(std::size_t pos, std::size_t count, std::size_t count2, char8_t ch);
787 String& replace(const_iterator first, const_iterator last, std::size_t count2, char8_t ch);
788 String& replace(const_iterator first, const_iterator last, std::initializer_list<char8_t> chars);
790 void resize(std::size_t count, char8_t ch);
792 std::size_t find(
const std::u8string& str, std::size_t pos = 0) const noexcept;
793 std::
size_t find(const char8_t* s, std::
size_t pos, std::
size_t count) const;
794 std::
size_t find(const char8_t* s, std::
size_t pos = 0) const;
795 std::
size_t find(char8_t ch, std::
size_t pos = 0) const noexcept;
797 std::
size_t find_first_of(const std::u8string& str, std::
size_t pos = 0) const noexcept;
798 std::
size_t find_first_of(const char8_t* s, std::
size_t pos, std::
size_t count) const;
799 std::
size_t find_first_of(const char8_t* s, std::
size_t pos = 0) const;
800 std::
size_t find_first_of(char8_t ch, std::
size_t pos = 0) const noexcept;
802 std::
size_t find_first_not_of(const std::u8string& str, std::
size_t pos = 0) const noexcept;
803 std::
size_t find_first_not_of(const char8_t* s, std::
size_t pos, std::
size_t count) const;
804 std::
size_t find_first_not_of(const char8_t* s, std::
size_t pos = 0) const;
805 std::
size_t find_first_not_of(char8_t ch, std::
size_t pos = 0) const noexcept;
807 std::
size_t rfind(const std::u8string& str, std::
size_t pos = npos) const noexcept;
808 std::
size_t rfind(const char8_t* s, std::
size_t pos, std::
size_t count) const;
809 std::
size_t rfind(const char8_t* s, std::
size_t pos = npos) const;
810 std::
size_t rfind(char8_t ch, std::
size_t pos = npos) const noexcept;
812 std::
size_t find_last_of(const std::u8string& str, std::
size_t pos = npos) const noexcept;
813 std::
size_t find_last_of(const char8_t* s, std::
size_t pos, std::
size_t count) const;
814 std::
size_t find_last_of(const char8_t* s, std::
size_t pos = npos) const;
815 std::
size_t find_last_of(char8_t ch, std::
size_t pos = npos) const noexcept;
817 std::
size_t find_last_not_of(const std::u8string& str, std::
size_t pos = npos) const noexcept;
818 std::
size_t find_last_not_of(const char8_t* s, std::
size_t pos, std::
size_t count) const;
819 std::
size_t find_last_not_of(const char8_t* s, std::
size_t pos = npos) const;
820 std::
size_t find_last_not_of(char8_t ch, std::
size_t pos = npos) const noexcept;
822 friend std::basic_ostream<char8_t>& operator<<(std::basic_ostream<char8_t>& os, const String& str);
828 inline bool operator==(
const String& left,
const String& right)
830 return left.m_string == right.m_string;
833 inline bool operator!=(
const String& left,
const String& right)
835 return left.m_string != right.m_string;
838 inline bool operator<(
const String& left,
const String& right)
840 return left.m_string < right.m_string;
843 inline bool operator<=(
const String& left,
const String& right)
845 return left.m_string <= right.m_string;
848 inline bool operator>(
const String& left,
const String& right)
850 return left.m_string > right.m_string;
853 inline bool operator>=(
const String& left,
const String& right)
855 return left.m_string >= right.m_string;
858 inline String
operator+(
const String& left,
const String& right)
860 return String(left.m_string + right.m_string);
862 inline String
operator+(String&& left, String&& right)
864 return String(std::move(left.m_string) + std::move(right.m_string));
866 inline String
operator+(String&& left,
const String& right)
868 return String(std::move(left.m_string) + right.m_string);
870 inline String
operator+(
const String& left, String&& right)
872 return String(left.m_string + std::move(right.m_string));
875 TGUI_API std::basic_ostream<char>& operator<<(std::basic_ostream<char>& os,
const String& str);
876 TGUI_API std::basic_ostream<wchar_t>& operator<<(std::basic_ostream<wchar_t>& os,
const String& str);
883#if defined(__cpp_lib_char8_t) && (__cpp_lib_char8_t >= 201811L)
884 inline String::String(
const std::u8string& str) :
885 m_string(utf::convertUtf8toUtf32(str.begin(), str.end()))
889 inline String::String(char8_t utfChar)
890 : m_string(1, static_cast<char32_t>(utfChar))
894 inline String::String(
const char8_t* str)
895 : String{utf::convertUtf8toUtf32(str, str + std::char_traits<char8_t>::length(str))}
899 inline String::String(std::size_t count, char8_t ch)
900 : m_string(count, static_cast<char32_t>(ch))
904 inline String::String(
const std::u8string& str, std::size_t pos)
905 : String{std::u8string(str, pos)}
909 inline String::String(
const std::u8string& str, std::size_t pos, std::size_t count)
910 : String{std::u8string(str, pos, count)}
914 inline String::String(
const char8_t* str, std::size_t count)
915 : String{std::u8string{str, count}}
919 inline String::String(std::initializer_list<char8_t> chars)
920 : String(std::u8string(chars.begin(), chars.end()))
924 inline String::String(std::u8string::const_iterator first, std::u8string::const_iterator last)
925 : String{std::u8string(first, last)}
929 inline String::operator std::u8string()
const
934 inline std::u8string String::toUtf8()
const
936 return utf::convertUtf32toUtf8(m_string);
939 inline String& String::assign(std::size_t count, char8_t ch)
941 m_string.assign(count,
static_cast<char32_t
>(ch));
945 inline String& String::assign(
const std::u8string& str)
950 inline String& String::assign(
const std::u8string& str, std::size_t pos, std::size_t count)
952 return *
this = {str, pos, count};
955 inline String& String::assign(std::u8string&& str)
957 return *
this = std::move(str);
960 inline String& String::assign(
const char8_t* str, std::size_t count)
962 return *
this = {str, count};
965 inline String& String::assign(
const char8_t* str)
970 inline String& String::assign(std::initializer_list<char8_t> chars)
972 return *
this = chars;
975 inline String& String::assign(std::u8string::const_iterator first, std::u8string::const_iterator last)
977 return *
this = {first, last};
980 inline String& String::insert(std::size_t index, std::size_t count, char8_t ch)
982 m_string.insert(index, count,
static_cast<char32_t
>(ch));
986 inline String& String::insert(std::size_t index,
const std::u8string& str)
988 m_string.insert(index, String{str}.m_string);
992 inline String& String::insert(std::size_t index,
const std::u8string& str, std::size_t pos, std::size_t count)
994 m_string.insert(index, String{str, pos, count}.m_string);
998 inline String& String::insert(std::size_t index,
const char8_t* str, std::size_t count)
1000 m_string.insert(index, String{str, count}.m_string);
1004 inline String& String::insert(std::size_t index,
const char8_t* str)
1006 m_string.insert(index, String{str}.m_string);
1010 inline String::iterator String::insert(String::const_iterator pos, char8_t ch)
1012 return m_string.insert(pos,
static_cast<char32_t
>(ch));
1015 inline String::iterator String::insert(String::const_iterator pos, std::size_t count, char8_t ch)
1017 return m_string.insert(pos, count,
static_cast<char32_t
>(ch));
1020 inline String::iterator String::insert(String::const_iterator pos, std::initializer_list<char8_t> chars)
1022 auto tmpStr = String{chars};
1023 return m_string.insert(pos, tmpStr.begin(), tmpStr.end());
1026 inline String::iterator String::insert(String::const_iterator pos, std::u8string::const_iterator first, std::u8string::const_iterator last)
1028 auto tmpStr = String{first, last};
1029 return m_string.insert(pos, tmpStr.begin(), tmpStr.end());
1032 inline String& String::append(std::size_t count, char8_t ch)
1034 return append(String(count, ch));
1037 inline String& String::append(
const std::u8string& str)
1039 return append(String{str});
1042 inline String& String::append(
const std::u8string& str, std::size_t pos, std::size_t count)
1044 return append(String{str, pos, count});
1047 inline String& String::append(
const char8_t* str, std::size_t count)
1049 return append(String{str, count});
1052 inline String& String::append(
const char8_t* str)
1054 return append(String{str});
1057 inline String& String::append(std::initializer_list<char8_t> chars)
1059 return append(String{chars});
1062 inline String& String::append(std::u8string::const_iterator first, std::u8string::const_iterator last)
1064 return append(String{first, last});
1067 inline int String::compare(
const std::u8string& str)
const noexcept
1069 return m_string.compare(String{str}.m_string);
1072 inline int String::compare(std::size_t pos1, std::size_t count1,
const std::u8string& str)
const
1074 return m_string.compare(pos1, count1, String{str}.m_string);
1077 inline int String::compare(std::size_t pos1, std::size_t count1,
const std::u8string& str, std::size_t pos2, std::size_t count2)
const
1079 return m_string.compare(pos1, count1, String{str, pos2, count2}.m_string);
1082 inline int String::compare(
const char8_t* s)
const
1084 return m_string.compare(String{s}.m_string);
1087 inline int String::compare(std::size_t pos1, std::size_t count1,
const char8_t* s)
const
1089 return m_string.compare(pos1, count1, String{s}.m_string);
1092 inline int String::compare(std::size_t pos1, std::size_t count1,
const char8_t* s, std::size_t count2)
const
1094 return m_string.compare(pos1, count1, String{s, count2}.m_string);
1097 inline String& String::replace(std::size_t pos, std::size_t count,
const std::u8string& str)
1099 m_string.replace(pos, count, String{str}.m_string);
1103 inline String& String::replace(const_iterator first, const_iterator last,
const std::u8string& str)
1105 m_string.replace(first, last, String{str}.m_string);
1109 inline String& String::replace(std::size_t pos, std::size_t count,
const std::u8string& str, std::size_t pos2, std::size_t count2)
1111 m_string.replace(pos, count, String{str, pos2, count2}.m_string);
1115 inline String& String::replace(const_iterator first, const_iterator last, std::u8string::const_iterator first2, std::u8string::const_iterator last2)
1117 m_string.replace(first, last, String{first2, last2}.m_string);
1121 inline String& String::replace(std::size_t pos, std::size_t count,
const char8_t* cstr, std::size_t count2)
1123 m_string.replace(pos, count, String{cstr, count2}.m_string);
1127 inline String& String::replace(const_iterator first, const_iterator last,
const char8_t* cstr, std::size_t count2)
1129 m_string.replace(first, last, String{cstr, count2}.m_string);
1133 inline String& String::replace(std::size_t pos, std::size_t count,
const char8_t* cstr)
1135 m_string.replace(pos, count, String{cstr}.m_string);
1139 inline String& String::replace(const_iterator first, const_iterator last,
const char8_t* cstr)
1141 m_string.replace(first, last, String{cstr}.m_string);
1145 inline String& String::replace(std::size_t pos, std::size_t count, std::size_t count2, char8_t ch)
1147 m_string.replace(pos, count, String(count2, ch).m_string);
1151 inline String& String::replace(const_iterator first, const_iterator last, std::size_t count2, char8_t ch)
1153 m_string.replace(first, last, String(count2, ch).m_string);
1157 inline String& String::replace(const_iterator first, const_iterator last, std::initializer_list<char8_t> chars)
1159 m_string.replace(first, last, String{chars}.m_string);
1163 inline void String::resize(std::size_t count, char8_t ch)
1165 m_string.resize(count,
static_cast<char32_t
>(ch));
1168 inline std::size_t String::find(
const std::u8string& str, std::size_t pos)
const noexcept
1170 return m_string.find(String{str}.m_string, pos);
1173 inline std::size_t String::find(
const char8_t* s, std::size_t pos, std::size_t count)
const
1175 return m_string.find(String{s, count}.m_string, pos);
1178 inline std::size_t String::find(
const char8_t* s, std::size_t pos)
const
1180 return m_string.find(String{s}.m_string, pos);
1183 inline std::size_t String::find(char8_t ch, std::size_t pos)
const noexcept
1185 return m_string.find(
static_cast<char32_t
>(ch), pos);
1188 inline std::size_t String::find_first_of(
const std::u8string& str, std::size_t pos)
const noexcept
1190 return m_string.find_first_of(String{str}.m_string, pos);
1193 inline std::size_t String::find_first_of(
const char8_t* s, std::size_t pos, std::size_t count)
const
1195 return m_string.find_first_of(String{s, count}.m_string, pos);
1198 inline std::size_t String::find_first_of(
const char8_t* s, std::size_t pos)
const
1200 return m_string.find_first_of(String{s}.m_string, pos);
1203 inline std::size_t String::find_first_of(char8_t ch, std::size_t pos)
const noexcept
1205 return m_string.find_first_of(
static_cast<char32_t
>(ch), pos);
1208 inline std::size_t String::find_first_not_of(
const std::u8string& str, std::size_t pos)
const noexcept
1210 return m_string.find_first_not_of(String{str}.m_string, pos);
1213 inline std::size_t String::find_first_not_of(
const char8_t* s, std::size_t pos, std::size_t count)
const
1215 return m_string.find_first_not_of(String{s, count}.m_string, pos);
1218 inline std::size_t String::find_first_not_of(
const char8_t* s, std::size_t pos)
const
1220 return m_string.find_first_not_of(String{s}.m_string, pos);
1223 inline std::size_t String::find_first_not_of(char8_t ch, std::size_t pos)
const noexcept
1225 return m_string.find_first_not_of(
static_cast<char32_t
>(ch), pos);
1228 inline std::size_t String::rfind(
const std::u8string& str, std::size_t pos)
const noexcept
1230 return m_string.rfind(String{str}.m_string, pos);
1233 inline std::size_t String::rfind(
const char8_t* s, std::size_t pos, std::size_t count)
const
1235 return m_string.rfind(String{s, count}.m_string, pos);
1238 inline std::size_t String::rfind(
const char8_t* s, std::size_t pos)
const
1240 return m_string.rfind(String{s}.m_string, pos);
1243 inline std::size_t String::rfind(char8_t ch, std::size_t pos)
const noexcept
1245 return m_string.rfind(
static_cast<char32_t
>(ch), pos);
1248 inline std::size_t String::find_last_of(
const std::u8string& str, std::size_t pos)
const noexcept
1250 return m_string.find_last_of(String{str}.m_string, pos);
1253 inline std::size_t String::find_last_of(
const char8_t* s, std::size_t pos, std::size_t count)
const
1255 return m_string.find_last_of(String{s, count}.m_string, pos);
1258 inline std::size_t String::find_last_of(
const char8_t* s, std::size_t pos)
const
1260 return m_string.find_last_of(String{s}.m_string, pos);
1263 inline std::size_t String::find_last_of(char8_t ch, std::size_t pos)
const noexcept
1265 return m_string.find_last_of(
static_cast<char32_t
>(ch), pos);
1268 inline std::size_t String::find_last_not_of(
const std::u8string& str, std::size_t pos)
const noexcept
1270 return m_string.find_last_not_of(String{str}.m_string, pos);
1273 inline std::size_t String::find_last_not_of(
const char8_t* s, std::size_t pos, std::size_t count)
const
1275 return m_string.find_last_not_of(String{s, count}.m_string, pos);
1278 inline std::size_t String::find_last_not_of(
const char8_t* s, std::size_t pos)
const
1280 return m_string.find_last_not_of(String{s}.m_string, pos);
1283 inline std::size_t String::find_last_not_of(char8_t ch, std::size_t pos)
const noexcept
1285 return m_string.find_last_not_of(
static_cast<char8_t
>(ch), pos);
1288 inline std::basic_ostream<char8_t>& operator<<(std::basic_ostream<char8_t>& os,
const String& str)
1290 os << std::u8string(str);
Wrapper class to store strings.
Definition: String.hpp:119
float toFloat(float defaultValue=0) const
Converts the string to a float.
static String fromNumber(T value)
Construct the string from a number.
Definition: String.hpp:212
String trim() const
Returns a string with the whitespace at the start and end of this string removed.
unsigned int toUInt(unsigned int defaultValue=0) const
Converts the string to an unsigned int.
int toInt(int defaultValue=0) const
Converts the string to an integer.
String toLower() const
Converts the ASCII characters in the string to lowercase.
String toUpper() const
Converts the ASCII characters in the string to uppercase.
Namespace that contains all TGUI functions and classes.
Definition: AbsoluteOrRelativeValue.hpp:37
TGUI_API Layout operator+(Layout left, Layout right)
operator for the Layout class
TGUI_API float strToFloat(const std::string &str, float defaultValue=0)
Converts a string to a float.
TGUI_API std::string toUpper(const std::string &str)
Converts a string to uppercase.
TGUI_API unsigned int strToUInt(const std::string &str, unsigned int defaultValue=0)
Converts a string to an unsigned int.
TGUI_API int strToInt(const std::string &str, int defaultValue=0)
Converts a string to an int.
TGUI_API std::string trim(const std::string &str)
Trims the whitespace from a string.
TGUI_API bool isWhitespace(char character)
Checks if a character is a whitespace character (space, tab, carriage return or line feed)
TGUI_API std::string toLower(const std::string &str)
Converts a string to lowercase.
TGUI_CONSTEXPR Vector2f & operator+=(Vector2f &left, const Vector2f &right)
Overload of binary operator +=.
Definition: Vector2f.hpp:140