UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
uLang::TUTF8StringBuilder< AllocatorType, AllocatorArgsType > Class Template Reference

#include <UTF8StringBuilder.h>

Public Types

using StringType = TUTF8String< AllocatorType, AllocatorArgsType... >
 

Public Member Functions

 TUTF8StringBuilder (uint32_t ReserveBytes=0)
 
 TUTF8StringBuilder (const char *NullTerminatedString, AllocatorArgsType &&... AllocatorArgs)
 
 TUTF8StringBuilder (const CUTF8StringView &StringView, AllocatorArgsType &&... AllocatorArgs)
 
template<typename... FormatterArgsType>
 TUTF8StringBuilder (AllocatorArgsType &&... AllocatorArgs, const char *NullTerminatedFormat, FormatterArgsType &&... FormatterArgs)
 
 TUTF8StringBuilder (const TUTF8StringBuilder &Other)
 
 TUTF8StringBuilder (TUTF8StringBuilder &&Other)
 
 ~TUTF8StringBuilder ()
 
void Reset ()
 
void EnsureAllocatedExtra (size_t ExtraBytes)
 
ULANG_FORCEINLINE int32_t ByteLen () const
 
ULANG_FORCEINLINE bool IsEmpty () const
 
ULANG_FORCEINLINE bool IsFilled () const
 
ULANG_FORCEINLINE const UTF8Charoperator[] (int32_t ByteIndex) const
 
ULANG_FORCEINLINE UTF8Char LastByte () const
 
template<class OtherAllocatorType , typename... OtherAllocatorArgsType>
ULANG_FORCEINLINE bool operator== (const TUTF8StringBuilder< OtherAllocatorType, OtherAllocatorArgsType... > &Other) const
 
template<class OtherAllocatorType , typename... OtherAllocatorArgsType>
ULANG_FORCEINLINE bool operator!= (const TUTF8StringBuilder< OtherAllocatorType, OtherAllocatorArgsType... > &Other) const
 
template<class OtherAllocatorType , typename... OtherAllocatorArgsType>
ULANG_FORCEINLINE bool operator== (const TUTF8String< OtherAllocatorType, OtherAllocatorArgsType... > &Other) const
 
template<class OtherAllocatorType , typename... OtherAllocatorArgsType>
ULANG_FORCEINLINE bool operator!= (const TUTF8String< OtherAllocatorType, OtherAllocatorArgsType... > &Other) const
 
ULANG_FORCEINLINE bool operator== (const CUTF8StringView &StringView) const
 
ULANG_FORCEINLINE bool operator!= (const CUTF8StringView &StringView) const
 
TUTF8StringBuilderoperator= (const TUTF8StringBuilder &Other)
 
TUTF8StringBuilderoperator= (TUTF8StringBuilder &&Other)
 
TUTF8StringBuilderoperator= (const CUTF8StringView &StringView)
 
ULANG_FORCEINLINE operator const CUTF8StringView & () const
 
ULANG_FORCEINLINE const CUTF8StringViewToStringView () const
 
ULANG_FORCEINLINE const charAsCString () const
 
ULANG_FORCEINLINE const charoperator* () const
 
StringType MoveToString ()
 
StringType CopyToString () const
 
TUTF8StringBuilderAppend (UTF8Char Char)
 
TUTF8StringBuilderAppend (const CUTF8StringView &String)
 
template<typename... FormatterArgsType>
TUTF8StringBuilderAppendFormat (const char *NullTerminatedFormat, FormatterArgsType &&... FormatterArgs)
 
UTF8CharAppendBuffer (size_t ByteSize)
 
TUTF8StringBuilderTrimEnd (UTF8Char Ch)
 
TUTF8StringBuilderReplaceRange (SIdxRange ToBeReplaced, const CUTF8StringView &Replacement)
 
TUTF8StringBuilderReplaceAt (int32_t Index, const UTF8Char Replacement)
 
TUTF8StringBuilderReplaceAll (const UTF8Char Search, const UTF8Char Replacement)
 
TUTF8StringBuilderInsertAt (int32_t Index, const CUTF8StringView &StringToInsert)
 
int32_t LineIndentEditor (int32_t Idx=0, int32_t SpanCount=-1, int32_t SpaceCount=DefaultIndentEffectiveSpaceCount)
 
