本文整理汇总了C++中CCDictionary::erase方法的典型用法代码示例。如果您正苦于以下问题:C++ CCDictionary::erase方法的具体用法?C++ CCDictionary::erase怎么用?C++ CCDictionary::erase使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CCDictionary
的用法示例。
在下文中一共展示了CCDictionary::erase方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: RecurseDestroy
void RecurseDestroy(CCObject * pObj)
{
if (pObj == NULL) return;
if (pObj->isOfClass(CCObject::ClassOfCCDictionary))
{
CCDictionary * pDict = (CCDictionary *)pObj;
CCDictionary::const_iterator itDict = pDict->begin();
while(itDict != pDict->end())
{
RecurseDestroy(itDict->second);
itDict++;
}
pDict->erase(pDict->begin(), pDict->end());
V_SAFE_DELETE(pDict);
}
else if (pObj->isOfClass(CCObject::ClassOfCCArray))
{
CCArray * pArray = (CCArray *)pObj;
int iCount = (int)pArray->size();
for (int i = 0; i < iCount; i++)
{
RecurseDestroy((*pArray)[i]);
}
V_SAFE_DELETE(pArray);
}
else if (pObj->isOfClass(CCObject::ClassOfCCString))
{
CCString * pString = (CCString*)pObj;
V_SAFE_DELETE(pString);
}
else
{
V_SAFE_DELETE(pObj);
}
}