Mercurial > hg > orthanc
diff OrthancServer/DatabaseWrapper.cpp @ 206:4453a010d0db
flush to disk thread
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 28 Nov 2012 12:03:18 +0100 |
parents | 6ab754744446 |
children | 0200cd330582 |
line wrap: on
line diff
--- a/OrthancServer/DatabaseWrapper.cpp Wed Nov 28 11:34:54 2012 +0100 +++ b/OrthancServer/DatabaseWrapper.cpp Wed Nov 28 12:03:18 2012 +0100 @@ -130,21 +130,21 @@ - void DatabaseWrapper::SetGlobalProperty(const std::string& name, + void DatabaseWrapper::SetGlobalProperty(GlobalProperty property, const std::string& value) { SQLite::Statement s(db_, SQLITE_FROM_HERE, "INSERT OR REPLACE INTO GlobalProperties VALUES(?, ?)"); - s.BindString(0, name); + s.BindInt(0, property); s.BindString(1, value); s.Run(); } bool DatabaseWrapper::LookupGlobalProperty(std::string& target, - const std::string& name) + GlobalProperty property) { SQLite::Statement s(db_, SQLITE_FROM_HERE, - "SELECT value FROM GlobalProperties WHERE name=?"); - s.BindString(0, name); + "SELECT value FROM GlobalProperties WHERE property=?"); + s.BindInt(0, property); if (!s.Step()) { @@ -157,11 +157,11 @@ } } - std::string DatabaseWrapper::GetGlobalProperty(const std::string& name, + std::string DatabaseWrapper::GetGlobalProperty(GlobalProperty property, const std::string& defaultValue) { std::string s; - if (LookupGlobalProperty(s, name)) + if (LookupGlobalProperty(s, property)) { return s; }