Ark Server API (ASA) - Wiki
Loading...
Searching...
No Matches
FText Class Reference

#include <Text.h>

+ Collaboration diagram for FText:

Classes

class  FSortPredicate
 

Public Member Functions

 FText ()
 
 FText (const FText &)=default
 
 FText (FText &&)=default
 
FTextoperator= (const FText &)=default
 
FTextoperator= (FText &&)=default
 
const FStringToString () const
 
FString BuildSourceString () const
 
bool IsNumeric () const
 
int32 CompareTo (const FText &Other, const ETextComparisonLevel::Type ComparisonLevel=ETextComparisonLevel::Default) const
 
int32 CompareToCaseIgnored (const FText &Other) const
 
bool EqualTo (const FText &Other, const ETextComparisonLevel::Type ComparisonLevel=ETextComparisonLevel::Default) const
 
bool EqualToCaseIgnored (const FText &Other) const
 
bool IdenticalTo (const FText &Other, const ETextIdenticalModeFlags CompareModeFlags=ETextIdenticalModeFlags::None) const
 
bool IsEmpty () const
 
bool IsEmptyOrWhitespace () const
 
FText ToLower () const
 
FText ToUpper () const
 
 DECLARE_DELEGATE_RetVal_OneParam (TSharedRef< ITextGenerator >, FCreateTextGeneratorDelegate, FStructuredArchive::FRecord)
 
bool IsTransient () const
 
bool IsCultureInvariant () const
 
bool IsInitializedFromString () const
 
bool IsFromStringTable () const
 
bool ShouldGatherForLocalization () const
 

Static Public Member Functions

static const FTextGetEmpty ()
 
static FText AsNumber (float Val, const FNumberFormattingOptions *const Options=NULL, const FCulturePtr &TargetCulture=NULL)
 
static FText AsNumber (double Val, const FNumberFormattingOptions *const Options=NULL, const FCulturePtr &TargetCulture=NULL)
 
static FText AsNumber (int8 Val, const FNumberFormattingOptions *const Options=NULL, const FCulturePtr &TargetCulture=NULL)
 
static FText AsNumber (int16 Val, const FNumberFormattingOptions *const Options=NULL, const FCulturePtr &TargetCulture=NULL)
 
static FText AsNumber (int32 Val, const FNumberFormattingOptions *const Options=NULL, const FCulturePtr &TargetCulture=NULL)
 
static FText AsNumber (int64 Val, const FNumberFormattingOptions *const Options=NULL, const FCulturePtr &TargetCulture=NULL)
 
static FText AsNumber (uint8 Val, const FNumberFormattingOptions *const Options=NULL, const FCulturePtr &TargetCulture=NULL)
 
static FText AsNumber (uint16 Val, const FNumberFormattingOptions *const Options=NULL, const FCulturePtr &TargetCulture=NULL)
 
static FText AsNumber (uint32 Val, const FNumberFormattingOptions *const Options=NULL, const FCulturePtr &TargetCulture=NULL)
 
static FText AsNumber (uint64 Val, const FNumberFormattingOptions *const Options=NULL, const FCulturePtr &TargetCulture=NULL)
 
static FText AsNumber (long Val, const FNumberFormattingOptions *const Options=NULL, const FCulturePtr &TargetCulture=NULL)
 
static FText AsCurrency (float Val, const FString &CurrencyCode=FString(), const FNumberFormattingOptions *const Options=NULL, const FCulturePtr &TargetCulture=NULL)
 
static FText AsCurrency (double Val, const FString &CurrencyCode=FString(), const FNumberFormattingOptions *const Options=NULL, const FCulturePtr &TargetCulture=NULL)
 
static FText AsCurrency (int8 Val, const FString &CurrencyCode=FString(), const FNumberFormattingOptions *const Options=NULL, const FCulturePtr &TargetCulture=NULL)
 
static FText AsCurrency (int16 Val, const FString &CurrencyCode=FString(), const FNumberFormattingOptions *const Options=NULL, const FCulturePtr &TargetCulture=NULL)
 
static FText AsCurrency (int32 Val, const FString &CurrencyCode=FString(), const FNumberFormattingOptions *const Options=NULL, const FCulturePtr &TargetCulture=NULL)
 
static FText AsCurrency (int64 Val, const FString &CurrencyCode=FString(), const FNumberFormattingOptions *const Options=NULL, const FCulturePtr &TargetCulture=NULL)
 
static FText AsCurrency (uint8 Val, const FString &CurrencyCode=FString(), const FNumberFormattingOptions *const Options=NULL, const FCulturePtr &TargetCulture=NULL)
 
static FText AsCurrency (uint16 Val, const FString &CurrencyCode=FString(), const FNumberFormattingOptions *const Options=NULL, const FCulturePtr &TargetCulture=NULL)
 