template<typename... FormatterArgsType>
ULANG_SILENCE_SECURITY_WARNING_START ULANG_FORCEINLINE TUTF8StringBuilder (AllocatorArgsType &&... AllocatorArgs, const char *NullTerminatedFormat, FormatterArgsType &&... FormatterArgs)
 
template<typename... FormatterArgsType>
ULANG_SILENCE_SECURITY_WARNING_START TUTF8StringBuilder< AllocatorType, AllocatorArgsType... > & AppendFormat (const char *NullTerminatedFormat, FormatterArgsType &&... FormatterArgs)
 

Protected Member Functions

ULANG_FORCEINLINE int32_t InputByteIdxToDirectIdx (int32_t InIdx) const
 
ULANG_FORCEINLINE bool InputByteIdxSpan (int32_t &InOutIdx, int32_t &InOutSpan) const
 

Detailed Description

template<class AllocatorType, typename... AllocatorArgsType>
class uLang::TUTF8StringBuilder< AllocatorType, AllocatorArgsType >

String builder class Used to modify and manipulate strings

Member Typedef Documentation

◆ StringType

template<class AllocatorType , typename... AllocatorArgsType>
using uLang::TUTF8StringBuilder< AllocatorType, AllocatorArgsType >::StringType = TUTF8String<AllocatorType, AllocatorArgsType...>

Constructor & Destructor Documentation

◆ TUTF8StringBuilder() [1/7]

template<class AllocatorType , typename... AllocatorArgsType>
uLang::TUTF8StringBuilder< AllocatorType, AllocatorArgsType >::TUTF8StringBuilder ( uint32_t  ReserveBytes = 0)
inline

◆ TUTF8StringBuilder() [2/7]

template<class AllocatorType , typename... AllocatorArgsType>
ULANG_FORCEINLINE uLang::TUTF8StringBuilder< AllocatorType, AllocatorArgsType >::TUTF8StringBuilder ( const char NullTerminatedString,
AllocatorArgsType &&...  AllocatorArgs 
)

◆ TUTF8StringBuilder() [3/7]

template<class AllocatorType , typename... AllocatorArgsType>
ULANG_FORCEINLINE uLang::TUTF8StringBuilder< AllocatorType, AllocatorArgsType >::TUTF8StringBuilder ( const CUTF8StringView StringView,
AllocatorArgsType &&...  AllocatorArgs 
)

◆ TUTF8StringBuilder() [4/7]

template<class AllocatorType , typename... AllocatorArgsType>
template<typename... FormatterArgsType>
uLang::TUTF8StringBuilder< AllocatorType, AllocatorArgsType >::TUTF8StringBuilder ( AllocatorArgsType &&...  AllocatorArgs,
const char NullTerminatedFormat,
FormatterArgsType &&...  FormatterArgs 
)

◆ TUTF8StringBuilder() [5/7]

template<class AllocatorType , typename... AllocatorArgsType>
ULANG_SILENCE_SECURITY_WARNING_END ULANG_FORCEINLINE uLang::TUTF8StringBuilder< AllocatorType, AllocatorArgsType >::TUTF8StringBuilder ( const TUTF8StringBuilder< AllocatorType, AllocatorArgsType > &  Other)

◆ TUTF8StringBuilder() [6/7]

template<class AllocatorType , typename... AllocatorArgsType>
ULANG_FORCEINLINE uLang::TUTF8StringBuilder< AllocatorType, AllocatorArgsType >::TUTF8StringBuilder ( TUTF8StringBuilder< AllocatorType, AllocatorArgsType > &&  Other)

◆ ~TUTF8StringBuilder()

template<class AllocatorType , typename... AllocatorArgsType>
uLang::TUTF8StringBuilder< AllocatorType, AllocatorArgsType >::~TUTF8StringBuilder ( )
inline

◆ TUTF8StringBuilder() [7/7]

template<class AllocatorType , typename... AllocatorArgsType>
template<typename... FormatterArgsType>
ULANG_SILENCE_SECURITY_WARNING_START ULANG_FORCEINLINE uLang::TUTF8StringBuilder< AllocatorType, AllocatorArgsType >::TUTF8StringBuilder ( AllocatorArgsType &&...  AllocatorArgs,
const char NullTerminatedFormat,
FormatterArgsType &&...  FormatterArgs 
)

