本文整理汇总了C++中Language::GetLanguage方法的典型用法代码示例。如果您正苦于以下问题:C++ Language::GetLanguage方法的具体用法?C++ Language::GetLanguage怎么用?C++ Language::GetLanguage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Language
的用法示例。
在下文中一共展示了Language::GetLanguage方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ReloadLanguage
void ArchiveModule::ReloadLanguage(
const TCHAR* lpLanguage
)
{
string strPath = m_strModuleName;
CutToSlash (strPath);
Language* pLanguage = nullptr;
Language* pEnglishLanguage = nullptr;
string strMask = strPath+_T("*.lng");
WIN32_FIND_DATA FindData;
bool bResult = false;
HANDLE hSearch = FindFirstFile(
strMask,
(WIN32_FIND_DATA*)&FindData
);
if ( hSearch != INVALID_HANDLE_VALUE )
{
do {
string strFileName = strPath+FindData.cFileName;
pLanguage = new Language();
if ( pLanguage->LoadFromFile(strFileName) )
{
string strLanguage = pLanguage->GetLanguage();
if ( strLanguage == lpLanguage )
{
if ( m_pLanguage )
delete m_pLanguage;
m_pLanguage = pLanguage;
bResult = true;
}
else
{
if ( strLanguage == _T("English") ) //case??
{
if ( !pEnglishLanguage ) //нам два не надо
pEnglishLanguage = pLanguage;
else
delete pLanguage;
}
else
delete pLanguage;
}
}
else
delete pLanguage;
} while ( !bResult && FindNextFile(hSearch, (WIN32_FIND_DATA*)&FindData) );
FindClose (hSearch);
}
if ( pEnglishLanguage )
{
if ( !bResult )
{
if ( m_pLanguage )
delete m_pLanguage;
m_pLanguage = pEnglishLanguage;
}
else
delete pEnglishLanguage;
}
}