TSharedString

A reference to an immutable, shared, reference-counted string.

Windows
MacOS
Linux

References

Module

DerivedDataCache

Header

/Engine/Source/Developer/DerivedDataCache/Public/DerivedDataSharedString.h

Include

#include "DerivedDataSharedString.h"

Syntax

template<typename CharType>
class TSharedString

Remarks

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.

Constructors

Name Description

Public function

TSharedString()

Public function

TSharedString

(
    TSharedString&& String
)

Public function

TSharedString

(
    const TSharedString& String
)

Public function

TSharedString

(
    TStringView< CharType > String
)

Destructors

Name Description

Public function

~TSharedString()

Functions

Name Description

Public function Const

bool

 

IsEmpty()

Public function Const

int32

 

Len()

Public function

void

 

Reset()

Operators

Name Description

Public function Const

const CharTy...

 

operator*()

Public function

TSharedStrin...

 

operator=

(
    TSharedString&& String
)

Public function

TSharedStrin...

 

operator=

(
    const TSharedString& String
)

Public function

TSharedStrin...

 

operator=

(
    TStringView< CharType > String
)

Constants

Name

Description

NullChar