#include <C4LangStringTable.h>
Classes | |
class | NoSuchTranslation |
Public Member Functions | |
C4LangStringTable ()=default | |
const std::string & | Translate (const std::string &text) const |
bool | HasTranslation (const std::string &text) const |
void | ReplaceStrings (StdStrBuf &rBuf) |
void | ReplaceStrings (const StdStrBuf &rBuf, StdStrBuf &rTarget) |
void | AddRef () |
void | DelRef () |
const char * | GetFilePath () const |
void | Clear () |
const char * | GetData () const |
const StdStrBuf & | GetDataBuf () const |
size_t | GetDataSize () const |
bool | Load (C4Group &hGroup, const char *szFilename, const char *szLanguage=nullptr) |
bool | Load (C4GroupSet &hGroupSet, const char *szFilename, const char *szLanguage=nullptr) |
bool | GetLanguageString (const char *szLanguage, StdStrBuf &rTarget) |
Static Public Member Functions | |
static C4LangStringTable & | GetSystemStringTable () |
Protected Member Functions | |
void | OnLoad () override |
void | CopyFilePathFromGroup (const C4Group &hGroup) |
void | FinishLoad (const StdStrBuf &, C4Group &hGroup) |
Protected Attributes | |
StdCopyStrBuf | Data |
StdCopyStrBuf | Filename |
StdCopyStrBuf | FilePath |
Definition at line 23 of file C4LangStringTable.h.
|
default |
|
inline |
Definition at line 39 of file C4LangStringTable.h.
Referenced by C4ScriptHost::Load(), and C4ScriptHost::LoadData().
|
inlineinherited |
Definition at line 29 of file C4ComponentHost.h.
References StdStrBuf::Clear(), C4ComponentHost::Data, and C4ComponentHost::OnLoad().
Referenced by C4Game::Clear(), C4Def::Clear(), C4ScriptHost::Clear(), C4Language::ClearLanguage(), C4Def::Default(), C4ComponentHost::Load(), and C4ComponentHost::~C4ComponentHost().
|
protectedinherited |
Definition at line 120 of file C4ComponentHost.cpp.
References StdStrBuf::Append(), StdStrBuf::AppendBackslash(), C4Config::AtRelativePath(), Config, StdStrBuf::Copy(), C4ComponentHost::Filename, C4ComponentHost::FilePath, StdStrBuf::getData(), and C4Group::GetFullName().
Referenced by C4ComponentHost::FinishLoad(), and C4ComponentHost::Load().
|
inline |
Definition at line 40 of file C4LangStringTable.h.
Referenced by C4ScriptHost::Clear(), C4ScriptHost::Load(), C4Game::LoadAdditionalSystemGroup(), and C4ScriptHost::LoadData().
Definition at line 99 of file C4ComponentHost.cpp.
References C4ComponentHost::CopyFilePathFromGroup(), C4ComponentHost::Data, StdStrBuf::EnsureUnicode(), C4ComponentHost::Filename, C4ComponentHost::FilePath, C4Group::FindEntry(), StdStrBuf::getData(), StdStrBuf::getSize(), LogF(), StdStrBuf::Move(), C4ComponentHost::OnLoad(), and StdStrBuf::Shrink().
Referenced by C4ComponentHost::Load().
|
inlineinherited |
Definition at line 30 of file C4ComponentHost.h.
References C4ComponentHost::Data, and StdStrBuf::getData().
Referenced by C4Game::CompileRuntimeData(), C4RankSystem::Load(), C4ScenarioListLoader::Entry::Load(), C4Player::LoadRuntimeData(), C4ObjectInfoList::New(), and C4Game::OpenScenario().
|
inlineinherited |
Definition at line 31 of file C4ComponentHost.h.
References C4ComponentHost::Data.
Referenced by C4Game::CompileRuntimeData(), C4Language::HasStringTable(), and C4ScriptHost::MakeScript().
|
inlineinherited |
Definition at line 32 of file C4ComponentHost.h.
References C4ComponentHost::Data, and StdStrBuf::getLength().
Referenced by C4RankSystem::Load().
|
inlineinherited |
Definition at line 28 of file C4ComponentHost.h.
References C4ComponentHost::FilePath, and StdStrBuf::getData().
Referenced by C4ScriptHost::Load(), C4Player::LoadRuntimeData(), C4ScriptHost::ReloadScript(), and ReplaceStrings().
|
inherited |
Definition at line 127 of file C4ComponentHost.cpp.
References StdStrBuf::Copy(), C4ComponentHost::Data, StdStrBuf::getData(), SAppend(), SCharPos(), SCopySegment(), and SSearch().
Referenced by C4DefList::Load(), C4ScenarioListLoader::Entry::Load(), and C4Game::OpenScenario().
|
inlinestatic |
Definition at line 48 of file C4LangStringTable.h.
Referenced by C4Language::ClearLanguage(), C4Language::HasStringTable(), and LoadResStr().
bool C4LangStringTable::HasTranslation | ( | const std::string & | text | ) | const |
Definition at line 23 of file C4LangStringTable.cpp.
References C4ScriptGuiWindowPropertyName::text.
|
inherited |
Definition at line 23 of file C4ComponentHost.cpp.
References _MAX_FNAME_LEN, C4ComponentHost::Clear(), StdStrBuf::Copy(), C4ComponentHost::CopyFilePathFromGroup(), C4ComponentHost::Data, C4ComponentHost::Filename, C4ComponentHost::FinishLoad(), StdStrBuf::Format(), StdStrBuf::getData(), StdStrBuf::getMData(), C4Group::LoadEntryString(), SCopySegment(), SReplaceChar(), and SSearch().
Referenced by C4Game::CompileRuntimeData(), C4Game::InitScriptEngine(), C4ScriptHost::Load(), C4ScenarioListLoader::Entry::Load(), C4Language::LoadComponentHost(), and C4Game::LoadScenarioComponents().
|
inherited |
Definition at line 60 of file C4ComponentHost.cpp.
References _MAX_FNAME_LEN, C4ComponentHost::Clear(), StdStrBuf::Copy(), C4ComponentHost::CopyFilePathFromGroup(), C4ComponentHost::Data, C4ComponentHost::Filename, C4GroupSet::FindEntry(), C4ComponentHost::FinishLoad(), StdStrBuf::Format(), StdStrBuf::getData(), C4GroupSet::GetGroup(), StdStrBuf::getMData(), C4GroupSet::LoadEntryString(), SCopySegment(), SReplaceChar(), and SSearch().
|
inlineoverrideprotectedvirtual |
Reimplemented from C4ComponentHost.
Definition at line 50 of file C4LangStringTable.h.
Definition at line 91 of file C4LangStringTable.cpp.
References C4MaxName, StdStrBuf::Clear(), C4ComponentHost::Data, StdStrBuf::getData(), C4ComponentHost::GetFilePath(), StdStrBuf::getLength(), StdStrBuf::getMData(), IsIdentifier(), LogF(), SCopy(), SCopyUntil(), StdStrBuf::SetLength(), SLen(), SReplaceChar(), SSearch(), String(), StdStrBuf::Take(), and Translate().
void C4LangStringTable::ReplaceStrings | ( | StdStrBuf & | rBuf | ) |
Definition at line 168 of file C4LangStringTable.cpp.
Referenced by C4MapFolderData::Load(), C4ScenarioParameterDefs::Load(), C4TeamList::Load(), C4PlayerControlFile::Load(), C4PlayerInfoList::Load(), C4ScriptHost::LoadData(), and C4ScriptHost::MakeScript().
const std::string & C4LangStringTable::Translate | ( | const std::string & | text | ) | const |
Definition at line 30 of file C4LangStringTable.cpp.
References C4ScriptGuiWindowPropertyName::text.
Referenced by LoadResStr(), ReplaceStrings(), and C4ScriptHost::Translate().
|
protectedinherited |
Definition at line 41 of file C4ComponentHost.h.
Referenced by C4ComponentHost::Clear(), C4ComponentHost::FinishLoad(), C4ComponentHost::GetData(), C4ComponentHost::GetDataBuf(), C4ComponentHost::GetDataSize(), C4ComponentHost::GetLanguageString(), C4ComponentHost::Load(), and ReplaceStrings().
|
protectedinherited |
Definition at line 42 of file C4ComponentHost.h.
Referenced by C4ComponentHost::CopyFilePathFromGroup(), C4ComponentHost::FinishLoad(), and C4ComponentHost::Load().
|
protectedinherited |
Definition at line 43 of file C4ComponentHost.h.
Referenced by C4ComponentHost::CopyFilePathFromGroup(), C4ComponentHost::FinishLoad(), and C4ComponentHost::GetFilePath().