4 #include "db/sqlite3db.h"
\r
7 #include "threadwrapper/singleton.h"
\r
9 //just a wrapper around the database for the options table
\r
10 class Option:public Singleton<Option>
\r
13 const bool Get(const std::string &option, std::string &value);
\r
15 void Set(const std::string &option, const T &value);
\r
20 void Option::Set(const std::string &option, const T &value)
\r
22 std::ostringstream valuestr;
\r
25 std::string tempval;
\r
26 if(Get(option,tempval)==true)
\r
28 SQLite3DB::Statement st=SQLite3DB::DB::Instance()->Prepare("UPDATE tblOption SET OptionValue=? WHERE Option=?;");
\r
29 st.Bind(0,valuestr.str());
\r
35 SQLite3DB::Statement st=SQLite3DB::DB::Instance()->Prepare("INSERT INTO tblOption(Option,OptionValue) VALUES(?,?);");
\r
37 st.Bind(1,valuestr.str());
\r