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
14 const bool GetInt(const std::string &option, int &value);
\r
16 void Set(const std::string &option, const T &value);
\r
21 void Option::Set(const std::string &option, const T &value)
\r
23 std::ostringstream valuestr;
\r
26 std::string tempval;
\r
27 if(Get(option,tempval)==true)
\r
29 SQLite3DB::Statement st=SQLite3DB::DB::Instance()->Prepare("UPDATE tblOption SET OptionValue=? WHERE Option=?;");
\r
30 st.Bind(0,valuestr.str());
\r
36 SQLite3DB::Statement st=SQLite3DB::DB::Instance()->Prepare("INSERT INTO tblOption(Option,OptionValue) VALUES(?,?);");
\r
38 st.Bind(1,valuestr.str());
\r