| TStringBuilderBase
|
Module |
|
Header |
/Engine/Source/Runtime/Core/Public/Containers/StringFwd.h |
Include |
#include "Containers/StringFwd.h" |
template<typename CharType>
class TStringBuilderBase
String Builder
This class helps with the common task of constructing new strings.
It does this by allocating buffer space which is used to hold the constructed string. The intent is that the builder is allocated on the stack as a function local variable to avoid heap allocations.
The buffer is always contiguous and the class is not intended to be used to construct extremely large strings.
This is not intended to be used as a mechanism for holding on to strings for a long time. The use case is explicitly to aid in constructing* strings on the stack and subsequently passing the string into a function call or a more permanent string storage mechanism like FString et al.
The amount of buffer space to allocate is specified via a template parameter and if the constructed string should overflow this initial buffer, a new buffer will be allocated using regular dynamic memory allocations.
Overflow allocation should be the exceptional case however always try to size the buffer so that it can hold the vast majority of strings you expect to construct.
Be mindful that stack is a limited resource, so if you are writing a highly recursive function you may want to use some other mechanism to build your strings.
Name | Description | ||
---|---|---|---|
|
CharType * |
Base |
|
|
bIsDynamic |
||
|
CharType * |
CurPos |
|
|
CharType * |
End |
Name | Description | |
---|---|---|
|
TStringBuilderBase() |
|
|
TStringBuilderBase ( |
|
|
TStringBuilderBase ( |
|
|
TStringBuilderBase ( |
Name | Description | |
---|---|---|
|
~TStringBuilderBase() |
Name | Description | ||
---|---|---|---|
|
AddUninitialized ( |
Adds a given number of uninitialized characters into the string builder. |
|
|
void * |
AllocBuffer ( |
|
|
BuilderType ... |
Append ( |
|
|
BuilderType ... |
Append ( |
|
|
BuilderType ... |
Append ( |
|
|
BuilderType ... |
Append ( |
|
|
BuilderType ... |
AppendAnsi |
|
|
BuilderType ... |
AppendAnsi ( |
|
|
BuilderType ... |
AppendAnsi ( |
|
|
Appendf ( |
Appends to the string builder similarly to how classic sprintf works. |
|
|
EnsureCapacity ( |
||
|
EnsureNulTerminated() |
||
|
Extend ( |
||
|
FreeBuffer |
||
|
const CharTy... |
GetData() |
|
|
CharType ... |
GetData() |
|
|
Initialize ( |
||
|
BuilderType ... |
Join ( |
Append every element of the range to the builder, separating the elements by the delimiter. |
|
BuilderType ... |
JoinQuoted ( |
Append every element of the range to the builder, separating the elements by the delimiter, and surrounding every element on each side with the given quote. |
|
const CharTy... |
LastChar() |
|
|
Len() |
||
|
RemoveSuffix ( |
Modifies the string builder to remove the given number of characters from the end. |
|
|
Reset() |
Empties the string builder, but doesn't change memory allocation. |
|
|
const CharTy... |
ToString() |
Name | Description | ||
---|---|---|---|
|
const CharTy... |
operator*() |
|
|
TStringBuild... |
operator= ( |
|
|
TStringBuild... |
operator= ( |
Name |
Description |
---|---|
BuilderType |
The string builder base type to be used by append operators and function output parameters. |
ElementType |
The character type that this builder operates on. |
TCanAppend |
Whether the given type can be appended to this builder using the append operator. |
TCanAppendRange |
Whether the given range type can have its elements appended to the builder using the append operator. |
ViewType |
The string view type that this builder is compatible with. |