mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/4jcraft.git
synced 2026-05-23 11:26:16 +00:00
refactor: unglob std::wstring
This commit is contained in:
@@ -17,16 +17,16 @@ StringTable::StringTable(PBYTE pbData, DWORD dwSize)
|
||||
int versionNumber = dis.readInt();
|
||||
int languagesCount = dis.readInt();
|
||||
|
||||
vector< pair<wstring, int> > langSizeMap;
|
||||
vector< pair<std::wstring, int> > langSizeMap;
|
||||
for(int i = 0; i < languagesCount; ++i)
|
||||
{
|
||||
wstring langId = dis.readUTF();
|
||||
std::wstring langId = dis.readUTF();
|
||||
int langSize = dis.readInt();
|
||||
|
||||
langSizeMap.push_back( vector< pair<wstring, int> >::value_type(langId, langSize));
|
||||
langSizeMap.push_back( vector< pair<std::wstring, int> >::value_type(langId, langSize));
|
||||
}
|
||||
|
||||
vector<wstring> locales;
|
||||
vector<std::wstring> locales;
|
||||
app.getLocale(locales);
|
||||
|
||||
bool foundLang = false;
|
||||
@@ -74,20 +74,20 @@ StringTable::StringTable(PBYTE pbData, DWORD dwSize)
|
||||
int langVersion = dis2.readInt();
|
||||
|
||||
isStatic = false; // 4J-JEV: Versions 1 and up could use
|
||||
if (langVersion > 0) // integers rather than wstrings as keys.
|
||||
if (langVersion > 0) // integers rather than std::wstrings as keys.
|
||||
isStatic = dis2.readBoolean();
|
||||
|
||||
wstring langId = dis2.readUTF();
|
||||
std::wstring langId = dis2.readUTF();
|
||||
int totalStrings = dis2.readInt();
|
||||
|
||||
if (!isStatic)
|
||||
{
|
||||
for(int i = 0; i < totalStrings; ++i)
|
||||
{
|
||||
wstring stringId = dis2.readUTF();
|
||||
wstring stringValue = dis2.readUTF();
|
||||
std::wstring stringId = dis2.readUTF();
|
||||
std::wstring stringValue = dis2.readUTF();
|
||||
|
||||
m_stringsMap.insert( std::unordered_map<wstring, wstring>::value_type(stringId, stringValue) );
|
||||
m_stringsMap.insert( std::unordered_map<std::wstring, std::wstring>::value_type(stringId, stringValue) );
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -125,7 +125,7 @@ void StringTable::getData(PBYTE *ppData, UINT *pSize)
|
||||
*pSize = src.length;
|
||||
}
|
||||
|
||||
LPCWSTR StringTable::getString(const wstring &id)
|
||||
LPCWSTR StringTable::getString(const std::wstring &id)
|
||||
{
|
||||
#ifndef _CONTENT_PACKAGE
|
||||
if (isStatic)
|
||||
|
||||
Reference in New Issue
Block a user