static FText AsCurrency (uint32 Val, const FString &CurrencyCode=FString(), const FNumberFormattingOptions *const Options=NULL, const FCulturePtr &TargetCulture=NULL)
 
static FText AsCurrency (uint64 Val, const FString &CurrencyCode=FString(), const FNumberFormattingOptions *const Options=NULL, const FCulturePtr &TargetCulture=NULL)
 
static FText AsCurrency (long Val, const FString &CurrencyCode=FString(), const FNumberFormattingOptions *const Options=NULL, const FCulturePtr &TargetCulture=NULL)
 
static FText AsCurrencyBase (int64 BaseVal, const FString &CurrencyCode, const FCulturePtr &TargetCulture=NULL, int32 ForceDecimalPlaces=-1)
 
static FText AsPercent (float Val, const FNumberFormattingOptions *const Options=NULL, const FCulturePtr &TargetCulture=NULL)
 
static FText AsPercent (double Val, const FNumberFormattingOptions *const Options=NULL, const FCulturePtr &TargetCulture=NULL)
 
static FText AsDate (const FDateTime &DateTime, const EDateTimeStyle::Type DateStyle=EDateTimeStyle::Default, const FString &TimeZone=FString(), const FCulturePtr &TargetCulture=NULL)
 
static FText AsDateTime (const FDateTime &DateTime, const EDateTimeStyle::Type DateStyle=EDateTimeStyle::Default, const EDateTimeStyle::Type TimeStyle=EDateTimeStyle::Default, const FString &TimeZone=FString(), const FCulturePtr &TargetCulture=NULL)
 
static FText AsDateTime (const FDateTime &DateTime, const FString &CustomPattern, const FString &TimeZone=FString(), const FCulturePtr &TargetCulture=NULL)
 
static FText AsTime (const FDateTime &DateTime, const EDateTimeStyle::Type TimeStyle=EDateTimeStyle::Default, const FString &TimeZone=FString(), const FCulturePtr &TargetCulture=NULL)
 
static FText AsTimespan (const FTimespan &Timespan, const FCulturePtr &TargetCulture=NULL)
 
static FString GetInvariantTimeZone ()
 
static FText AsMemory (uint64 NumBytes, const FNumberFormattingOptions *const Options=NULL, const FCulturePtr &TargetCulture=NULL, EMemoryUnitStandard UnitStandard=EMemoryUnitStandard::IEC)
 
static FText AsMemory (uint64 NumBytes, EMemoryUnitStandard UnitStandard)
 
static bool FindText (const FTextKey &Namespace, const FTextKey &Key, FText &OutText, const FString *const SourceString=nullptr)
 
static FText FromStringTable (const FName InTableId, const FString &InKey, const EStringTableLoadingPolicy InLoadingPolicy=EStringTableLoadingPolicy::FindOrLoad)
 
static FText FromName (const FName &Val)
 
static FText FromString (const FString &String)
 
static FText FromString (FString &&String)
 
static FText FromStringView (FStringView InString)
 
static FText AsCultureInvariant (const FString &String)
 
static FText AsCultureInvariant (FString &&String)
 
static FText AsCultureInvariant (FText Text)
 
static FText TrimPreceding (const FText &)
 
static FText TrimTrailing (const FText &)
 
static FText TrimPrecedingAndTrailing (const FText &)
 
static bool IsWhitespace (const TCHAR Char)
 
static void GetFormatPatternParameters (const FTextFormat &Fmt, TArray< FString > &ParameterNames)
 
static FText Format (FTextFormat Fmt, const FFormatNamedArguments &InArguments)
 
static FText Format (FTextFormat Fmt, FFormatNamedArguments &&InArguments)
 
static FText Format (FTextFormat Fmt, const FFormatOrderedArguments &InArguments)
 
static FText Format (FTextFormat Fmt, FFormatOrderedArguments &&InArguments)
 
template<typename... ArgTypes>
static FORCEINLINE FText Format (FTextFormat Fmt, ArgTypes... Args)
 
template<typename... TArguments>
static FText FormatNamed (FTextFormat Fmt, TArguments &&... Args)
 
template<typename... TArguments>
static FText FormatOrdered (FTextFormat Fmt, TArguments &&... Args)
 
static FText Join (const FText &Delimiter, const FFormatOrderedArguments &Args)
 
static FText Join (const FText &Delimiter, const TArray< FText > &Args)
 
template<typename... ArgTypes>
static FORCEINLINE FText Join (const FText &Delimiter, ArgTypes... Args)
 
static FText FromTextGenerator (const TSharedRef< ITextGenerator > &TextGenerator)
 
static FCreateTextGeneratorDelegate FindRegisteredTextGenerator (FName TypeID)
 
static void RegisterTextGenerator (FName TypeID, FCreateTextGeneratorDelegate FactoryFunction)
 
template<typename T >
static void RegisterTextGenerator (FName TypeID)
 
template<typename T >
static void RegisterTextGenerator ()
 
static void UnregisterTextGenerator (FName TypeID)
 
template<typename T >
static void UnregisterTextGenerator ()
 

Private Types

enum class  EInitToEmptyString : uint8 { Value }
 

Private Member Functions

 FText (EInitToEmptyString)
 
 FText (TSharedRef< ITextData, ESPMode::ThreadSafe > InTextData)
 
 FText (FString &&InSourceString)
 
 FText (FName InTableId, FString InKey, const EStringTableLoadingPolicy InLoadingPolicy)
 
 FText (FString &&InSourceString, const FTextKey &InNamespace, const FTextKey &InKey, uint32 InFlags=0)
 
void GetHistoricFormatData (TArray< FHistoricTextFormatData > &OutHistoricFormatData) const
 
bool GetHistoricNumericData (FHistoricTextNumericData &OutHistoricNumericData) const
 
void Rebuild () const
 

Static Private Member Functions

static void SerializeText (FArchive &Ar, FText &Value)
 
static void SerializeText (FStructuredArchive::FSlot Slot, FText &Value)
 
static FText FormatNamedImpl (FTextFormat &&Fmt, FFormatNamedArguments &&InArguments)
 
static FText FormatOrderedImpl (FTextFormat &&Fmt, FFormatOrderedArguments &&InArguments)
 
template<typename T1 , typename T2 >
static FText AsNumberTemplate (T1 Val, const FNumberFormattingOptions *const Options, const FCulturePtr &TargetCulture)
 
template<typename T1 , typename T2 >
static FText AsCurrencyTemplate (T1 Val, const FString &CurrencyCode, const FNumberFormattingOptions *const Options, const FCulturePtr &TargetCulture)
 
template<typename T1 , typename T2 >
static FText AsPercentTemplate (T1 Val, const FNumberFormattingOptions *const Options, const FCulturePtr &TargetCulture)
 
template<typename T >
static TSharedRef< ITextGeneratorCreateTextGenerator (FStructuredArchive::FRecord Record)
 

Private Attributes

TSharedRef< ITextData, ESPMode::ThreadSafeTextData
 
uint32 Flags
 

Friends

class FTextCache
 
class FTextFormatter
 
class FTextFormatData
 
class FTextSnapshot
 
class FTextInspector
 
class FTextStringHelper
 
class FStringTableRegistry
 
class FArchive
 
class FArchiveFromStructuredArchiveImpl
 
class FJsonArchiveInputFormatter
 
class FJsonArchiveOutputFormatter
 
class FTextProperty
 
class FFormatArgumentValue
 
class FTextHistory_NamedFormat
 
class FTextHistory_ArgumentDataFormat
 
class FTextHistory_OrderedFormat
 
class FTextHistory_Transform
 
class FScopedTextIdentityPreserver
 

Detailed Description

Definition at line 356 of file Text.h.

Member Enumeration Documentation

◆ EInitToEmptyString

Special constructor used to create StaticEmptyText without also allocating a history object

Enumerator
Value 

Definition at line 749 of file Text.h.

Constructor & Destructor Documentation

◆ FText() [1/8]

FText::FText ( )

◆ FText() [2/8]

FText::FText ( const FText & )
default

◆ FText() [3/8]

FText::FText ( FText && )
default

◆ FText() [4/8]

FText::FText ( EInitToEmptyString )
explicitprivate

◆ FText() [5/8]

FText::FText ( TSharedRef< ITextData, ESPMode::ThreadSafe > InTextData)
explicitprivate

◆ FText() [6/8]

FText::FText ( FString && InSourceString)
explicitprivate

◆ FText() [7/8]

FText::FText ( FName InTableId,
FString InKey,
const EStringTableLoadingPolicy InLoadingPolicy )
private

◆ FText() [8/8]

FText::FText ( FString && InSourceString,
const FTextKey & InNamespace,
const FTextKey & InKey,
uint32 InFlags = 0 )
private

Member Function Documentation

◆ AsCultureInvariant() [1/3]

static FText FText::AsCultureInvariant ( const FString & String)
static

Generate a culture invariant FText representing the passed in string

◆ AsCultureInvariant() [2/3]

static FText FText::AsCultureInvariant ( FString && String)
static

◆ AsCultureInvariant() [3/3]

static FText FText::AsCultureInvariant ( FText Text)
static

Generate a culture invariant FText representing the passed in FText

◆ AsCurrency() [1/11]

static FText FText::AsCurrency ( double Val,
const FString & CurrencyCode = FString(),
const FNumberFormattingOptions *const Options = NULL,
const FCulturePtr & TargetCulture = NULL )
static

◆ AsCurrency() [2/11]

static FText FText::AsCurrency ( float Val,
const FString & CurrencyCode = FString(),
const FNumberFormattingOptions *const Options = NULL,
const FCulturePtr & TargetCulture = NULL )
static

◆ AsCurrency() [3/11]

static FText FText::AsCurrency ( int16 Val,
const FString & CurrencyCode = FString(),
const FNumberFormattingOptions *const Options = NULL,
const FCulturePtr & TargetCulture = NULL )
static

◆ AsCurrency() [4/11]

static FText FText::AsCurrency ( int32 Val,
const FString & CurrencyCode = FString(),
const FNumberFormattingOptions *const Options = NULL,
const FCulturePtr & TargetCulture = NULL )
static

◆ AsCurrency() [5/11]

static FText FText::AsCurrency ( int64 Val,
const FString & CurrencyCode = FString(),
const FNumberFormattingOptions *const Options = NULL,
const FCulturePtr & TargetCulture = NULL )
static

◆ AsCurrency() [6/11]

static FText FText::AsCurrency ( int8 Val,
const FString & CurrencyCode = FString(),
const FNumberFormattingOptions *const Options = NULL,
const FCulturePtr & TargetCulture = NULL )
static

◆ AsCurrency() [7/11]

static FText FText::AsCurrency ( long Val,
const FString & CurrencyCode = FString(),
const FNumberFormattingOptions *const Options = NULL,
const FCulturePtr & TargetCulture = NULL )
static

◆ AsCurrency() [8/11]

static FText FText::AsCurrency ( uint16 Val,
const FString & CurrencyCode = FString(),
const FNumberFormattingOptions *const Options = NULL,
const FCulturePtr & TargetCulture = NULL )
static

◆ AsCurrency() [9/11]

static FText FText::AsCurrency ( uint32 Val,
const FString & CurrencyCode = FString(),
const FNumberFormattingOptions *const Options = NULL,
const FCulturePtr & TargetCulture = NULL )
static

◆ AsCurrency() [10/11]

static FText FText::AsCurrency ( uint64 Val,
const FString & CurrencyCode = FString(),
const FNumberFormattingOptions *const Options = NULL,
const FCulturePtr & TargetCulture = NULL )
static

◆ AsCurrency() [11/11]

static FText FText::AsCurrency ( uint8 Val,
const FString & CurrencyCode = FString(),
const FNumberFormattingOptions *const Options = NULL,
const FCulturePtr & TargetCulture = NULL )
static

◆ AsCurrencyBase()

static FText FText::AsCurrencyBase ( int64 BaseVal,
const FString & CurrencyCode,
const FCulturePtr & TargetCulture = NULL,
int32 ForceDecimalPlaces = -1 )
static

Generate an FText that represents the passed number as currency in the current culture. BaseVal is specified in the smallest fractional value of the currency and will be converted for formatting according to the selected culture. Keep in mind the CurrencyCode is completely independent of the culture it's displayed in (and they do not imply one another). For example: FText::AsCurrencyBase(650, TEXT("EUR")); would return an FText of "<EUR>6.50" in most English cultures (en_US/en_UK) and "6,50<EUR>" in Spanish (es_ES) (where <EUR> is U+20AC)

◆ AsCurrencyTemplate()

template<typename T1 , typename T2 >
static FText FText::AsCurrencyTemplate ( T1 Val,
const FString & CurrencyCode,
const FNumberFormattingOptions *const Options,
const FCulturePtr & TargetCulture )
staticprivate

◆ AsDate()

static FText FText::AsDate ( const FDateTime & DateTime,
const EDateTimeStyle::Type DateStyle = EDateTimeStyle::Default,
const FString & TimeZone = FString(),
const FCulturePtr & TargetCulture = NULL )
static

Generate an FText that represents the passed number as a date and/or time in the current culture

Note
The overload using a custom pattern uses strftime-like syntax (see FDateTime::ToFormattedString)

◆ AsDateTime() [1/2]

static FText FText::AsDateTime ( const FDateTime & DateTime,
const EDateTimeStyle::Type DateStyle = EDateTimeStyle::Default,
const EDateTimeStyle::Type TimeStyle = EDateTimeStyle::Default,
const FString & TimeZone = FString(),
const FCulturePtr & TargetCulture = NULL )
static

◆ AsDateTime() [2/2]

static FText FText::AsDateTime ( const FDateTime & DateTime,
const FString & CustomPattern,
const FString & TimeZone = FString(),
const FCulturePtr & TargetCulture = NULL )
static

◆ AsMemory() [1/2]

static FText FText::AsMemory ( uint64 NumBytes,
const FNumberFormattingOptions *const Options = NULL,
const FCulturePtr & TargetCulture = NULL,
EMemoryUnitStandard UnitStandard = EMemoryUnitStandard::IEC )
static

Generate an FText that represents the passed number as a memory size in the current culture

◆ AsMemory() [2/2]

