81 std::u32string m_string;
83#if TGUI_COMPILED_WITH_CPP_VER >= 17
85 template <
typename StringViewType>
86 using IsStringViewType = std::enable_if_t<
87 std::is_same_v<StringViewType, std::string_view>
88#if defined(__cpp_lib_char8_t) && (__cpp_lib_char8_t >= 201811L)
89 || std::is_same_v<StringViewType, std::u8string_view>
91 || std::is_same_v<StringViewType, std::wstring_view>
92 || std::is_same_v<StringViewType, std::u16string_view>
93 || std::is_same_v<StringViewType, std::u32string_view>,
99 static const decltype(std::u32string::npos) npos;
101 using iterator = std::u32string::iterator;
102 using const_iterator = std::u32string::const_iterator;
103 using reverse_iterator = std::u32string::reverse_iterator;
104 using const_reverse_iterator = std::u32string::const_reverse_iterator;
106 using value_type = char32_t;
107 using reference =
char32_t&;
108 using const_reference =
const char32_t&;
150 int toInt(
int defaultValue = 0)
const;
160 unsigned int toUInt(
unsigned int defaultValue = 0)
const;
244 std::vector<String>
split(
char32_t delimiter,
bool trim =
false)
const;
263 template <
typename T>
266 std::ostringstream oss;
267 oss.imbue(std::locale::classic());
281 template <
typename T>
284 std::ostringstream oss;
285 oss.imbue(std::locale::classic());
286 oss << std::fixed << std::setprecision(decimals);
296 String(
const std::string& str);
297 String(
const std::wstring& str);
298 String(
const std::u16string& str);
299 String(
const std::u32string& str);
301 String(std::u32string&& str) :
302 m_string{std::move(str)}
306 String(
char ansiChar);
307 String(
wchar_t wideChar);
308 String(
char16_t utfChar);
309 String(
char32_t utfChar);
311 String(
const char* str);
312 String(
const wchar_t* str);
313 String(
const char16_t* str);
314 String(
const char32_t* str) :
320 template <typename T, typename = typename std::enable_if<std::is_arithmetic<T>::value, T>::type>
321 explicit String(T number) :
322 String{fromNumber(number)}
326 String(std::size_t count,
char ch);
327 String(std::size_t count,
wchar_t ch);
328 String(std::size_t count,
char16_t ch);
329 String(std::size_t count,
char32_t ch);
331 String(
const std::string& str, std::size_t pos);
332 String(
const std::wstring& str, std::size_t pos);
333 String(
const std::u16string& str, std::size_t pos);
334 String(
const std::u32string& str, std::size_t pos);
336 String(
const std::string& str, std::size_t pos, std::size_t count);
337 String(
const std::wstring& str, std::size_t pos, std::size_t count);
338 String(
const std::u16string& str, std::size_t pos, std::size_t count);
339 String(
const std::u32string& str, std::size_t pos, std::size_t count);
341 String(
const char* str, std::size_t count);
342 String(
const wchar_t* str, std::size_t count);
343 String(
const char16_t* str, std::size_t count);
344 String(
const char32_t* str, std::size_t count);
346 explicit String(std::initializer_list<char> chars);
347 explicit String(std::initializer_list<wchar_t> chars);
348 explicit String(std::initializer_list<char16_t> chars);
349 explicit String(std::initializer_list<char32_t> chars);
353 explicit String(std::string::const_iterator first, std::string::const_iterator last);
354 explicit String(std::wstring::const_iterator first, std::wstring::const_iterator last);
355 explicit String(std::u16string::const_iterator first, std::u16string::const_iterator last);
356 explicit String(std::u32string::const_iterator first, std::u32string::const_iterator last);
358#if TGUI_COMPILED_WITH_CPP_VER >= 17
359 template <
typename StringViewType,
typename = IsStringViewType<StringViewType>>
360 explicit String(
const StringViewType& stringView) :
361 String(stringView.data(), stringView.size())
365 template <
typename StringViewType,
typename = IsStringViewType<StringViewType>>
366 explicit String(
const StringViewType& stringView, std::size_t pos, std::size_t count) :
367 String(stringView.data(), pos, count)
372#if TGUI_HAS_BACKEND_SFML
374 explicit String(
const sf::String& str)
375 : m_string{reinterpret_cast<const char32_t*>(str.toUtf32().c_str())}
379 explicit operator sf::String()
const
381 return sf::String::fromUtf32(m_string.begin(), m_string.end());
385 explicit operator std::string()
const;
386 explicit operator std::wstring()
const;
387 explicit operator std::u16string()
const;
388 explicit operator const std::u32string&()
const
393#if TGUI_COMPILED_WITH_CPP_VER >= 17
394 operator std::u32string_view() const noexcept
400#ifndef TGUI_REMOVE_DEPRECATED_CODE
401 TGUI_DEPRECATED(
"Use toStdString instead") std::
string toAnsiString() const;
404 std::string toStdString()
const;
405 std::wstring toWideString()
const;
406 std::u16string toUtf16()
const;
407 const std::u32string& toUtf32()
const
412#if defined(__cpp_lib_char8_t) && (__cpp_lib_char8_t >= 201811L)
413 std::u8string toUtf8()
const
415 return utf::convertUtf32toUtf8(m_string);
417#elif !defined(TGUI_REMOVE_DEPRECATED_CODE)
418 TGUI_DEPRECATED(
"Use toStdString instead") std::
string toUtf8()
const
420 return toStdString();
424 String& assign(std::size_t count,
char ch);
425 String& assign(std::size_t count,
wchar_t ch);
426 String& assign(std::size_t count,
char16_t ch);
427 String& assign(std::size_t count,
char32_t ch);
429 String& assign(
const std::string& str);
430 String& assign(
const std::wstring& str);
431 String& assign(
const std::u16string& str);
432 String& assign(
const std::u32string& str);
433 String& assign(
const String& str);
435 String& assign(
const std::string& str, std::size_t pos, std::size_t count = npos);
436 String& assign(
const std::wstring& str, std::size_t pos, std::size_t count = npos);
437 String& assign(
const std::u16string& str, std::size_t pos, std::size_t count = npos);
438 String& assign(
const std::u32string& str, std::size_t pos, std::size_t count = npos);
439 String& assign(
const String& str, std::size_t pos, std::size_t count = npos);
441 String& assign(std::string&& str);
442 String& assign(std::wstring&& str);
443 String& assign(std::u16string&& str);
444 String& assign(std::u32string&& str);
445 String& assign(String&& str);
447 String& assign(
const char* str, std::size_t count);
448 String& assign(
const wchar_t* str, std::size_t count);
449 String& assign(
const char16_t* str, std::size_t count);
450 String& assign(
const char32_t* str, std::size_t count);
452 String& assign(
const char* str);
453 String& assign(
const wchar_t* str);
454 String& assign(
const char16_t* str);
455 String& assign(
const char32_t* str);
457 String& assign(std::initializer_list<char> chars);
458 String& assign(std::initializer_list<wchar_t> chars);
459 String& assign(std::initializer_list<char16_t> chars);
460 String& assign(std::initializer_list<char32_t> chars);
462 String& assign(std::string::const_iterator first, std::string::const_iterator last);
463 String& assign(std::wstring::const_iterator first, std::wstring::const_iterator last);
464 String& assign(std::u16string::const_iterator first, std::u16string::const_iterator last);
465 String& assign(std::u32string::const_iterator first, std::u32string::const_iterator last);
467 reference at(std::size_t pos);
468 const_reference at(std::size_t pos)
const;
470 const_reference operator [](std::size_t index)
const;
471 reference operator [](std::size_t index);
474 const_reference front()
const;
477 const_reference back()
const;
479 const char32_t* data() const noexcept
481 return m_string.data();
484#if __cplusplus >= 201703L
485 char32_t* data() noexcept
487 return m_string.data();
490 const char32_t* c_str() const noexcept
492 return m_string.c_str();
495 iterator begin() noexcept;
496 const_iterator begin() const noexcept;
497 const_iterator cbegin() const noexcept;
499 iterator end() noexcept;
500 const_iterator end() const noexcept;
501 const_iterator cend() const noexcept;
503 reverse_iterator rbegin() noexcept;
504 const_reverse_iterator rbegin() const noexcept;
505 const_reverse_iterator crbegin() const noexcept;
507 reverse_iterator rend() noexcept;
508 const_reverse_iterator rend() const noexcept;
509 const_reverse_iterator crend() const noexcept;
511 bool empty() const noexcept
513 return m_string.empty();
516 std::size_t size() const noexcept
518 return m_string.size();
521 std::size_t length() const noexcept
523 return m_string.length();
526 std::size_t max_size() const noexcept;
528 void reserve(std::
size_t newCap);
529 std::
size_t capacity() const noexcept;
530 void shrink_to_fit();
532 void clear() noexcept;
534 String& insert(std::
size_t index, std::
size_t count,
char ch);
535 String& insert(std::
size_t index, std::
size_t count,
wchar_t ch);
536 String& insert(std::
size_t index, std::
size_t count,
char16_t ch);
537 String& insert(std::
size_t index, std::
size_t count,
char32_t ch);
539 String& insert(std::
size_t index, const std::
string& str);
540 String& insert(std::
size_t index, const std::wstring& str);
541 String& insert(std::
size_t index, const std::u16string& str);
542 String& insert(std::
size_t index, const std::u32string& str);
543 String& insert(std::
size_t index, const String& str);
545 String& insert(std::
size_t index, const std::
string& str, std::
size_t pos, std::
size_t count = npos);
546 String& insert(std::
size_t index, const std::wstring& str, std::
size_t pos, std::
size_t count = npos);
547 String& insert(std::
size_t index, const std::u16string& str, std::
size_t pos, std::
size_t count = npos);
548 String& insert(std::
size_t index, const std::u32string& str, std::
size_t pos, std::
size_t count = npos);
549 String& insert(std::
size_t index, const String& str, std::
size_t pos, std::
size_t count = npos);
551 String& insert(std::
size_t index, const
char* str, std::
size_t count);
552 String& insert(std::
size_t index, const
wchar_t* str, std::
size_t count);
553 String& insert(std::
size_t index, const
char16_t* str, std::
size_t count);
554 String& insert(std::
size_t index, const
char32_t* str, std::
size_t count);
556 String& insert(std::
size_t index, const
char* str);
557 String& insert(std::
size_t index, const
wchar_t* str);
558 String& insert(std::
size_t index, const
char16_t* str);
559 String& insert(std::
size_t index, const
char32_t* str);
561 iterator insert(const_iterator pos,
char ch);
562 iterator insert(const_iterator pos,
wchar_t ch);
563 iterator insert(const_iterator pos,
char16_t ch);
564 iterator insert(const_iterator pos,
char32_t ch);
566 iterator insert(const_iterator pos, std::
size_t count,
char ch);
567 iterator insert(const_iterator pos, std::
size_t count,
wchar_t ch);
568 iterator insert(const_iterator pos, std::
size_t count,
char16_t ch);
569 iterator insert(const_iterator pos, std::
size_t count,
char32_t ch);
571 iterator insert(const_iterator pos, std::initializer_list<
char> chars);
572 iterator insert(const_iterator pos, std::initializer_list<
wchar_t> chars);
573 iterator insert(const_iterator pos, std::initializer_list<
char16_t> chars);
574 iterator insert(const_iterator pos, std::initializer_list<
char32_t> chars);
576 iterator insert(const_iterator pos, std::
string::const_iterator first, std::
string::const_iterator last);
577 iterator insert(const_iterator pos, std::wstring::const_iterator first, std::wstring::const_iterator last);
578 iterator insert(const_iterator pos, std::u16string::const_iterator first, std::u16string::const_iterator last);
579 iterator insert(const_iterator pos, std::u32string::const_iterator first, std::u32string::const_iterator last);
581 String& erase(std::
size_t index = 0, std::
size_t count = npos);
583 iterator erase(const_iterator position);
584 iterator erase(const_iterator first, const_iterator last);
586 void push_back(
char ch);
587 void push_back(
wchar_t ch);
588 void push_back(
char16_t ch);
589 void push_back(
char32_t ch);
593 String& append(std::
size_t count,
char ch);
594 String& append(std::
size_t count,
wchar_t ch);
595 String& append(std::
size_t count,
char16_t ch);
596 String& append(std::
size_t count,
char32_t ch);
598 String& append(const std::
string& str);
599 String& append(const std::wstring& str);
600 String& append(const std::u16string& str);
601 String& append(const std::u32string& str);
602 String& append(const String& str);
604 String& append(const std::
string& str, std::
size_t pos, std::
size_t count = npos);
605 String& append(const std::wstring& str, std::
size_t pos, std::
size_t count = npos);
606 String& append(const std::u16string& str, std::
size_t pos, std::
size_t count = npos);
607 String& append(const std::u32string& str, std::
size_t pos, std::
size_t count = npos);
608 String& append(const String& str, std::
size_t pos, std::
size_t count = npos);
610 String& append(const
char* str, std::
size_t count);
611 String& append(const
wchar_t* str, std::
size_t count);
612 String& append(const
char16_t* str, std::
size_t count);
613 String& append(const
char32_t* str, std::
size_t count);
615 String& append(const
char* str);
616 String& append(const
wchar_t* str);
617 String& append(const
char16_t* str);
618 String& append(const
char32_t* str);
620 String& append(std::
string::const_iterator first, std::
string::const_iterator last);
621 String& append(std::wstring::const_iterator first, std::wstring::const_iterator last);
622 String& append(std::u16string::const_iterator first, std::u16string::const_iterator last);
623 String& append(std::u32string::const_iterator first, std::u32string::const_iterator last);
625 String& append(std::initializer_list<
char> chars);
626 String& append(std::initializer_list<
wchar_t> chars);
627 String& append(std::initializer_list<
char16_t> chars);
628 String& append(std::initializer_list<
char32_t> chars);
630 String& operator+=(const String& str);
632 int compare(const std::
string& str) const noexcept;
633 int compare(const std::wstring& str) const noexcept;
634 int compare(const std::u16string& str) const noexcept;
635 int compare(const std::u32string& str) const noexcept;
636 int compare(const String& str) const noexcept;
638 int compare(std::
size_t pos1, std::
size_t count1, const std::
string& str) const;
639 int compare(std::
size_t pos1, std::
size_t count1, const std::wstring& str) const;
640 int compare(std::
size_t pos1, std::
size_t count1, const std::u16string& str) const;
641 int compare(std::
size_t pos1, std::
size_t count1, const std::u32string& str) const;
642 int compare(std::
size_t pos1, std::
size_t count1, const String& str) const;
644 int compare(std::
size_t pos1, std::
size_t count1, const std::
string& str, std::
size_t pos2, std::
size_t count2 = npos) const;
645 int compare(std::
size_t pos1, std::
size_t count1, const std::wstring& str, std::
size_t pos2, std::
size_t count2 = npos) const;
646 int compare(std::
size_t pos1, std::
size_t count1, const std::u16string& str, std::
size_t pos2, std::
size_t count2 = npos) const;
647 int compare(std::
size_t pos1, std::
size_t count1, const std::u32string& str, std::
size_t pos2, std::
size_t count2 = npos) const;
648 int compare(std::
size_t pos1, std::
size_t count1, const String& str, std::
size_t pos2, std::
size_t count2 = npos) const;
650 int compare(const
char* s) const;
651 int compare(const
wchar_t* s) const;
652 int compare(const
char16_t* s) const;
653 int compare(const
char32_t* s) const;
655 int compare(std::
size_t pos1, std::
size_t count1, const
char* s) const;
656 int compare(std::
size_t pos1, std::
size_t count1, const
wchar_t* s) const;
657 int compare(std::
size_t pos1, std::
size_t count1, const
char16_t* s) const;
658 int compare(std::
size_t pos1, std::
size_t count1, const
char32_t* s) const;
660 int compare(std::
size_t pos1, std::
size_t count1, const
char* s, std::
size_t count2) const;
661 int compare(std::
size_t pos1, std::
size_t count1, const
wchar_t* s, std::
size_t count2) const;
662 int compare(std::
size_t pos1, std::
size_t count1, const
char16_t* s, std::
size_t count2) const;
663 int compare(std::
size_t pos1, std::
size_t count1, const
char32_t* s, std::
size_t count2) const;
665 String& replace(std::
size_t pos, std::
size_t count, const std::
string& str);
666 String& replace(std::
size_t pos, std::
size_t count, const std::wstring& str);
667 String& replace(std::
size_t pos, std::
size_t count, const std::u16string& str);
668 String& replace(std::
size_t pos, std::
size_t count, const std::u32string& str);
669 String& replace(std::
size_t pos, std::
size_t count, const String& str);
671 String& replace(const_iterator first, const_iterator last, const std::
string& str);
672 String& replace(const_iterator first, const_iterator last, const std::wstring& str);
673 String& replace(const_iterator first, const_iterator last, const std::u16string& str);
674 String& replace(const_iterator first, const_iterator last, const std::u32string& str);
675 String& replace(const_iterator first, const_iterator last, const String& str);
677 String& replace(std::
size_t pos, std::
size_t count, const std::
string& str, std::
size_t pos2, std::
size_t count2 = npos);
678 String& replace(std::
size_t pos, std::
size_t count, const std::wstring& str, std::
size_t pos2, std::
size_t count2 = npos);
679 String& replace(std::
size_t pos, std::
size_t count, const std::u16string& str, std::
size_t pos2, std::
size_t count2 = npos);
680 String& replace(std::
size_t pos, std::
size_t count, const std::u32string& str, std::
size_t pos2, std::
size_t count2 = npos);
681 String& replace(std::
size_t pos, std::
size_t count, const String& str, std::
size_t pos2, std::
size_t count2 = npos);
683 String& replace(const_iterator first, const_iterator last, std::
string::const_iterator first2, std::
string::const_iterator last2);
684 String& replace(const_iterator first, const_iterator last, std::wstring::const_iterator first2, std::wstring::const_iterator last2);
685 String& replace(const_iterator first, const_iterator last, std::u16string::const_iterator first2, std::u16string::const_iterator last2);
686 String& replace(const_iterator first, const_iterator last, std::u32string::const_iterator first2, std::u32string::const_iterator last2);
688 String& replace(std::
size_t pos, std::
size_t count, const
char* cstr, std::
size_t count2);
689 String& replace(std::
size_t pos, std::
size_t count, const
wchar_t* cstr, std::
size_t count2);
690 String& replace(std::
size_t pos, std::
size_t count, const
char16_t* cstr, std::
size_t count2);
691 String& replace(std::
size_t pos, std::
size_t count, const
char32_t* cstr, std::
size_t count2);
693 String& replace(const_iterator first, const_iterator last, const
char* cstr, std::
size_t count2);
694 String& replace(const_iterator first, const_iterator last, const
wchar_t* cstr, std::
size_t count2);
695 String& replace(const_iterator first, const_iterator last, const
char16_t* cstr, std::
size_t count2);
696 String& replace(const_iterator first, const_iterator last, const
char32_t* cstr, std::
size_t count2);
698 String& replace(std::
size_t pos, std::
size_t count, const
char* cstr);
699 String& replace(std::
size_t pos, std::
size_t count, const
wchar_t* cstr);
700 String& replace(std::
size_t pos, std::
size_t count, const
char16_t* cstr);
701 String& replace(std::
size_t pos, std::
size_t count, const
char32_t* cstr);
703 String& replace(const_iterator first, const_iterator last, const
char* cstr);
704 String& replace(const_iterator first, const_iterator last, const
wchar_t* cstr);
705 String& replace(const_iterator first, const_iterator last, const
char16_t* cstr);
706 String& replace(const_iterator first, const_iterator last, const
char32_t* cstr);
708 String& replace(std::
size_t pos, std::
size_t count, std::
size_t count2,
char ch);
709 String& replace(std::
size_t pos, std::
size_t count, std::
size_t count2,
wchar_t ch);
710 String& replace(std::
size_t pos, std::
size_t count, std::
size_t count2,
char16_t ch);
711 String& replace(std::
size_t pos, std::
size_t count, std::
size_t count2,
char32_t ch);
713 String& replace(const_iterator first, const_iterator last, std::
size_t count2,
char ch);
714 String& replace(const_iterator first, const_iterator last, std::
size_t count2,
wchar_t ch);
715 String& replace(const_iterator first, const_iterator last, std::
size_t count2,
char16_t ch);
716 String& replace(const_iterator first, const_iterator last, std::
size_t count2,
char32_t ch);
718 String& replace(const_iterator first, const_iterator last, std::initializer_list<
char> chars);
719 String& replace(const_iterator first, const_iterator last, std::initializer_list<
wchar_t> chars);
720 String& replace(const_iterator first, const_iterator last, std::initializer_list<
char16_t> chars);
721 String& replace(const_iterator first, const_iterator last, std::initializer_list<
char32_t> chars);
723 String substr(std::
size_t pos = 0, std::
size_t count = npos) const;
725 std::
size_t copy(
char32_t* dest, std::
size_t count, std::
size_t pos = 0) const;
727 void resize(std::
size_t count);
728 void resize(std::
size_t count,
char ch);
729 void resize(std::
size_t count,
wchar_t ch);
730 void resize(std::
size_t count,
char16_t ch);
731 void resize(std::
size_t count,
char32_t ch);
733 void swap(String& other);
735#if TGUI_COMPILED_WITH_CPP_VER >= 17
736 bool contains(std::u32string_view sv)
const noexcept;
739 bool contains(
char c)
const noexcept;
740 bool contains(
wchar_t c)
const noexcept;
741 bool contains(
char16_t c)
const noexcept;
742 bool contains(
char32_t c)
const noexcept;
744 bool contains(
const char* s)
const;
745 bool contains(
const wchar_t* s)
const;
746 bool contains(
const char16_t* s)
const;
747 bool contains(
const char32_t* s)
const;
749 std::size_t find(
const std::string& str, std::size_t pos = 0) const noexcept;
750 std::
size_t find(const std::wstring& str, std::
size_t pos = 0) const noexcept;
751 std::
size_t find(const std::u16string& str, std::
size_t pos = 0) const noexcept;
752 std::
size_t find(const std::u32string& str, std::
size_t pos = 0) const noexcept;
753 std::
size_t find(const String& str, std::
size_t pos = 0) const noexcept;
755 std::
size_t find(const
char* s, std::
size_t pos, std::
size_t count) const;
756 std::
size_t find(const
wchar_t* s, std::
size_t pos, std::
size_t count) const;
757 std::
size_t find(const
char16_t* s, std::
size_t pos, std::
size_t count) const;
758 std::
size_t find(const
char32_t* s, std::
size_t pos, std::
size_t count) const;
760 std::
size_t find(const
char* s, std::
size_t pos = 0) const;
761 std::
size_t find(const
wchar_t* s, std::
size_t pos = 0) const;
762 std::
size_t find(const
char16_t* s, std::
size_t pos = 0) const;
763 std::
size_t find(const
char32_t* s, std::
size_t pos = 0) const;
765 std::
size_t find(
char ch, std::
size_t pos = 0) const noexcept;
766 std::
size_t find(
wchar_t ch, std::
size_t pos = 0) const noexcept;
767 std::
size_t find(
char16_t ch, std::
size_t pos = 0) const noexcept;
768 std::
size_t find(
char32_t ch, std::
size_t pos = 0) const noexcept;
770#if TGUI_COMPILED_WITH_CPP_VER >= 17
771 std::size_t find(std::u32string_view sv, std::size_t pos = 0) const noexcept;
774 std::size_t find_first_of(
const std::string& str, std::size_t pos = 0) const noexcept;
775 std::
size_t find_first_of(const std::wstring& str, std::
size_t pos = 0) const noexcept;
776 std::
size_t find_first_of(const std::u16string& str, std::
size_t pos = 0) const noexcept;
777 std::
size_t find_first_of(const std::u32string& str, std::
size_t pos = 0) const noexcept;
778 std::
size_t find_first_of(const String& str, std::
size_t pos = 0) const noexcept;
780 std::
size_t find_first_of(const
char* s, std::
size_t pos, std::
size_t count) const;
781 std::
size_t find_first_of(const
wchar_t* s, std::
size_t pos, std::
size_t count) const;
782 std::
size_t find_first_of(const
char16_t* s, std::
size_t pos, std::
size_t count) const;
783 std::
size_t find_first_of(const
char32_t* s, std::
size_t pos, std::
size_t count) const;
785 std::
size_t find_first_of(const
char* s, std::
size_t pos = 0) const;
786 std::
size_t find_first_of(const
wchar_t* s, std::
size_t pos = 0) const;
787 std::
size_t find_first_of(const
char16_t* s, std::
size_t pos = 0) const;
788 std::
size_t find_first_of(const
char32_t* s, std::
size_t pos = 0) const;
790 std::
size_t find_first_of(
char ch, std::
size_t pos = 0) const noexcept;
791 std::
size_t find_first_of(
wchar_t ch, std::
size_t pos = 0) const noexcept;
792 std::
size_t find_first_of(
char16_t ch, std::
size_t pos = 0) const noexcept;
793 std::
size_t find_first_of(
char32_t ch, std::
size_t pos = 0) const noexcept;
795 std::
size_t find_first_not_of(const std::
string& str, std::
size_t pos = 0) const noexcept;
796 std::
size_t find_first_not_of(const std::wstring& str, std::
size_t pos = 0) const noexcept;
797 std::
size_t find_first_not_of(const std::u16string& str, std::
size_t pos = 0) const noexcept;
798 std::
size_t find_first_not_of(const std::u32string& str, std::
size_t pos = 0) const noexcept;
799 std::
size_t find_first_not_of(const String& str, std::
size_t pos = 0) const noexcept;
801 std::
size_t find_first_not_of(const
char* s, std::
size_t pos, std::
size_t count) const;
802 std::
size_t find_first_not_of(const
wchar_t* s, std::
size_t pos, std::
size_t count) const;
803 std::
size_t find_first_not_of(const
char16_t* s, std::
size_t pos, std::
size_t count) const;
804 std::
size_t find_first_not_of(const
char32_t* s, std::
size_t pos, std::
size_t count) const;
806 std::
size_t find_first_not_of(const
char* s, std::
size_t pos = 0) const;
807 std::
size_t find_first_not_of(const
wchar_t* s, std::
size_t pos = 0) const;
808 std::
size_t find_first_not_of(const
char16_t* s, std::
size_t pos = 0) const;
809 std::
size_t find_first_not_of(const
char32_t* s, std::
size_t pos = 0) const;
811 std::
size_t find_first_not_of(
char ch, std::
size_t pos = 0) const noexcept;
812 std::
size_t find_first_not_of(
wchar_t ch, std::
size_t pos = 0) const noexcept;
813 std::
size_t find_first_not_of(
char16_t ch, std::
size_t pos = 0) const noexcept;
814 std::
size_t find_first_not_of(
char32_t ch, std::
size_t pos = 0) const noexcept;
816 std::
size_t rfind(const std::
string& str, std::
size_t pos = npos) const noexcept;
817 std::
size_t rfind(const std::wstring& str, std::
size_t pos = npos) const noexcept;
818 std::
size_t rfind(const std::u16string& str, std::
size_t pos = npos) const noexcept;
819 std::
size_t rfind(const std::u32string& str, std::
size_t pos = npos) const noexcept;
820 std::
size_t rfind(const String& str, std::
size_t pos = npos) const noexcept;
822 std::
size_t rfind(const
char* s, std::
size_t pos, std::
size_t count) const;
823 std::
size_t rfind(const
wchar_t* s, std::
size_t pos, std::
size_t count) const;
824 std::
size_t rfind(const
char16_t* s, std::
size_t pos, std::
size_t count) const;
825 std::
size_t rfind(const
char32_t* s, std::
size_t pos, std::
size_t count) const;
827 std::
size_t rfind(const
char* s, std::
size_t pos = npos) const;
828 std::
size_t rfind(const
wchar_t* s, std::
size_t pos = npos) const;
829 std::
size_t rfind(const
char16_t* s, std::
size_t pos = npos) const;
830 std::
size_t rfind(const
char32_t* s, std::
size_t pos = npos) const;
832 std::
size_t rfind(
char ch, std::
size_t pos = npos) const noexcept;
833 std::
size_t rfind(
wchar_t ch, std::
size_t pos = npos) const noexcept;
834 std::
size_t rfind(
char16_t ch, std::
size_t pos = npos) const noexcept;
835 std::
size_t rfind(
char32_t ch, std::
size_t pos = npos) const noexcept;
837 std::
size_t find_last_of(const std::
string& str, std::
size_t pos = npos) const noexcept;
838 std::
size_t find_last_of(const std::wstring& str, std::
size_t pos = npos) const noexcept;
839 std::
size_t find_last_of(const std::u16string& str, std::
size_t pos = npos) const noexcept;
840 std::
size_t find_last_of(const std::u32string& str, std::
size_t pos = npos) const noexcept;
841 std::
size_t find_last_of(const String& str, std::
size_t pos = npos) const noexcept;
843 std::
size_t find_last_of(const
char* s, std::
size_t pos, std::
size_t count) const;
844 std::
size_t find_last_of(const
wchar_t* s, std::
size_t pos, std::
size_t count) const;
845 std::
size_t find_last_of(const
char16_t* s, std::
size_t pos, std::
size_t count) const;
846 std::
size_t find_last_of(const
char32_t* s, std::
size_t pos, std::
size_t count) const;
848 std::
size_t find_last_of(const
char* s, std::
size_t pos = npos) const;
849 std::
size_t find_last_of(const
wchar_t* s, std::
size_t pos = npos) const;
850 std::
size_t find_last_of(const
char16_t* s, std::
size_t pos = npos) const;
851 std::
size_t find_last_of(const
char32_t* s, std::
size_t pos = npos) const;
853 std::
size_t find_last_of(
char ch, std::
size_t pos = npos) const noexcept;
854 std::
size_t find_last_of(
wchar_t ch, std::
size_t pos = npos) const noexcept;
855 std::
size_t find_last_of(
char16_t ch, std::
size_t pos = npos) const noexcept;
856 std::
size_t find_last_of(
char32_t ch, std::
size_t pos = npos) const noexcept;
858 std::
size_t find_last_not_of(const std::
string& str, std::
size_t pos = npos) const noexcept;
859 std::
size_t find_last_not_of(const std::wstring& str, std::
size_t pos = npos) const noexcept;
860 std::
size_t find_last_not_of(const std::u16string& str, std::
size_t pos = npos) const noexcept;
861 std::
size_t find_last_not_of(const std::u32string& str, std::
size_t pos = npos) const noexcept;
862 std::
size_t find_last_not_of(const String& str, std::
size_t pos = npos) const noexcept;
864 std::
size_t find_last_not_of(const
char* s, std::
size_t pos, std::
size_t count) const;
865 std::
size_t find_last_not_of(const
wchar_t* s, std::
size_t pos, std::
size_t count) const;
866 std::
size_t find_last_not_of(const
char16_t* s, std::
size_t pos, std::
size_t count) const;
867 std::
size_t find_last_not_of(const
char32_t* s, std::
size_t pos, std::
size_t count) const;
869 std::
size_t find_last_not_of(const
char* s, std::
size_t pos = npos) const;
870 std::
size_t find_last_not_of(const
wchar_t* s, std::
size_t pos = npos) const;
871 std::
size_t find_last_not_of(const
char16_t* s, std::
size_t pos = npos) const;
872 std::
size_t find_last_not_of(const
char32_t* s, std::
size_t pos = npos) const;
874 std::
size_t find_last_not_of(
char ch, std::
size_t pos = npos) const noexcept;
875 std::
size_t find_last_not_of(
wchar_t ch, std::
size_t pos = npos) const noexcept;
876 std::
size_t find_last_not_of(
char16_t ch, std::
size_t pos = npos) const noexcept;
877 std::
size_t find_last_not_of(
char32_t ch, std::
size_t pos = npos) const noexcept;
879 friend
bool operator==(const String& left, const String& right);
880 friend
bool operator!=(const String& left, const String& right);
881 friend
bool operator<(const String& left, const String& right);
882 friend
bool operator<=(const String& left, const String& right);
883 friend
bool operator>(const String& left, const String& right);
884 friend
bool operator>=(const String& left, const String& right);
885 friend String operator+(const String& left, const String& right);
886 friend String operator+(const String& left, String&& right);
887 friend String operator+(String&& left, const String& right);
888 friend String operator+(String&& left, String&& right);
890#if defined(__cpp_lib_char8_t) && (__cpp_lib_char8_t >= 201811L)
891 String(
const std::u8string& str);
892 String(
char8_t utfChar);
893 String(
const char8_t* str);
894 String(std::size_t count,
char8_t ch);
895 String(
const std::u8string& str, std::size_t pos);
896 String(
const std::u8string& str, std::size_t pos, std::size_t count);
897 String(
const char8_t* str, std::size_t count);
898 String(std::initializer_list<char8_t> chars);
899 String(std::u8string::const_iterator first, std::u8string::const_iterator last);
901 explicit operator std::u8string()
const;
903 String& assign(std::size_t count,
char8_t ch);
904 String& assign(
const std::u8string& str);
905 String& assign(
const std::u8string& str, std::size_t pos, std::size_t count = npos);
906 String& assign(std::u8string&& str);
907 String& assign(
const char8_t* str, std::size_t count);
908 String& assign(
const char8_t* str);
909 String& assign(std::initializer_list<char8_t> chars);
910 String& assign(std::u8string::const_iterator first, std::u8string::const_iterator last);
912 String& insert(std::size_t index, std::size_t count,
char8_t ch);
913 String& insert(std::size_t index,
const std::u8string& str);
914 String& insert(std::size_t index,
const std::u8string& str, std::size_t pos, std::size_t count = npos);
915 String& insert(std::size_t index,
const char8_t* str, std::size_t count);
916 String& insert(std::size_t index,
const char8_t* str);
917 iterator insert(const_iterator pos,
char8_t ch);
918 iterator insert(const_iterator pos, std::size_t count,
char8_t ch);
919 iterator insert(const_iterator pos, std::initializer_list<char8_t> chars);
920 iterator insert(const_iterator pos, std::u8string::const_iterator first, std::u8string::const_iterator last);
922 String& append(std::size_t count,
char8_t ch);
923 String& append(
const std::u8string& str);
924 String& append(
const std::u8string& str, std::size_t pos, std::size_t count = npos);
925 String& append(
const char8_t* str, std::size_t count);
926 String& append(
const char8_t* str);
927 String& append(std::initializer_list<char8_t> chars);
928 String& append(std::u8string::const_iterator first, std::u8string::const_iterator last);
930 int compare(
const std::u8string& str)
const noexcept;
931 int compare(std::size_t pos1, std::size_t count1,
const std::u8string& str)
const;
932 int compare(std::size_t pos1, std::size_t count1,
const std::u8string& str, std::size_t pos2, std::size_t count2 = npos)
const;
933 int compare(
const char8_t* s)
const;
934 int compare(std::size_t pos1, std::size_t count1,
const char8_t* s)
const;
935 int compare(std::size_t pos1, std::size_t count1,
const char8_t* s, std::size_t count2)
const;
937 String& replace(std::size_t pos, std::size_t count,
const std::u8string& str);
938 String& replace(const_iterator first, const_iterator last,
const std::u8string& str);
939 String& replace(std::size_t pos, std::size_t count,
const std::u8string& str, std::size_t pos2, std::size_t count2 = npos);
940 String& replace(const_iterator first, const_iterator last, std::u8string::const_iterator first2, std::u8string::const_iterator last2);
941 String& replace(std::size_t pos, std::size_t count,
const char8_t* cstr, std::size_t count2);
942 String& replace(const_iterator first, const_iterator last,
const char8_t* cstr, std::size_t count2);
943 String& replace(std::size_t pos, std::size_t count,
const char8_t* cstr);
944 String& replace(const_iterator first, const_iterator last,
const char8_t* cstr);
945 String& replace(std::size_t pos, std::size_t count, std::size_t count2,
char8_t ch);
946 String& replace(const_iterator first, const_iterator last, std::size_t count2,
char8_t ch);
947 String& replace(const_iterator first, const_iterator last, std::initializer_list<char8_t> chars);
949 void resize(std::size_t count,
char8_t ch);
951 bool contains(
char8_t c)
const noexcept;
952 bool contains(
const char8_t* s)
const noexcept;
954 std::size_t find(
const std::u8string& str, std::size_t pos = 0) const noexcept;
955 std::
size_t find(const
char8_t* s, std::
size_t pos, std::
size_t count) const;
956 std::
size_t find(const
char8_t* s, std::
size_t pos = 0) const;
957 std::
size_t find(
char8_t ch, std::
size_t pos = 0) const noexcept;
959 std::
size_t find_first_of(const std::u8string& str, std::
size_t pos = 0) const noexcept;
960 std::
size_t find_first_of(const
char8_t* s, std::
size_t pos, std::
size_t count) const;
961 std::
size_t find_first_of(const
char8_t* s, std::
size_t pos = 0) const;
962 std::
size_t find_first_of(
char8_t ch, std::
size_t pos = 0) const noexcept;
964 std::
size_t find_first_not_of(const std::u8string& str, std::
size_t pos = 0) const noexcept;
965 std::
size_t find_first_not_of(const
char8_t* s, std::
size_t pos, std::
size_t count) const;
966 std::
size_t find_first_not_of(const
char8_t* s, std::
size_t pos = 0) const;
967 std::
size_t find_first_not_of(
char8_t ch, std::
size_t pos = 0) const noexcept;
969 std::
size_t rfind(const std::u8string& str, std::
size_t pos = npos) const noexcept;
970 std::
size_t rfind(const
char8_t* s, std::
size_t pos, std::
size_t count) const;
971 std::
size_t rfind(const
char8_t* s, std::
size_t pos = npos) const;
972 std::
size_t rfind(
char8_t ch, std::
size_t pos = npos) const noexcept;
974 std::
size_t find_last_of(const std::u8string& str, std::
size_t pos = npos) const noexcept;
975 std::
size_t find_last_of(const
char8_t* s, std::
size_t pos, std::
size_t count) const;
976 std::
size_t find_last_of(const
char8_t* s, std::
size_t pos = npos) const;
977 std::
size_t find_last_of(
char8_t ch, std::
size_t pos = npos) const noexcept;
979 std::
size_t find_last_not_of(const std::u8string& str, std::
size_t pos = npos) const noexcept;
980 std::
size_t find_last_not_of(const
char8_t* s, std::
size_t pos, std::
size_t count) const;
981 std::
size_t find_last_not_of(const
char8_t* s, std::
size_t pos = npos) const;
982 std::
size_t find_last_not_of(
char8_t ch, std::
size_t pos = npos) const noexcept;