本文整理汇总了C++中database::Results::HasColumn方法的典型用法代码示例。如果您正苦于以下问题:C++ Results::HasColumn方法的具体用法?C++ Results::HasColumn怎么用?C++ Results::HasColumn使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类database::Results
的用法示例。
在下文中一共展示了Results::HasColumn方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CacheGameDatabaseData
//------------------------------------------------------------------------------
bool CvDllDatabaseUtility::CacheGameDatabaseData()
{
//Do not cache everything if we don't need to.
if(m_bGameDatabaseNeedsCaching == false)
return true;
//The following code depends on a valid initialized database.
bool bSuccess = true;
//TODO: Figure out how to handle cases where Validation has failed.
/*bSuccess &= */
ValidateGameDatabase();
//bSuccess &= PerformDatabasePostProcessing();
//HACK Legacy 'FindInfoByType' support.
//In order to support the legacy code still using the old infos system,
//all of the id/type pairs must be added to gc.m_infosMap
//I apologize for this horrendous code, please remove it in the near future.
GC.infoTypeFromStringReset();
Database::Results kTables("name");
if(DB.SelectAt(kTables, "sqlite_master", "type", "table"))
{
while(kTables.Step())
{
Database::Results kTypes;
if(DB.SelectAll(kTypes, kTables.GetText(0)))
{
bool bFirstStep = true;
while(kTypes.Step())
{
if(bFirstStep)
{
if(!kTypes.HasColumn("ID") || !kTypes.HasColumn("Type"))
{
break;
}
bFirstStep = false;
}
const int rowid = kTypes.GetInt("ID");
const char* szType = kTypes.GetText("Type");
if(szType)
GC.setInfoTypeFromString(szType, rowid);
}
}
}
}
bSuccess &= LoadGlobalDefines();
bSuccess &= PrefetchGameData();
bSuccess &= UpdatePlayableCivilizationCounts();
CvTypes::AcquireTypes(DB);
bSuccess &= SetGlobalActionInfo();
//Clear out database cache and tune for runtime use.
DB.ClearCountCache();
//Log Database Memory statistics
LogMsg(DB.CalculateMemoryStats());
CvAssertMsg(bSuccess, "Failed to load Gameplay Database Data! Not Good!");
if(bSuccess)
m_bGameDatabaseNeedsCaching = false;
#if defined(CUSTOM_MODS_H)
// Load up the CustomModOptions configuration
gCustomMods.preloadCache();
#endif
return bSuccess;
}