ArticyXImporter
ArticyXImporter for Unreal Engine
Loading...
Searching...
No Matches
StringTableGenerator Class Reference

A class to generate and manage string tables in CSV format. More...

#include <StringTableGenerator.h>

Public Member Functions

template<typename Lambda>
void SafeExecute (Lambda Lamb)
 Executes a lambda safely.
template<typename Lambda>
 StringTableGenerator (const FString &TableName, const FString &Culture, Lambda ContentGenerator)
 Constructs a StringTableGenerator and executes a content generator lambda.
void Line (const FString &Key="", const FString &SourceString="")
 Adds a line to the content string.
template<>
void SafeExecute (nullptr_t Lamb)

Detailed Description

A class to generate and manage string tables in CSV format.

This class holds a content string that can be written to a CSV file. It is used for generating string tables for localization purposes, where each entry consists of a key and its corresponding source string.

Constructor & Destructor Documentation

◆ StringTableGenerator()

template<typename Lambda>
StringTableGenerator::StringTableGenerator ( const FString & TableName,
const FString & Culture,
Lambda ContentGenerator )

Constructs a StringTableGenerator and executes a content generator lambda.

This constructor initializes the file path and prepares the CSV header. It then executes the provided lambda function to generate content and writes it to a file.

Template Parameters
LambdaThe type of the lambda function.
Parameters
TableNameThe name of the string table.
CultureThe culture/language code for localization.
ContentGeneratorA lambda function to generate the content of the string table.

Member Function Documentation

◆ Line()

void StringTableGenerator::Line ( const FString & Key = "",
const FString & SourceString = "" )

Adds a line to the content string.

Parameters
KeyThe key for the string entry.
SourceStringThe source string for the entry.

◆ SafeExecute()

template<typename Lambda>
void StringTableGenerator::SafeExecute ( Lambda Lamb)

Executes a lambda safely.

This method executes a given lambda function. If the lambda is nullptr, it does nothing.

Template Parameters
LambdaThe type of the lambda function.
Parameters
LambThe lambda function to execute.

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