Member Function Documentation

◆ Append() [1/2]

template<class AllocatorType , typename... AllocatorArgsType>
TUTF8StringBuilder< AllocatorType, AllocatorArgsType... > & uLang::TUTF8StringBuilder< AllocatorType, AllocatorArgsType >::Append ( const CUTF8StringView String)
inline

◆ Append() [2/2]

template<class AllocatorType , typename... AllocatorArgsType>
TUTF8StringBuilder< AllocatorType, AllocatorArgsType... > & uLang::TUTF8StringBuilder< AllocatorType, AllocatorArgsType >::Append ( UTF8Char  Char)
inline

◆ AppendBuffer()

template<class AllocatorType , typename... AllocatorArgsType>
ULANG_SILENCE_SECURITY_WARNING_END UTF8Char * uLang::TUTF8StringBuilder< AllocatorType, AllocatorArgsType >::AppendBuffer ( size_t  ByteSize)

Grows the String for serialization purposes – the _End pointer is moved to the end of the buffer, expecting serialization to occur immediately following this call.

NOTE: This inserts a terminating '\0' character preliminary into the buffer, but expects serialization to overwrite it with a '\0' of its own.

Returns
A pointer to the appended buffer's start – useful for subsequent serialization.

◆ AppendFormat() [1/2]

template<class AllocatorType , typename... AllocatorArgsType>
template<typename... FormatterArgsType>
TUTF8StringBuilder & uLang::TUTF8StringBuilder< AllocatorType, AllocatorArgsType >::AppendFormat ( const char NullTerminatedFormat,
FormatterArgsType &&...  FormatterArgs 
)

◆ AppendFormat() [2/2]

template<class AllocatorType , typename... AllocatorArgsType>
template<typename... FormatterArgsType>
ULANG_SILENCE_SECURITY_WARNING_START TUTF8StringBuilder< AllocatorType, AllocatorArgsType... > & uLang::TUTF8StringBuilder< AllocatorType, AllocatorArgsType >::AppendFormat ( const char NullTerminatedFormat,
FormatterArgsType &&...  FormatterArgs 
)
inline

◆ AsCString()

template<class AllocatorType , typename... AllocatorArgsType>
ULANG_FORCEINLINE const char * uLang::TUTF8StringBuilder< AllocatorType, AllocatorArgsType >::AsCString ( ) const
inline

◆ ByteLen()

template<class AllocatorType , typename... AllocatorArgsType>
ULANG_FORCEINLINE int32_t uLang::TUTF8StringBuilder< AllocatorType, AllocatorArgsType >::ByteLen ( ) const
inline

◆ CopyToString()

template<class AllocatorType , typename... AllocatorArgsType>
StringType uLang::TUTF8StringBuilder< AllocatorType, AllocatorArgsType >::CopyToString ( ) const
inline

◆ EnsureAllocatedExtra()

template<class AllocatorType , typename... AllocatorArgsType>
void uLang::TUTF8StringBuilder< AllocatorType, AllocatorArgsType >::EnsureAllocatedExtra ( size_t  ExtraBytes)
inline

◆ InputByteIdxSpan()

template<class AllocatorType , typename... AllocatorArgsType>
ULANG_FORCEINLINE bool uLang::TUTF8StringBuilder< AllocatorType, AllocatorArgsType >::InputByteIdxSpan ( int32_t InOutIdx,
int32_t InOutSpan 
) const
inlineprotected

◆ InputByteIdxToDirectIdx()

template<class AllocatorType , typename... AllocatorArgsType>
ULANG_FORCEINLINE int32_t uLang::TUTF8StringBuilder< AllocatorType, AllocatorArgsType >::InputByteIdxToDirectIdx ( int32_t  InIdx) const
inlineprotected

◆ InsertAt()

template<class AllocatorType , typename... AllocatorArgsType>
TUTF8StringBuilder< AllocatorType, AllocatorArgsType... > & uLang::TUTF8StringBuilder< AllocatorType, AllocatorArgsType >::InsertAt ( int32_t  Index,
const CUTF8StringView StringToInsert 
)

Inserts a string before the given index.

