本文整理汇总了C++中QueryResult::GetFieldNames方法的典型用法代码示例。如果您正苦于以下问题:C++ QueryResult::GetFieldNames方法的具体用法?C++ QueryResult::GetFieldNames怎么用?C++ QueryResult::GetFieldNames使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QueryResult
的用法示例。
在下文中一共展示了QueryResult::GetFieldNames方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetDump
std::string PlayerDumpWriter::GetDump(uint32 guid)
{
std::string dump;
dump += "IMPORTANT NOTE: This sql queries not created for apply directly, use '.pdump load' command in console or client chat instead.\n";
dump += "IMPORTANT NOTE: NOT APPLY ITS DIRECTLY to character DB or you will DAMAGE and CORRUPT character DB\n\n";
// revision check guard
QueryResult* result = CharacterDatabase.Query("SELECT * FROM character_db_version LIMIT 1");
if(result)
{
QueryResult::FieldNames const& namesMap = result->GetFieldNames();
std::string reqName;
for(QueryResult::FieldNames::const_iterator itr = namesMap.begin(); itr != namesMap.end(); ++itr)
{
if(itr->second.substr(0,9)=="required_")
{
reqName = itr->second;
break;
}
}
if(!reqName.empty())
{
// this will fail at wrong character DB version
dump += "UPDATE character_db_version SET "+reqName+" = 1 WHERE FALSE;\n\n";
}
else
sLog.outError("Table 'character_db_version' not have revision guard field, revision guard query not added to pdump.");
delete result;
}
else
sLog.outError("Character DB not have 'character_db_version' table, revision guard query not added to pdump.");
for(int i = 0; i < DUMP_TABLE_COUNT; ++i)
DumpTable(dump, guid, dumpTables[i].name, dumpTables[i].name, dumpTables[i].type);
// TODO: Add instance/group..
// TODO: Add a dump level option to skip some non-important tables
return dump;
}