1 #ifndef _sqlite3dbstatement_
\r
2 #define _sqlite3dbstatement_
\r
4 #include "sqlite3db.h"
\r
16 Statement(sqlite3_stmt *statement);
\r
17 Statement(const Statement &rhs);
\r
18 virtual ~Statement();
\r
20 virtual const int ParameterCount() { return m_parametercount; }
\r
21 virtual const int ResultColumnCount() { return m_resultcolumncount; }
\r
23 virtual const bool Valid();
\r
25 virtual void Finalize();
\r
27 virtual const bool Reset();
\r
28 virtual const bool Step(const bool saveinsertrowid=false);
\r
30 virtual const bool RowReturned() { return m_rowreturned; }
\r
32 virtual const long GetLastInsertRowID() { return m_lastinsertrowid; }
\r
34 // both Bind and Result have column index starting at 0
\r
35 // Blob results are not copied, user must make a copy in memory if it needs to be used in the future
\r
37 virtual const bool Bind(const int column);
\r
38 virtual const bool Bind(const int column, const int value);
\r
39 virtual const bool Bind(const int column, const long value) { return Bind(column,static_cast<int>(value)); }
\r
40 virtual const bool Bind(const int column, const double value);
\r
41 virtual const bool Bind(const int column, const std::string &value);
\r
42 virtual const bool Bind(const int column, const void *data, const int length);
\r
44 virtual const bool ResultNull(const int column);
\r
45 virtual const bool ResultInt(const int column, int &result);
\r
46 virtual const bool ResultDouble(const int column, double &result);
\r
47 virtual const bool ResultText(const int column, std::string &result);
\r
48 virtual const bool ResultBlob(const int column, void *data, int &length);
\r
50 Statement &operator=(const Statement &rhs);
\r
53 sqlite3_stmt *m_statement;
\r
54 int m_parametercount;
\r
55 int m_resultcolumncount;
\r
57 long m_lastinsertrowid;
\r
59 static std::map<sqlite3_stmt *, long> m_statementcount;
\r
60 //std::vector<char *> textptrs;
\r
61 std::vector<std::vector<char>> m_boundtext;
\r
67 #endif // _sqlite3dbstatement_
\r