2015-07-26 21:39:49 +00:00
|
|
|
#include "CStringTable.h"
|
|
|
|
|
|
|
|
CStringTable::CStringTable() : CResource()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
CStringTable::~CStringTable()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
EResType CStringTable::Type()
|
|
|
|
{
|
|
|
|
return eStringTable;
|
|
|
|
}
|
|
|
|
|
|
|
|
CResource* CStringTable::MakeCopy(CResCache*)
|
|
|
|
{
|
|
|
|
// Not using parameter 1 (CResCache* - pResCache)
|
|
|
|
return new CStringTable(*this);
|
|
|
|
}
|
|
|
|
|
|
|
|
// ************ SETTERS ************
|
|
|
|
u32 CStringTable::GetStringCount()
|
|
|
|
{
|
|
|
|
return mNumStrings;
|
|
|
|
}
|
|
|
|
|
|
|
|
u32 CStringTable::GetLangCount()
|
|
|
|
{
|
|
|
|
return mLangTables.size();
|
|
|
|
}
|
|
|
|
|
|
|
|
CFourCC CStringTable::GetLangTag(u32 Index)
|
|
|
|
{
|
|
|
|
return mLangTables[Index].Language;
|
|
|
|
}
|
|
|
|
|
2015-11-24 06:08:31 +00:00
|
|
|
TWideString CStringTable::GetString(CFourCC Lang, u32 StringIndex)
|
2015-07-26 21:39:49 +00:00
|
|
|
{
|
|
|
|
for (u32 iLang = 0; iLang < GetLangCount(); iLang++)
|
|
|
|
{
|
|
|
|
if (GetLangTag(iLang) == Lang)
|
|
|
|
return GetString(iLang, StringIndex);
|
|
|
|
}
|
|
|
|
|
|
|
|
return std::wstring();
|
|
|
|
}
|
|
|
|
|
2015-11-24 06:08:31 +00:00
|
|
|
TWideString CStringTable::GetString(u32 LangIndex, u32 StringIndex)
|
2015-07-26 21:39:49 +00:00
|
|
|
{
|
|
|
|
return mLangTables[LangIndex].Strings[StringIndex];
|
|
|
|
}
|
|
|
|
|
2015-11-24 06:08:31 +00:00
|
|
|
TString CStringTable::GetStringName(u32 StringIndex)
|
2015-07-26 21:39:49 +00:00
|
|
|
{
|
|
|
|
return mStringNames[StringIndex];
|
|
|
|
}
|