![]() |
UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
|
#include <StringTemplate.h>
Public Member Functions | |
| FStringTemplateResolver (const FStringTemplate &Template, uint32 ResolvedStringSizeHint=0) | |
| const FStringTemplate & | GetTemplate () const |
| void | SetParameterMap (const TMap< FString, FString > *Parameters) |
| void | Advance (FStringView NextNamelessParameterValue) |
| FString | Finalize (uint32 ResolvedStringSizeHint=0) |
It provides the mechanism to resolve a FStringTemplate instance into a string.
To resolve a template into a string, instantiate this class then set all the named parameters with SetParameterMap() before calling Advance() or Finalize().
Once all named parameters have been set (or if you wish to set no named parameters), call Advance() repeatedly, passing in the value of the next nameless parameter. Call Advance() for each nameless parameter you wish to replace.
When you have no more nameless parameters to use or if you have none at all, call Finalize() to complete resolving the string which will be returned by it.
| FStringTemplateResolver::FStringTemplateResolver | ( | const FStringTemplate & | Template, |
| uint32 | ResolvedStringSizeHint = 0 |
||
| ) |
Constructs the resolver using specified Template. You can optionally provide a value for ResolvedStringSizeHint to be used to reserve space in the resolved string.
| void FStringTemplateResolver::Advance | ( | FStringView | NextNamelessParameterValue | ) |
Generates the next section of the string until a nameless parameter is encountered for which NextNamelessParameterValue is used as the replaced value. Call Advance() for each nameless parameter you need to push.
| FString FStringTemplateResolver::Finalize | ( | uint32 | ResolvedStringSizeHint = 0 | ) |
Completes generating the string and returns it. Note: Any subsequent and unresolved nameless parameter will be replaced to the empty string.
|
inline |
Returns the template this resolver is using.
Sets the map of named parameters. Note: make sure all named parameters are set before calling Advance() or Finalize() otherwise you may get an incorrect resolved string.