static FText FText::AsMemory ( uint64 NumBytes,
EMemoryUnitStandard UnitStandard )
static

Generate an FText that represents the passed number as a memory size in the current culture

◆ AsNumber() [1/11]

static FText FText::AsNumber ( double Val,
const FNumberFormattingOptions *const Options = NULL,
const FCulturePtr & TargetCulture = NULL )
static

◆ AsNumber() [2/11]

static FText FText::AsNumber ( float Val,
const FNumberFormattingOptions *const Options = NULL,
const FCulturePtr & TargetCulture = NULL )
static

Generate an FText that represents the passed number in the current culture

◆ AsNumber() [3/11]

static FText FText::AsNumber ( int16 Val,
const FNumberFormattingOptions *const Options = NULL,
const FCulturePtr & TargetCulture = NULL )
static

◆ AsNumber() [4/11]

static FText FText::AsNumber ( int32 Val,
const FNumberFormattingOptions *const Options = NULL,
const FCulturePtr & TargetCulture = NULL )
static

◆ AsNumber() [5/11]

static FText FText::AsNumber ( int64 Val,
const FNumberFormattingOptions *const Options = NULL,
const FCulturePtr & TargetCulture = NULL )
static

◆ AsNumber() [6/11]

static FText FText::AsNumber ( int8 Val,
const FNumberFormattingOptions *const Options = NULL,
const FCulturePtr & TargetCulture = NULL )
static

◆ AsNumber() [7/11]

static FText FText::AsNumber ( long Val,
const FNumberFormattingOptions *const Options = NULL,
const FCulturePtr & TargetCulture = NULL )
static

◆ AsNumber() [8/11]

static FText FText::AsNumber ( uint16 Val,
const FNumberFormattingOptions *const Options = NULL,
const FCulturePtr & TargetCulture = NULL )
static

◆ AsNumber() [9/11]

static FText FText::AsNumber ( uint32 Val,
const FNumberFormattingOptions *const Options = NULL,
const FCulturePtr & TargetCulture = NULL )
static

◆ AsNumber() [10/11]

static FText FText::AsNumber ( uint64 Val,
const FNumberFormattingOptions *const Options = NULL,
const FCulturePtr & TargetCulture = NULL )
static

◆ AsNumber() [11/11]

static FText FText::AsNumber ( uint8 Val,
const FNumberFormattingOptions *const Options = NULL,
const FCulturePtr & TargetCulture = NULL )
static

◆ AsNumberTemplate()

template<typename T1 , typename T2 >
static FText FText::AsNumberTemplate ( T1 Val,
const FNumberFormattingOptions *const Options,
const FCulturePtr & TargetCulture )
staticprivate

◆ AsPercent() [1/2]

static FText FText::AsPercent ( double Val,
const FNumberFormattingOptions *const Options = NULL,
const FCulturePtr & TargetCulture = NULL )
static

◆ AsPercent() [2/2]

static FText FText::AsPercent ( float Val,
const FNumberFormattingOptions *const Options = NULL,
const FCulturePtr & TargetCulture = NULL )
static

Generate an FText that represents the passed number as a percentage in the current culture

◆ AsPercentTemplate()

template<typename T1 , typename T2 >
static FText FText::AsPercentTemplate ( T1 Val,
const FNumberFormattingOptions *const Options,
const FCulturePtr & TargetCulture )
staticprivate

◆ AsTime()

static FText FText::AsTime ( const FDateTime & DateTime,
const EDateTimeStyle::Type TimeStyle = EDateTimeStyle::Default,
const FString & TimeZone = FString(),
const FCulturePtr & TargetCulture = NULL )
static

◆ AsTimespan()

static FText FText::AsTimespan ( const FTimespan & Timespan,
const FCulturePtr & TargetCulture = NULL )
static

◆ BuildSourceString()

FString FText::BuildSourceString ( ) const

Deep build of the source string for this FText, climbing the history hierarchy

◆ CompareTo()

int32 FText::CompareTo ( const FText & Other,
const ETextComparisonLevel::Type ComparisonLevel = ETextComparisonLevel::Default ) const

◆ CompareToCaseIgnored()

int32 FText::CompareToCaseIgnored ( const FText & Other) const

◆ CreateTextGenerator()

template<typename T >
TSharedRef< ITextGenerator > FText::CreateTextGenerator ( FStructuredArchive::FRecord Record)
inlinestaticprivate

Definition at line 943 of file Text.h.

◆ DECLARE_DELEGATE_RetVal_OneParam()

FText::DECLARE_DELEGATE_RetVal_OneParam ( TSharedRef< ITextGenerator > ,
FCreateTextGeneratorDelegate ,
FStructuredArchive::FRecord  )

◆ EqualTo()

bool FText::EqualTo ( const FText & Other,
const ETextComparisonLevel::Type ComparisonLevel = ETextComparisonLevel::Default ) const

◆ EqualToCaseIgnored()

bool FText::EqualToCaseIgnored ( const FText & Other) const

◆ FindRegisteredTextGenerator()

static FCreateTextGeneratorDelegate FText::FindRegisteredTextGenerator ( FName TypeID)
static

Returns the text generator factory function registered under the specified name, if any.

Parameters
TypeIDthe name under which to look up the factory function

◆ FindText()

static bool FText::FindText ( const FTextKey & Namespace,
const FTextKey & Key,
FText & OutText,
const FString *const SourceString = nullptr )
static

Attempts to find an existing FText using the representation found in the loc tables for the specified namespace and key

Returns
true if OutText was properly set; otherwise false and OutText will be untouched

◆ Format() [1/5]

template<typename... ArgTypes>
static FORCEINLINE FText FText::Format ( FTextFormat Fmt,
ArgTypes... Args )
inlinestatic

Format the given list of variadic values as ordered arguments within the given format pattern

Note
You may want to pre-compile your FText pattern into a FTextFormat prior to performing formats within a loop or on a critical path, as this can save CPU cycles, memory, and mutex resources vs re-compiling the pattern for each format call. See FTextFormat for more info.

@usage FText::Format(LOCTEXT("PlayerNameFmt", "{0} is really cool"), FText::FromString(PlayerName));

Parameters
FmtThe format pattern to use
ArgsA variadic list of values to inject into the format pattern
Returns
The formatted FText

Definition at line 591 of file Text.h.

◆ Format() [2/5]

static FText FText::Format ( FTextFormat Fmt,
const FFormatNamedArguments & InArguments )
static

Format the given map of key->value pairs as named arguments within the given format pattern

Note
You may want to pre-compile your FText pattern into a FTextFormat prior to performing formats within a loop or on a critical path, as this can save CPU cycles, memory, and mutex resources vs re-compiling the pattern for each format call. See FTextFormat for more info.
Parameters
FmtThe format pattern to use
InArgumentsThe map of key->value pairs to inject into the format pattern
Returns
The formatted FText

◆ Format() [3/5]

static FText FText::Format ( FTextFormat Fmt,
const FFormatOrderedArguments & InArguments )
static

Format the given list values as ordered arguments within the given format pattern

Note
You may want to pre-compile your FText pattern into a FTextFormat prior to performing formats within a loop or on a critical path, as this can save CPU cycles, memory, and mutex resources vs re-compiling the pattern for each format call. See FTextFormat for more info.
Parameters
FmtThe format pattern to use
InArgumentsThe list of values to inject into the format pattern
Returns
The formatted FText

◆ Format() [4/5]

static FText FText::Format ( FTextFormat Fmt,
FFormatNamedArguments && InArguments )
static

◆ Format() [5/5]

static FText FText::Format ( FTextFormat Fmt,
FFormatOrderedArguments && InArguments )
static

◆ FormatNamed()

template<typename... TArguments>
FText FText::FormatNamed ( FTextFormat Fmt,
TArguments &&... Args )
static

Format the given list of variadic key->value pairs as named arguments within the given format pattern

Note
You may want to pre-compile your FText pattern into a FTextFormat prior to performing formats within a loop or on a critical path, as this can save CPU cycles, memory, and mutex resources vs re-compiling the pattern for each format call. See FTextFormat for more info.

@usage FText::FormatNamed(LOCTEXT("PlayerNameFmt", "{PlayerName} is really cool"), TEXT("PlayerName"), FText::FromString(PlayerName));

Parameters
FmtThe format pattern to use
ArgsA variadic list of "key then value" pairs to inject into the format pattern (must be an even number)
Returns
The formatted FText

Definition at line 1010 of file Text.h.

◆ FormatNamedImpl()

static FText FText::FormatNamedImpl ( FTextFormat && Fmt,
FFormatNamedArguments && InArguments )
staticprivate

◆ FormatOrdered()

template<typename... TArguments>
FText FText::FormatOrdered ( FTextFormat Fmt,
TArguments &&... Args )
static

Format the given list of variadic values as ordered arguments within the given format pattern

Note
You may want to pre-compile your FText pattern into a FTextFormat prior to performing formats within a loop or on a critical path, as this can save CPU cycles, memory, and mutex resources vs re-compiling the pattern for each format call. See FTextFormat for more info.

@usage FText::FormatOrdered(LOCTEXT("PlayerNameFmt", "{0} is really cool"), FText::FromString(PlayerName));

Parameters
FmtThe format pattern to use
ArgsA variadic list of values to inject into the format pattern
Returns
The formatted FText

Definition at line 1021 of file Text.h.

◆ FormatOrderedImpl()

static FText FText::FormatOrderedImpl ( FTextFormat && Fmt,
FFormatOrderedArguments && InArguments )
staticprivate

◆ FromName()

