db/update/Service: add SimpleDatabase reference

Don't use the global variables from the DatabaseSimple library.
This commit is contained in:
Max Kellermann
2014-02-04 08:37:05 +01:00
parent f25ef8d682
commit d76b6f878e
6 changed files with 24 additions and 41 deletions

View File

@@ -95,23 +95,13 @@ db_is_simple(void)
return is_simple;
}
Directory *
db_get_root(void)
SimpleDatabase &
db_get_simple()
{
assert(is_simple);
assert(db != nullptr);
assert(db_is_simple());
return ((SimpleDatabase *)db)->GetRoot();
}
bool
db_save(Error &error)
{
assert(db != nullptr);
assert(db_is_open);
assert(db_is_simple());
return ((SimpleDatabase *)db)->Save(error);
return *(SimpleDatabase *)db;
}
bool