class StringTableManager

Manages string tables used for localizing text.

Allows you to add and remove different tables and change the active language.

Public

Constructors

StringTableManager

StringTableManager() = default

Methods

SetActiveLanguage

void SetActiveLanguage(Language language)

Determines the currently active language.

Any newly created strings will use this value.

GetActiveLanguage

Language GetActiveLanguage() const

GetTable

HStringTable GetTable(u32 id)

Returns the string table with the specified id.

If the table doesn't exist new one is created.

id
Identifier of the string table.

Returns: String table with the specified identifier.

RemoveTable

void RemoveTable(u32 id)

Removes the string table with the specified id.

id
Identifier of the string table.

SetTable

void SetTable(u32 id, const HStringTable &table)

Registers a new string table or replaces an old one at the specified id.

id
Identifier of the string table.
table
New string table to assign to the specified identifier.

staticInstance

static T &Instance()

Returns a reference to the module instance.

Module has to have been started up first otherwise an exception will be thrown.

staticInstancePtr

static T *InstancePtr()

Returns a pointer to the module instance.

Module has to have been started up first otherwise an exception will be thrown.

staticShutDown

static void ShutDown()

Shuts down this module and frees any resources it is using.

staticIsStarted

static bool IsStarted()

Query if the module has been started.

Protected

Methods

~Module<T>

virtual ~Module<T>() = default

OnStartUp

virtual void OnStartUp()

Override if you want your module to be notified once it has been constructed and started.

OnShutDown

virtual void OnShutDown()

Override if you want your module to be notified just before it is deleted.

staticInstanceInternal

static T *&InstanceInternal()

Returns a singleton instance of this module.

staticIsDestroyed

static bool &IsDestroyed()

Checks has the Module been shut down.

staticIsStartedUp

static bool &IsStartedUp()

Checks has the Module been started up.

Private

Fields

mActiveLanguage

Language mActiveLanguage

mTables

UnorderedMap<u32, HStringTable> mTables