◆ IsEmpty()

template<class AllocatorType , typename... AllocatorArgsType>
ULANG_FORCEINLINE bool uLang::TUTF8StringBuilder< AllocatorType, AllocatorArgsType >::IsEmpty ( ) const
inline

◆ IsFilled()

template<class AllocatorType , typename... AllocatorArgsType>
ULANG_FORCEINLINE bool uLang::TUTF8StringBuilder< AllocatorType, AllocatorArgsType >::IsFilled ( ) const
inline

◆ LastByte()

template<class AllocatorType , typename... AllocatorArgsType>
ULANG_FORCEINLINE UTF8Char uLang::TUTF8StringBuilder< AllocatorType, AllocatorArgsType >::LastByte ( ) const
inline
Returns
the last byte in this string (UTF-8 agnostic) or null character if empty

◆ LineIndentEditor()

template<class AllocatorType , typename... AllocatorArgsType>
int32_t uLang::TUTF8StringBuilder< AllocatorType, AllocatorArgsType >::LineIndentEditor ( int32_t  Idx = 0,
int32_t  SpanCount = -1,
int32_t  SpaceCount = DefaultIndentEffectiveSpaceCount 
)
inline

Indents rows/lines by specified SpaceCount spaces from Idx over the span of Count characters using behavior similar to the MS Visual Studio editor. Works on line breaks that are in Unix style \n or DOS style \r\n.

Returns
: number of line breaks over the specified range
Parameters
StartIdx - starting index to begin indentation. If negative it indicates index position from end of string - so -1 = last char, -2 = char before last, etc.
SpanCount - Span of characters to indent. If negative it indicates remainder of string after Idx - so -1 = include last, -2 = include char before last, etc.
SpaceCount - number of space characters to indent @notes:
  • Spaces inserted at the beginning of each row.
  • Rows with no non-space characters are not indented.
  • If the range ends just after a line break, the following row is not indented - at least one character on a row must be included for it to be indented
  • Similar to Visual Studio editor behavior.

◆ MoveToString()

template<class AllocatorType , typename... AllocatorArgsType>
ULANG_FORCEINLINE TUTF8String< AllocatorType, AllocatorArgsType... > uLang::TUTF8StringBuilder< AllocatorType, AllocatorArgsType >::MoveToString ( )

◆ operator const CUTF8StringView &()

template<class AllocatorType , typename... AllocatorArgsType>
ULANG_FORCEINLINE uLang::TUTF8StringBuilder< AllocatorType, AllocatorArgsType >::operator const CUTF8StringView & ( ) const
inline

◆ operator!=() [1/3]

template<class AllocatorType , typename... AllocatorArgsType>
ULANG_FORCEINLINE bool uLang::TUTF8StringBuilder< AllocatorType, AllocatorArgsType >::operator!= ( const CUTF8StringView StringView) const
inline

◆ operator!=() [2/3]

template<class AllocatorType , typename... AllocatorArgsType>
template<class OtherAllocatorType , typename... OtherAllocatorArgsType>
ULANG_FORCEINLINE bool uLang::TUTF8StringBuilder< AllocatorType, AllocatorArgsType >::operator!= ( const TUTF8String< OtherAllocatorType, OtherAllocatorArgsType... > &  Other) const
inline

◆ operator!=() [3/3]

template<class AllocatorType , typename... AllocatorArgsType>
template<class OtherAllocatorType , typename... OtherAllocatorArgsType>
ULANG_FORCEINLINE bool uLang::TUTF8StringBuilder< AllocatorType, AllocatorArgsType >::operator!= ( const TUTF8StringBuilder< OtherAllocatorType, OtherAllocatorArgsType... > &  Other) const
inline

◆ operator*()

template<class AllocatorType , typename... AllocatorArgsType>
ULANG_FORCEINLINE const char * uLang::TUTF8StringBuilder< AllocatorType, AllocatorArgsType >::operator* ( ) const
inline

◆ operator=() [1/3]

template<class AllocatorType , typename... AllocatorArgsType>
ULANG_FORCEINLINE TUTF8StringBuilder< AllocatorType, AllocatorArgsType... > & uLang::TUTF8StringBuilder< AllocatorType, AllocatorArgsType >::operator= ( const CUTF8StringView StringView)