static FText FText::FromName ( const FName & Val)
static

Generate an FText representing the pass name

◆ FromString() [1/2]

static FText FText::FromString ( const FString & String)
static

Generate an FText representing the passed in string

◆ FromString() [2/2]

static FText FText::FromString ( FString && String)
static

◆ FromStringTable()

static FText FText::FromStringTable ( const FName InTableId,
const FString & InKey,
const EStringTableLoadingPolicy InLoadingPolicy = EStringTableLoadingPolicy::FindOrLoad )
static

Attempts to create an FText instance from a string table ID and key (this is the same as the LOCTABLE macro, except this can also work with non-literal string values).

Returns
The found text, or a dummy FText if not found.

◆ FromStringView()

static FText FText::FromStringView ( FStringView InString)
static

Generate a FText representing the passed string view

◆ FromTextGenerator()

static FText FText::FromTextGenerator ( const TSharedRef< ITextGenerator > & TextGenerator)
static

Produces a custom-generated FText. Can be used for objects that produce text dependent on localized strings but that do not fit the standard formats.

Parameters
TextGeneratorthe text generator object that will generate the text

◆ GetEmpty()

static const FText & FText::GetEmpty ( )
static

◆ GetFormatPatternParameters()

static void FText::GetFormatPatternParameters ( const FTextFormat & Fmt,
TArray< FString > & ParameterNames )
static

◆ GetHistoricFormatData()

void FText::GetHistoricFormatData ( TArray< FHistoricTextFormatData > & OutHistoricFormatData) const
private

Get any historic text format data from the history used by this FText

◆ GetHistoricNumericData()

bool FText::GetHistoricNumericData ( FHistoricTextNumericData & OutHistoricNumericData) const
private

Get any historic numeric format data from the history used by this FText

◆ GetInvariantTimeZone()

static FString FText::GetInvariantTimeZone ( )
static

Gets the time zone string that represents a non-specific, zero offset, culture invariant time zone.

◆ IdenticalTo()

bool FText::IdenticalTo ( const FText & Other,
const ETextIdenticalModeFlags CompareModeFlags = ETextIdenticalModeFlags::None ) const

Check to see if this FText is identical to the other FText

Note
This function defaults to only testing that the internal data has the same target (which makes it very fast!), rather than performing any deep or lexical analysis. The ETextIdenticalModeFlags can modify this default behavior. See the comments on those flag options for more information.
If you actually want to perform a full lexical comparison, then you need to use EqualTo instead.

◆ IsCultureInvariant()

bool FText::IsCultureInvariant ( ) const

◆ IsEmpty()

bool FText::IsEmpty ( ) const

◆ IsEmptyOrWhitespace()

bool FText::IsEmptyOrWhitespace ( ) const

◆ IsFromStringTable()

bool FText::IsFromStringTable ( ) const

◆ IsInitializedFromString()

bool FText::IsInitializedFromString ( ) const

◆ IsNumeric()

bool FText::IsNumeric ( ) const

◆ IsTransient()

bool FText::IsTransient ( ) const

◆ IsWhitespace()

static bool FText::IsWhitespace ( const TCHAR Char)
static

Check to see if the given character is considered whitespace by the current culture

◆ Join() [1/3]

template<typename... ArgTypes>
static FORCEINLINE FText FText::Join ( const FText & Delimiter,
ArgTypes... Args )
inlinestatic

Join an arbitrary list of formattable items together, separated by the given delimiter

Note
Internally this uses FText::Format with a generated culture invariant format pattern
Parameters
DelimiterThe delimiter to insert between the items
ArgsA variadic list of values to join together
Returns
The joined FText

Definition at line 653 of file Text.h.

◆ Join() [2/3]

static FText FText::Join ( const FText & Delimiter,
const FFormatOrderedArguments & Args )
static

Join an arbitrary list of formattable values together, separated by the given delimiter

Note
Internally this uses FText::Format with a generated culture invariant format pattern
Parameters
DelimiterThe delimiter to insert between the items
ArgsAn array of formattable values to join together
Returns
The joined FText

◆ Join() [3/3]

static FText FText::Join ( const FText & Delimiter,
const TArray< FText > & Args )
static

◆ operator=() [1/2]

FText & FText::operator= ( const FText & )
default

◆ operator=() [2/2]

FText & FText::operator= ( FText && )
default

◆ Rebuild()

void FText::Rebuild ( ) const
private

Rebuilds the FText under the current culture if needed

◆ RegisterTextGenerator() [1/3]

template<typename T >
static void FText::RegisterTextGenerator ( )
inlinestatic

Registers a standard text generator factory function.

Template Parameters
Tthe text generator class type

This function can be used if the class has a public static FName member named "TypeID".

Definition at line 706 of file Text.h.

◆ RegisterTextGenerator() [2/3]

