Ejemplo n.º 1
0
void AccountMap::Find( const ID& id, const class Account* account ) {
  SkipListNode* node = Next(ninf);

  size_t i = id.find_first_of("?*");

  string id_key;
  bool key_not_used = true;
  if (i == string::npos) {
    id_key = id;
    key_not_used = false;
    if(!Find(id_key, node)) node = Next(node);
  } else if (i > 0) {
    id_key = id.substr(0, i);
    key_not_used = false;
    if(!Find(id_key, node)) node = Next(node);
  }

  bool comma = false;
  while (node->data_id.front() != '{' && (key_not_used || \
         node->data_id.compare(0, i, id_key) == 0)) {
    if (match_recursion(id, node->data_id, 0, 0) && \
        account != node->data_account) {
      if (comma) {
        cout << ',';
      }
      cout << node->data_id;
      comma = true;
    }
    node = Next(node);
  }


}