![]() |
UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
|
#include <SharedString.h>
Public Types | |
| using | ElementType = CharType |
Public Member Functions | |
| TSharedString ()=default | |
| TSharedString (TSharedString &&String) | |
| TSharedString (const TSharedString &String) | |
| TSharedString & | operator= (TSharedString &&String) |
| TSharedString & | operator= (const TSharedString &String) |
| TSharedString (TStringView< CharType > String) | |
| TSharedString & | operator= (TStringView< CharType > String) |
| ~TSharedString () | |
| void | Reset () |
| bool | IsEmpty () const |
| int32 | Len () const |
| const CharType * | operator* () const |
Static Public Attributes | |
| static const TSharedString | Empty |
Friends | |
| constexpr const CharType * | GetData (const TSharedString String) |
| constexpr auto | GetNum (const TSharedString String) |
| uint32 | GetTypeHash (const TSharedString &String) |
| bool | operator== (const TSharedString &Lhs, const TSharedString &Rhs) |
| bool | operator< (const TSharedString &Lhs, const TSharedString &Rhs) |
A reference to an immutable, shared, reference-counted string.
Prefer TStringView when there is a clear single point of ownership with a longer lifetime than the references to the string. This type is meant for cases where a shared string does not have an obvious owner or where the lifetime is not easy to manage.
The string is stored as a pointer to the start of the null-terminated string which is preceded by a 4-byte reference count and a 4-byte size.
| using UE::TSharedString< CharType >::ElementType = CharType |
|
default |
|
inline |
| UE::TSharedString< CharType >::TSharedString | ( | const TSharedString< CharType > & | String | ) |
| UE::TSharedString< CharType >::TSharedString | ( | TStringView< CharType > | String | ) |
Allocates a copy of the string and constructs this as a reference to it.
|
inline |
|
inline |
Returns true if the referenced string is empty.
|
inline |
Returns the length of the referenced string excluding the null terminator.
|
inline |
Returns a pointer to the start of the referenced null-terminated string.
| TSharedString< CharType > & UE::TSharedString< CharType >::operator= | ( | const TSharedString< CharType > & | String | ) |
| TSharedString< CharType > & UE::TSharedString< CharType >::operator= | ( | TSharedString< CharType > && | String | ) |
| TSharedString< CharType > & UE::TSharedString< CharType >::operator= | ( | TStringView< CharType > | String | ) |
Allocates a copy of the string and assigns this as a reference to it.
|
inline |
Resets this to reference the empty string.
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
inlinestatic |
An empty string provided mainly for returning a reference to an empty TSharedString.