80 static constexpr size_t kInlineBufferSize = OPTIONS::kInlineBufferSize;
83 using BufferElementType =
typename OPTIONS::BufferElementType;
92 template <IUNICODECanUnambiguouslyConvertFrom CHAR_T>
97 template <convertible_to<String> T>
115 template <IUNICODECanUnambiguouslyConvertFrom CHAR_T>
116 nonvirtual
void Append (span<const CHAR_T> s);
117 template <IUNICODECanUnambiguouslyConvertFrom CHAR_T>
118 nonvirtual
void Append (span<CHAR_T> s);
119 template <IUNICODECanUnambiguouslyConvertFrom CHAR_T>
120 nonvirtual
void Append (
const CHAR_T* s);
121 template <IStdBasicStringCompatibleCharacter CHAR_T>
122 nonvirtual
void Append (
const basic_string<CHAR_T>& s)
124 template <IStdBasicStringCompatibleCharacter CHAR_T>
125 nonvirtual
void Append (
const basic_string_view<CHAR_T>& s)
127 nonvirtual
void Append (
const String& s);
128 template <IUNICODECanUnambiguouslyConvertFrom CHAR_T>
129 nonvirtual
void Append (CHAR_T c);
136 template <
typename APPEND_ARG_T>
137 nonvirtual
auto operator+= (APPEND_ARG_T&& a)
139 #
if qCompilerAndStdLib_template_Requires_templateDeclarationMatchesOutOfLine_Buggy
141 if constexpr (
requires (
StringBuilder& s, APPEND_ARG_T&& a) { s.
Append (forward<APPEND_ARG_T> (a)); }) {
142 Append (forward<APPEND_ARG_T> (a));
145 Append (Characters::UnoverloadedToString (forward<APPEND_ARG_T> (a)));
175 template <
typename APPEND_ARG_T>
177 operator<< (APPEND_ARG_T&& a)
178 ->
StringBuilder&
requires (Characters::Private_::IUnoverloadedToString_<APPEND_ARG_T> or
requires (
StringBuilder& s, APPEND_ARG_T&& a) { s.
Append (forward<APPEND_ARG_T> (a)); })
179#
if qCompilerAndStdLib_template_Requires_templateDeclarationMatchesOutOfLine_Buggy
181 if constexpr (
requires (
StringBuilder& s, APPEND_ARG_T&& a) { s.
Append (forward<APPEND_ARG_T> (a)); }) {
182 Append (forward<APPEND_ARG_T> (a));
185 Append (Characters::UnoverloadedToString (forward<APPEND_ARG_T> (a)));
197 nonvirtual
void push_back (Character c);
203 nonvirtual
size_t size () const noexcept;
209 nonvirtual
bool empty () const noexcept;
215 nonvirtual Character GetAt (
size_t index) const noexcept;
221 nonvirtual
void SetAt (Character item,
size_t index) noexcept;
231 nonvirtual const Character operator[] (
size_t i) const noexcept;
237 template <Common::IAnyOf<
char, Character, String, span<const Character>, span<Character>> T>
238 nonvirtual
void InsertAt (T c,
size_t at);
244 nonvirtual
void ShrinkTo (
size_t sz) noexcept;
255 template <Common::IAnyOf<
String, wstring, u8string, u16string, u32string> RESULT_T>
256 nonvirtual RESULT_T As () const;
264 nonvirtual operator
String () const;
265 nonvirtual explicit operator wstring () const;
266 nonvirtual explicit operator u8string () const;
267 nonvirtual explicit operator u16string () const;
268 nonvirtual explicit operator u32string () const;
270 nonvirtual explicit operator span<const BufferElementType> () const;
275 nonvirtual
void clear () noexcept;
281 nonvirtual
String str () const;
289 nonvirtual
size_t length () const noexcept;
296 nonvirtual span<BufferElementType> data ();
297 nonvirtual span<const BufferElementType> data () const;
335 nonvirtual span<const CHAR_T> GetData (Memory::StackBuffer<CHAR_T>* probablyIgnoredBuf) const
336 requires (not is_const_v<CHAR_T>);
340 bool operator== (const
String& rhs) const;
346 void erase (
size_t from);
347 void erase (
size_t from,
size_t count);
350 [[deprecated ("Since Stroika v3.0d1, use span{} argument
")]] StringBuilder (const wchar_t* start, const wchar_t* end)
352 Append (span{start, end});
354 [[deprecated ("Since Stroika v3.0d1, use span{} argument
")]] void Append (const char16_t* s, const char16_t* e)
358 [[deprecated ("Since Stroika v3.0d1, use span{} argument
")]] void Append (const char32_t* s, const char32_t* e)
362 [[deprecated ("Since Stroika v3.0d1, use span{} argument
")]] void Append (const wchar_t* s, const wchar_t* e)
366 [[deprecated ("Since Stroika v3.0d1, use span{} argument
")]] void Append (const Character* s, const Character* e)
370 template <typename RESULT_T>
371 [[deprecated ("Since Stroika v3.0d2 - use As/0
")]] void As (RESULT_T* into) const
372 requires (same_as<RESULT_T, String> or same_as<RESULT_T, wstring>)
374 RequireNotNull (into);
375 if constexpr (same_as<RESULT_T, String>) {
378 if constexpr (same_as<RESULT_T, wstring>) {
379 *into = str ().template As<wstring> ();
384 Stroika_ATTRIBUTE_NO_UNIQUE_ADDRESS_VCFORCE Debug::AssertExternallySynchronizedChecker fAssertExternallySynchronized_;
387 Memory::InlineBuffer<BufferElementType, kInlineBufferSize> fData_{}; // not nul-terminated