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

#include <TextFormatter.h>

Public Types

typedef TFunction< TSharedPtr< ITextFormatArgumentModifier >(const FTextFormatString &, FTextFormatPatternDefinitionConstRef)> FCompileTextArgumentModifierFuncPtr
 

Public Member Functions

CORE_API void RegisterTextArgumentModifier (const FTextFormatString &InKeyword, FCompileTextArgumentModifierFuncPtr InCompileFunc)
 
CORE_API void UnregisterTextArgumentModifier (const FTextFormatString &InKeyword)
 
CORE_API FCompileTextArgumentModifierFuncPtr FindTextArgumentModifier (const FTextFormatString &InKeyword) const
 

Static Public Member Functions

static CORE_API FTextFormatterGet ()
 
static CORE_API FText Format (FTextFormat &&InFmt, FFormatNamedArguments &&InArguments, const bool bInRebuildText, const bool bInRebuildAsSource)
 
static CORE_API FText Format (FTextFormat &&InFmt, FFormatOrderedArguments &&InArguments, const bool bInRebuildText, const bool bInRebuildAsSource)
 
static CORE_API FText Format (FTextFormat &&InFmt, TArray< FFormatArgumentData > &&InArguments, const bool bInRebuildText, const bool bInRebuildAsSource)
 
static CORE_API FString FormatStr (const FTextFormat &InFmt, const FFormatNamedArguments &InArguments, const bool bInRebuildText, const bool bInRebuildAsSource)
 
static CORE_API FString FormatStr (const FTextFormat &InFmt, const FFormatOrderedArguments &InArguments, const bool bInRebuildText, const bool bInRebuildAsSource)
 
static CORE_API FString FormatStr (const FTextFormat &InFmt, const TArray< FFormatArgumentData > &InArguments, const bool bInRebuildText, const bool bInRebuildAsSource)
 
static CORE_API FString Format (const FTextFormat &InFmt, const FPrivateTextFormatArguments &InFormatArgs)
 
static CORE_API void ArgumentValueToFormattedString (const FFormatArgumentValue &InValue, const FPrivateTextFormatArguments &InFormatArgs, FString &OutResult)
 

Detailed Description

A text formatter is responsible for formatting text patterns using a set of named or ordered arguments.

Member Typedef Documentation

◆ FCompileTextArgumentModifierFuncPtr

Callback function used to compile an argument modifier. Takes an argument modifier string and pattern definition, then returns the compiled result.

Member Function Documentation

◆ ArgumentValueToFormattedString()

void FTextFormatter::ArgumentValueToFormattedString ( const FFormatArgumentValue InValue,
const FPrivateTextFormatArguments InFormatArgs,
FString &  OutResult 
)
static

Incredibly low-level version of FFormatArgumentValue::ToFormattedString. You should only be calling this if you're implementing a custom argument modifier type that itself needs to convert the argument to a string

◆ FindTextArgumentModifier()

FTextFormatter::FCompileTextArgumentModifierFuncPtr FTextFormatter::FindTextArgumentModifier ( const FTextFormatString InKeyword) const

◆ Format() [1/4]

FString FTextFormatter::Format ( const FTextFormat InFmt,
const FPrivateTextFormatArguments InFormatArgs 
)
static

Incredibly low-level version of format. You should only be calling this if you're implementing a custom argument modifier type that itself needs to format using the private arguments

◆ Format() [2/4]

FText FTextFormatter::Format ( FTextFormat &&  InFmt,
FFormatNamedArguments &&  InArguments,
const bool  bInRebuildText,
const bool  bInRebuildAsSource 
)
static

Low-level versions of Format. You probably want to use FText::Format(...) rather than call these directly

◆ Format() [3/4]

FText FTextFormatter::Format ( FTextFormat &&  InFmt,
FFormatOrderedArguments &&  InArguments,
const bool  bInRebuildText,
const bool  bInRebuildAsSource 
)
static

◆ Format() [4/4]

FText FTextFormatter::Format ( FTextFormat &&  InFmt,
TArray< FFormatArgumentData > &&  InArguments,
const bool  bInRebuildText,
const bool  bInRebuildAsSource 
)
static

◆ FormatStr() [1/3]

FString FTextFormatter::FormatStr ( const FTextFormat InFmt,
const FFormatNamedArguments InArguments,
const bool  bInRebuildText,
const bool  bInRebuildAsSource 
)
static

Low-level version of Format that returns a string. This should typically only be used externally when rebuilding the display string for some formatted text

◆ FormatStr() [2/3]

FString FTextFormatter::FormatStr ( const FTextFormat InFmt,
const FFormatOrderedArguments InArguments,
const bool  bInRebuildText,
const bool  bInRebuildAsSource 
)
static

◆ FormatStr() [3/3]

FString FTextFormatter::FormatStr ( const FTextFormat InFmt,
const TArray< FFormatArgumentData > &  InArguments,
const bool  bInRebuildText,
const bool  bInRebuildAsSource 
)
static

◆ Get()

FTextFormatter & FTextFormatter::Get ( )
static

Singleton access

◆ RegisterTextArgumentModifier()

void FTextFormatter::RegisterTextArgumentModifier ( const FTextFormatString InKeyword,
FCompileTextArgumentModifierFuncPtr  InCompileFunc 
)

◆ UnregisterTextArgumentModifier()

void FTextFormatter::UnregisterTextArgumentModifier ( const FTextFormatString InKeyword)

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