◆ operator=() [2/3]

template<class AllocatorType , typename... AllocatorArgsType>
ULANG_FORCEINLINE TUTF8StringBuilder< AllocatorType, AllocatorArgsType... > & uLang::TUTF8StringBuilder< AllocatorType, AllocatorArgsType >::operator= ( const TUTF8StringBuilder< AllocatorType, AllocatorArgsType > &  Other)

◆ operator=() [3/3]

template<class AllocatorType , typename... AllocatorArgsType>
ULANG_FORCEINLINE TUTF8StringBuilder< AllocatorType, AllocatorArgsType... > & uLang::TUTF8StringBuilder< AllocatorType, AllocatorArgsType >::operator= ( TUTF8StringBuilder< AllocatorType, AllocatorArgsType > &&  Other)

◆ operator==() [1/3]

template<class AllocatorType , typename... AllocatorArgsType>
ULANG_FORCEINLINE bool uLang::TUTF8StringBuilder< AllocatorType, AllocatorArgsType >::operator== ( const CUTF8StringView StringView) const
inline

◆ operator==() [2/3]

template<class AllocatorType , typename... AllocatorArgsType>
template<class OtherAllocatorType , typename... OtherAllocatorArgsType>
ULANG_FORCEINLINE bool uLang::TUTF8StringBuilder< AllocatorType, AllocatorArgsType >::operator== ( const TUTF8String< OtherAllocatorType, OtherAllocatorArgsType... > &  Other) const
inline

◆ operator==() [3/3]

template<class AllocatorType , typename... AllocatorArgsType>
template<class OtherAllocatorType , typename... OtherAllocatorArgsType>
ULANG_FORCEINLINE bool uLang::TUTF8StringBuilder< AllocatorType, AllocatorArgsType >::operator== ( const TUTF8StringBuilder< OtherAllocatorType, OtherAllocatorArgsType... > &  Other) const
inline

◆ operator[]()

template<class AllocatorType , typename... AllocatorArgsType>
ULANG_FORCEINLINE const UTF8Char & uLang::TUTF8StringBuilder< AllocatorType, AllocatorArgsType >::operator[] ( int32_t  ByteIndex) const
inline
Returns
specific byte from this string

◆ ReplaceAll()

template<class AllocatorType , typename... AllocatorArgsType>
TUTF8StringBuilder< AllocatorType, AllocatorArgsType... > & uLang::TUTF8StringBuilder< AllocatorType, AllocatorArgsType >::ReplaceAll ( const UTF8Char  Search,
const UTF8Char  Replacement 
)

Replace all instances of a single character with the provided character

◆ ReplaceAt()

template<class AllocatorType , typename... AllocatorArgsType>
TUTF8StringBuilder< AllocatorType, AllocatorArgsType... > & uLang::TUTF8StringBuilder< AllocatorType, AllocatorArgsType >::ReplaceAt ( int32_t  Index,
const UTF8Char  Replacement 
)

Replace a single character with the provided character

◆ ReplaceRange()

template<class AllocatorType , typename... AllocatorArgsType>
TUTF8StringBuilder< AllocatorType, AllocatorArgsType... > & uLang::TUTF8StringBuilder< AllocatorType, AllocatorArgsType >::ReplaceRange ( SIdxRange  ToBeReplaced,
const CUTF8StringView Replacement 
)

Replace a range of bytes with the provided replacement string

◆ Reset()

template<class AllocatorType , typename... AllocatorArgsType>
void uLang::TUTF8StringBuilder< AllocatorType, AllocatorArgsType >::Reset ( )
inline

◆ ToStringView()

template<class AllocatorType , typename... AllocatorArgsType>
ULANG_FORCEINLINE const CUTF8StringView & uLang::TUTF8StringBuilder< AllocatorType, AllocatorArgsType >::ToStringView ( ) const
inline

◆ TrimEnd()

template<class AllocatorType , typename... AllocatorArgsType>
TUTF8StringBuilder< AllocatorType, AllocatorArgsType... > & uLang::TUTF8StringBuilder< AllocatorType, AllocatorArgsType >::TrimEnd ( UTF8Char  Ch)

Trim character from end if exists


The documentation for this class was generated from the following files: