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

#include <StringFormatter.h>

+ Collaboration diagram for FStringFormatter:

Public Member Functions

 FStringFormatter ()
 
FString Format (const TCHAR *InExpression, const TMap< FString, FStringFormatArg > &InArgs) const
 
FString Format (const TCHAR *InExpression, const TArray< FStringFormatArg > &InArgs) const
 
TValueOrError< FString, FExpressionErrorFormatStrict (const TCHAR *InExpression, const TMap< FString, FStringFormatArg > &InArgs) const
 
TValueOrError< FString, FExpressionErrorFormatStrict (const TCHAR *InExpression, const TArray< FStringFormatArg > &InArgs) const
 

Private Member Functions

TValueOrError< FString, FExpressionErrorFormatInternal (const TCHAR *InExpression, const TMap< FString, FStringFormatArg > &InArgs, bool bStrict) const
 
TValueOrError< FString, FExpressionErrorFormatInternal (const TCHAR *InExpression, const TArray< FStringFormatArg > &InArgs, bool bStrict) const
 

Private Attributes

FTokenDefinitions NamedDefinitions
 
FTokenDefinitions OrderedDefinitions
 
FTokenDefinitions StrictNamedDefinitions
 
FTokenDefinitions StrictOrderedDefinitions
 

Detailed Description

A string formatter is responsible for formatting string patterns using a set of named, or ordered arguments

Definition at line 18 of file StringFormatter.h.

Constructor & Destructor Documentation

◆ FStringFormatter()

FStringFormatter::FStringFormatter ( )

Member Function Documentation

◆ Format() [1/2]

FString FStringFormatter::Format ( const TCHAR * InExpression,
const TArray< FStringFormatArg > & InArgs ) const
inline

Format the specified string using the specified arguments. Replaces instances of {0} with indices from the given array matching the index specified in the token

Parameters
InExpressionA string representing the format expression
InArgsAn array of ordered arguments that match the tokens specified in InExpression
Returns
A string containing the formatted text

Definition at line 47 of file StringFormatter.h.

◆ Format() [2/2]

FString FStringFormatter::Format ( const TCHAR * InExpression,
const TMap< FString, FStringFormatArg > & InArgs ) const
inline

Format the specified string using the specified arguments. Replaces instances of { Argument } with keys in the map matching 'Argument'

Parameters
InExpressionA string representing the format expression
InArgsA map of named arguments that match the tokens specified in InExpression
Returns
A string containing the formatted text

Definition at line 30 of file StringFormatter.h.

◆ FormatInternal() [1/2]

TValueOrError< FString, FExpressionError > FStringFormatter::FormatInternal ( const TCHAR * InExpression,
const TArray< FStringFormatArg > & InArgs,
bool bStrict ) const
private

◆ FormatInternal() [2/2]

TValueOrError< FString, FExpressionError > FStringFormatter::FormatInternal ( const TCHAR * InExpression,
const TMap< FString, FStringFormatArg > & InArgs,
bool bStrict ) const
private

Internal formatting logic

◆ FormatStrict() [1/2]

TValueOrError< FString, FExpressionError > FStringFormatter::FormatStrict ( const TCHAR * InExpression,
const TArray< FStringFormatArg > & InArgs ) const
inline

Format the specified string using the specified arguments. Replaces instances of {0} with indices from the given array matching the index specified in the token

Parameters
InExpressionA string representing the format expression
InArgsAn array of ordered arguments that match the tokens specified in InExpression
Returns
A string containing the formatted text, or an error where InExpression is ill-formed, or contains undefined arguments

Definition at line 75 of file StringFormatter.h.

◆ FormatStrict() [2/2]

TValueOrError< FString, FExpressionError > FStringFormatter::FormatStrict ( const TCHAR * InExpression,
const TMap< FString, FStringFormatArg > & InArgs ) const
inline

Format the specified string using the specified arguments. Replaces instances of { Argument } with keys in the map matching 'Argument'

Parameters
InExpressionA string representing the format expression
InArgsA map of named arguments that match the tokens specified in InExpression
Returns
A string containing the formatted text, or an error where InExpression is ill-formed, or contains undefined arguments

Definition at line 64 of file StringFormatter.h.

Member Data Documentation

◆ NamedDefinitions

FTokenDefinitions FStringFormatter::NamedDefinitions
private

Token definitions for lenient lexers

Definition at line 87 of file StringFormatter.h.

◆ OrderedDefinitions

FTokenDefinitions FStringFormatter::OrderedDefinitions
private

Definition at line 88 of file StringFormatter.h.

◆ StrictNamedDefinitions

FTokenDefinitions FStringFormatter::StrictNamedDefinitions
private

Token definitions for strict lexers

Definition at line 91 of file StringFormatter.h.

◆ StrictOrderedDefinitions

FTokenDefinitions FStringFormatter::StrictOrderedDefinitions
private

Definition at line 92 of file StringFormatter.h.


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