4 #include "idatabase.h"
\r
8 //just a wrapper around the database for the options table
\r
9 class Option:public IDatabase
\r
12 Option(SQLite3DB::DB *db):IDatabase(db) {}
\r
14 const bool Get(const std::string &option, std::string &value);
\r
15 const bool GetInt(const std::string &option, int &value);
\r
17 void Set(const std::string &option, const T &value);
\r
22 void Option::Set(const std::string &option, const T &value)
\r
24 std::ostringstream valuestr;
\r
27 std::string tempval;
\r
28 if(Get(option,tempval)==true)
\r
30 SQLite3DB::Statement st=m_db->Prepare("UPDATE tblOption SET OptionValue=? WHERE Option=?;");
\r
31 st.Bind(0,valuestr.str());
\r
37 SQLite3DB::Statement st=m_db->Prepare("INSERT INTO tblOption(Option,OptionValue) VALUES(?,?);");
\r
39 st.Bind(1,valuestr.str());
\r