void CommentHistory::truncate() { StringStorage valueName; StringStorage value; size_t i = (size_t)m_limit; while (true) { valueName.format(_T("%u"), i); if (i >= getCommCount()) { return ; } removeCom(getCom(i)); if (!m_key->getValueAsString(valueName.getString(), &value)) { break; } m_key->deleteSubKey(value.getString()); m_key->deleteValue(valueName.getString()); i++; } load(); }
void Entity::removeAllComs() { for (auto iter=_coms.begin(); iter!=_coms.end();) { const std::string& type=iter->first; iter++; removeCom(type); } }