Exemplo n.º 1
0
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();
}
Exemplo n.º 2
0
void Entity::removeAllComs()
{
    for (auto iter=_coms.begin(); iter!=_coms.end();) {
        const std::string& type=iter->first;
        iter++;
        removeCom(type);
    }
}