1 #include "../../include/db/sqlite3db/sqlite3recordset.h"
\r
10 Recordset::Recordset()
\r
18 Recordset::Recordset(char **rs, int rows, int cols)
\r
26 Recordset::~Recordset()
\r
31 const char *Recordset::Get(const int row, const int field)
\r
33 if(row>=0 && row<m_rows && field>=0 && field<m_cols)
\r
35 return m_rs[m_cols+(m_cols*row)+field];
\r
43 const double Recordset::GetDouble(const int field)
\r
45 const char *result=GetField(field);
\r
48 return atof(result);
\r
56 const char *Recordset::GetField(const int field)
\r
58 return Get(m_currentrow,field);
\r
61 const int Recordset::GetInt(const int field)
\r
63 const char *result=GetField(field);
\r
66 return atoi(result);
\r
74 void Recordset::Open(const std::string &sql, DB *db)
\r
79 //ZThread::Guard<ZThread::Mutex> g(DB::instance()->m_mutex);
\r
80 PThread::Guard g(DB::Instance()->m_mutex);
\r
81 if(sqlite3_get_table(db->GetDB(),sql.c_str(),&m_rs,&m_rows,&m_cols,NULL)==SQLITE_OK)
\r