mirror of
https://github.com/GabsPuNs/Project-Zenith-Main.git
synced 2026-05-21 18:24:34 +00:00
51 lines
987 B
C++
51 lines
987 B
C++
#pragma once
|
|
|
|
using namespace std;
|
|
|
|
#if defined(__PS3__) || defined(__ORBIS__) || defined __PSVITA__
|
|
#define LOCALE_COUNT 21
|
|
#elif defined _XBOX_ONE
|
|
#define LOCALE_COUNT 19
|
|
#else
|
|
#define LOCALE_COUNT 11
|
|
#endif
|
|
|
|
class StringTable
|
|
{
|
|
private:
|
|
bool isStatic;
|
|
|
|
unordered_map<wstring, wstring> m_stringsMap;
|
|
vector<wstring> m_stringsVec;
|
|
|
|
vector<pair<wstring, int>> m_langSizeMap;
|
|
wstring currentLanguage;
|
|
|
|
byteArray src;
|
|
|
|
public:
|
|
|
|
StringTable(void);
|
|
StringTable(PBYTE pbData, DWORD dwSize);
|
|
~StringTable(void);
|
|
|
|
void ReloadStringTable();
|
|
void Reset(); // TU30
|
|
|
|
void write(DataOutputStream* dos); // TU30
|
|
|
|
void getData(PBYTE *ppbData, UINT *pdwSize);
|
|
|
|
LPCWSTR getString(const wstring &id);
|
|
LPCWSTR getString(int id);
|
|
|
|
private:
|
|
void ProcessStringTableData(void);
|
|
|
|
// From TU30
|
|
void ReadAllFromStream(DataInputStream* dis);
|
|
bool FindLanguage(wstring& outLangId, int64_t& outBytesToSkip, int& outDataSize);
|
|
void ReadLanguageFromStream(DataInputStream* dis, int dataSize);
|
|
};
|
|
|