本文整理汇总了C++中idDict::Clear方法的典型用法代码示例。如果您正苦于以下问题:C++ idDict::Clear方法的具体用法?C++ idDict::Clear怎么用?C++ idDict::Clear使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类idDict
的用法示例。
在下文中一共展示了idDict::Clear方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: StripReactionPrefix
//
// stripReactionPrefix()
//
void hhReactionHandler::StripReactionPrefix(idDict &dict) {
const idKeyValue *kv = NULL;//dict.MatchPrefix("reaction");
idDict newDict;
for(int i=0;i<dict.GetNumKeyVals();i++) {
kv = dict.GetKeyVal(i);
idStr key;
key = kv->GetKey();
// Do we have a reaction token to strip out?
if(idStr::FindText(key.c_str(), "reaction") != -1) {
int endPrefix = idStr::FindChar(key.c_str(), '_');
if(endPrefix == -1) {
gameLocal.Error("reactionX_ prefix not found.");
}
idStr realKey(key);
realKey = key.Mid(endPrefix+1, key.Length() - endPrefix - 1);
key = realKey;
}
//dict.Delete(kv->GetKey().c_str());
newDict.Set(key.c_str(), kv->GetValue());
kv = dict.MatchPrefix("reaction", kv);
}
dict.Clear();
dict.Copy(newDict);
}
示例2: Shutdown
/*
============
idCVarSystemLocal::Shutdown
============
*/
void idCVarSystemLocal::Shutdown( void )
{
cvars.DeleteContents( true );
cvarHash.Free();
moveCVarsToDict.Clear();
initialized = false;
}
示例3: MoveCVarsToDict
/*
============
idCVarSystemLocal::MoveCVarsToDict
============
*/
const idDict* idCVarSystemLocal::MoveCVarsToDict( int flags ) const {
moveCVarsToDict.Clear();
for( int i = 0; i < cvars.Num(); i++ ) {
idCVar *cvar = cvars[i];
if ( cvar->GetFlags() & flags ) {
moveCVarsToDict.Set( cvar->GetName(), cvar->GetString() );
}
}
return &moveCVarsToDict;
}
示例4: ReadDict
/*
================
idDemoFile::ReadDict
================
*/
void idDemoFile::ReadDict( idDict &dict ) {
int i, c;
idStr key, val;
dict.Clear();
ReadInt( c );
for( i = 0; i < c; i++ ) {
key = ReadHashString();
val = ReadHashString();
dict.Set( key, val );
}
}