diff options
author | Eelco Dolstra <e.dolstra@tudelft.nl> | 2006-09-04T21·06+0000 |
---|---|---|
committer | Eelco Dolstra <e.dolstra@tudelft.nl> | 2006-09-04T21·06+0000 |
commit | 75068e7d753cf6cbe45a4bf294000dca9bd41d8b (patch) | |
tree | c6274cc10caab08349b5585206034f41ca4a575f /src/libstore/db.cc | |
parent | aab88127321344d5818d823bff515d127108d058 (diff) |
* Use a proper namespace.
* Optimise header file usage a bit. * Compile the parser as C++.
Diffstat (limited to 'src/libstore/db.cc')
-rw-r--r-- | src/libstore/db.cc | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/src/libstore/db.cc b/src/libstore/db.cc index 7f428dc488e6..ca5d0582a099 100644 --- a/src/libstore/db.cc +++ b/src/libstore/db.cc @@ -1,3 +1,7 @@ +#include "db.hh" +#include "util.hh" +#include "pathlocks.hh" + #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> @@ -7,9 +11,8 @@ #include <db_cxx.h> -#include "db.hh" -#include "util.hh" -#include "pathlocks.hh" + +namespace nix { /* Wrapper class to ensure proper destruction. */ @@ -112,7 +115,7 @@ Db * Database::getDb(TableId table) if (table == 0) throw Error("database table is not open " "(maybe you don't have sufficient permission?)"); - map<TableId, Db *>::iterator i = tables.find(table); + std::map<TableId, Db *>::iterator i = tables.find(table); if (i == tables.end()) throw Error("unknown table id"); return i->second; @@ -263,10 +266,10 @@ void Database::close() try { - for (map<TableId, Db *>::iterator i = tables.begin(); + for (std::map<TableId, Db *>::iterator i = tables.begin(); i != tables.end(); ) { - map<TableId, Db *>::iterator j = i; + std::map<TableId, Db *>::iterator j = i; ++j; closeTable(i->first); i = j; @@ -433,3 +436,6 @@ void Database::enumTable(const Transaction & txn, TableId table, } catch (DbException e) { rethrow(e); } } + + +} |