UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
FTextCache Class Reference

#include <TextCache.h>

Public Member Functions

 FTextCache ()=default
 
 FTextCache (const FTextCache &)=delete
 
FTextCacheoperator= (const FTextCache &)=delete
 
FText FindOrCache (const TCHAR *InTextLiteral, const FTextId &InTextId)
 
FText FindOrCache (FStringView InTextLiteral, const FTextId &InTextId)
 
FText FindOrCache (FString &&InTextLiteral, const FTextId &InTextId)
 
void RemoveCache (const FTextId &InTextId)
 
void RemoveCache (TArrayView< const FTextId > InTextIds)
 
void RemoveCache (const TSet< FTextId > &InTextIds)
 

Static Public Member Functions

static FTextCacheGet ()
 
static void TearDown ()
 

Detailed Description

Caches FText instances generated via the LOCTEXT macro to avoid repeated constructions

Constructor & Destructor Documentation

◆ FTextCache() [1/2]

FTextCache::FTextCache ( )
default

◆ FTextCache() [2/2]

FTextCache::FTextCache ( const FTextCache )
delete

Non-copyable

Member Function Documentation

◆ FindOrCache() [1/3]

FText FTextCache::FindOrCache ( const TCHAR InTextLiteral,
const FTextId InTextId 
)

Try and find an existing cached entry for the given data, or construct and cache a new entry if one cannot be found.

◆ FindOrCache() [2/3]

FText FTextCache::FindOrCache ( FString &&  InTextLiteral,
const FTextId InTextId 
)

◆ FindOrCache() [3/3]

FText FTextCache::FindOrCache ( FStringView  InTextLiteral,
const FTextId InTextId 
)

◆ Get()

FTextCache & FTextCache::Get ( )
static

Get the singleton instance of the text cache.

◆ operator=()

FTextCache & FTextCache::operator= ( const FTextCache )
delete

◆ RemoveCache() [1/3]

void FTextCache::RemoveCache ( const FTextId InTextId)

Remove any cached entries for the given text IDs.

◆ RemoveCache() [2/3]

void FTextCache::RemoveCache ( const TSet< FTextId > &  InTextIds)

◆ RemoveCache() [3/3]

void FTextCache::RemoveCache ( TArrayView< const FTextId InTextIds)

◆ TearDown()

void FTextCache::TearDown ( )
static

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