template<typename T >
static void FText::RegisterTextGenerator ( FName TypeID)
inlinestatic

Registers a standard text generator factory function.

Template Parameters
Tthe text generator class type
Parameters
TypeIDthe name under which to register the factor function

Definition at line 693 of file Text.h.

◆ RegisterTextGenerator() [3/3]

static void FText::RegisterTextGenerator ( FName TypeID,
FCreateTextGeneratorDelegate FactoryFunction )
static

Registers a factory function to be used with serialization of text generators within FText.

Parameters
TypeIDthe name under which to register the factory function. Must match ITextGenerator::GetTypeID().
FactoryFunctionthe factory function to create the generator instance

◆ SerializeText() [1/2]

static void FText::SerializeText ( FArchive & Ar,
FText & Value )
staticprivate

◆ SerializeText() [2/2]

static void FText::SerializeText ( FStructuredArchive::FSlot Slot,
FText & Value )
staticprivate

◆ ShouldGatherForLocalization()

bool FText::ShouldGatherForLocalization ( ) const

◆ ToLower()

FText FText::ToLower ( ) const

Transforms the text to lowercase in a culture correct way.

Note
The returned instance is linked to the original and will be rebuilt if the active culture is changed.

◆ ToString()

const FString & FText::ToString ( ) const

◆ ToUpper()

FText FText::ToUpper ( ) const

Transforms the text to uppercase in a culture correct way.

Note
The returned instance is linked to the original and will be rebuilt if the active culture is changed.

◆ TrimPreceding()

static FText FText::TrimPreceding ( const FText & )
static

Removes any whitespace characters from the start of the text.

◆ TrimPrecedingAndTrailing()

static FText FText::TrimPrecedingAndTrailing ( const FText & )
static

Removes any whitespace characters from the start and end of the text.

◆ TrimTrailing()

static FText FText::TrimTrailing ( const FText & )
static

Removes any whitespace characters from the end of the text.

◆ UnregisterTextGenerator() [1/2]

template<typename T >
static void FText::UnregisterTextGenerator ( )
inlinestatic

Unregisters a standard text generator factory function.

This function can be used if the class has a public static FName member named "TypeID".

Template Parameters
Tthe text generator class type

Definition at line 728 of file Text.h.

◆ UnregisterTextGenerator() [2/2]

static void FText::UnregisterTextGenerator ( FName TypeID)
static

Unregisters a factory function to be used with serialization of text generators within FText.

Parameters
TypeIDthe name to remove from registration
See also
RegisterTextGenerator

Friends And Related Symbol Documentation

◆ FArchive

Definition at line 802 of file Text.h.

◆ FArchiveFromStructuredArchiveImpl

friend class FArchiveFromStructuredArchiveImpl
friend

Definition at line 803 of file Text.h.

◆ FFormatArgumentValue

Definition at line 807 of file Text.h.

◆ FJsonArchiveInputFormatter

friend class FJsonArchiveInputFormatter
friend

Definition at line 804 of file Text.h.

◆ FJsonArchiveOutputFormatter

friend class FJsonArchiveOutputFormatter
friend

Definition at line 805 of file Text.h.

◆ FScopedTextIdentityPreserver

friend class FScopedTextIdentityPreserver
friend

Definition at line 812 of file Text.h.

◆ FStringTableRegistry

friend class FStringTableRegistry
friend

Definition at line 801 of file Text.h.

◆ FTextCache

friend class FTextCache
friend

Definition at line 795 of file Text.h.

◆ FTextFormatData

friend class FTextFormatData
friend

Definition at line 797 of file Text.h.

◆ FTextFormatter

friend class FTextFormatter
friend

Definition at line 796 of file Text.h.

◆ FTextHistory_ArgumentDataFormat

friend class FTextHistory_ArgumentDataFormat
friend

Definition at line 809 of file Text.h.

◆ FTextHistory_NamedFormat

friend class FTextHistory_NamedFormat
friend

Definition at line 808 of file Text.h.

◆ FTextHistory_OrderedFormat

friend class FTextHistory_OrderedFormat
friend

Definition at line 810 of file Text.h.

◆ FTextHistory_Transform

friend class FTextHistory_Transform
friend

Definition at line 811 of file Text.h.

◆ FTextInspector

Definition at line 799 of file Text.h.

◆ FTextProperty

friend class FTextProperty
friend

Definition at line 806 of file Text.h.

◆ FTextSnapshot

Definition at line 798 of file Text.h.

◆ FTextStringHelper

Definition at line 800 of file Text.h.

Member Data Documentation

◆ Flags

uint32 FText::Flags
private

Flags with various information on what sort of FText this is

Definition at line 792 of file Text.h.

◆ TextData

TSharedRef<ITextData, ESPMode::ThreadSafe> FText::TextData
private

The internal shared data for this FText

Definition at line 789 of file Text.h.


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