1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-16 02:01:59 +02:00

* For debugging: `nix --verify' to check the consistency of the

database and store.
This commit is contained in:
Eelco Dolstra 2003-07-17 12:27:55 +00:00
parent 71cc3ceae5
commit b3fc38bf6a
7 changed files with 139 additions and 14 deletions

View file

@ -157,7 +157,7 @@ void delDB(const string & filename, const string & dbname,
void enumDB(const string & filename, const string & dbname,
DBPairs & contents)
Strings & keys)
{
try {
@ -168,11 +168,9 @@ void enumDB(const string & filename, const string & dbname,
DbcClose cursorCloser(cursor);
Dbt kt, dt;
while (cursor->get(&kt, &dt, DB_NEXT) != DB_NOTFOUND) {
string key((char *) kt.get_data(), kt.get_size());
string data((char *) dt.get_data(), dt.get_size());
contents.push_back(DBPair(key, data));
}
while (cursor->get(&kt, &dt, DB_NEXT) != DB_NOTFOUND)
keys.push_back(
string((char *) kt.get_data(), kt.get_size()));
} catch (DbException e) { rethrow(e); }
}