SQLitePP::Statement Class Reference

Class that contains a statement for querying the sqlite db. More...

#include <sqlitepp.h>

List of all members.

Public Types

typedef boost::shared_ptr<
Statement
Pointer

Public Member Functions

 BOOST_PP_REPEAT (BOOST_PP_INC(MAX_ARGUMENTS), BINDARGS, _)~Statement()
StatementbindArg (const Blob &argument, int pos=0)
 Bind an argument to a Statement.
StatementbindArg (const std::string &argument, int pos=0)
 Bind an argument to a Statement.
StatementbindArg (const char *argument, int pos=0)
 Bind an argument to a Statement.
StatementbindArg (int argument, unsigned int pos=0)
 Bind an argument to a Statement.
StatementbindArg (schma::UnicodePtr argument, int pos=0)
 Bind an argument to a Statement.
Statementexec ()
ResultIterator query ()
 Returns a ResultIterator to be used to iterate over the result of the db query.
template<typename T>
queryScalar ()
void reset ()
 Reset this Statement. Use this before binding other arguments to this Statement.
int lastInsertId ()
int affectedRows ()

Private Member Functions

 Statement (const char *sql, sqlite3 *db)
 Statement (sqlite3_stmt *stmt, sqlite3 *db)

Private Attributes

sqlite3_stmt * m_stmt
sqlite3 * m_dbhandle
int m_argpos
bool m_finalize

Friends

class SqliteDB


Detailed Description

Class that contains a statement for querying the sqlite db.

Definition at line 117 of file sqlitepp.h.


Member Typedef Documentation

typedef boost::shared_ptr<Statement> SQLitePP::Statement::Pointer

Definition at line 137 of file sqlitepp.h.


Constructor & Destructor Documentation

SQLitePP::Statement::Statement ( const char *  sql,
sqlite3 *  db 
) [inline, private]

Definition at line 126 of file sqlitepp.h.

SQLitePP::Statement::Statement ( sqlite3_stmt *  stmt,
sqlite3 *  db 
) [inline, private]

Definition at line 131 of file sqlitepp.h.


Member Function Documentation

SQLitePP::Statement::BOOST_PP_REPEAT ( BOOST_PP_INC(MAX_ARGUMENTS)  ,
BINDARGS  ,
 
) [inline]

Definition at line 156 of file sqlitepp.h.

References m_finalize, m_stmt, and reset().

Statement& SQLitePP::Statement::bindArg ( const Blob argument,
int  pos = 0 
) [inline]

Bind an argument to a Statement.

Definition at line 171 of file sqlitepp.h.

References m_argpos, and m_stmt.

Statement& SQLitePP::Statement::bindArg ( const std::string &  argument,
int  pos = 0 
) [inline]

Bind an argument to a Statement.

Definition at line 180 of file sqlitepp.h.

References m_argpos, and m_stmt.

Statement& SQLitePP::Statement::bindArg ( const char *  argument,
int  pos = 0 
) [inline]

Bind an argument to a Statement.

Definition at line 189 of file sqlitepp.h.

References m_argpos, and m_stmt.

Statement& SQLitePP::Statement::bindArg ( int  argument,
unsigned int  pos = 0 
) [inline]

Bind an argument to a Statement.

Definition at line 198 of file sqlitepp.h.

References m_argpos, and m_stmt.

Statement& SQLitePP::Statement::bindArg ( schma::UnicodePtr  argument,
int  pos = 0 
) [inline]

Bind an argument to a Statement.

Definition at line 207 of file sqlitepp.h.

References m_argpos, m_stmt, and schma::toCharArray().

Statement& SQLitePP::Statement::exec (  )  [inline]

Definition at line 215 of file sqlitepp.h.

References m_dbhandle, m_stmt, reset(), and SQLitePP::showSqlite3Error().

ResultIterator SQLitePP::Statement::query (  )  [inline]

Returns a ResultIterator to be used to iterate over the result of the db query.

Definition at line 226 of file sqlitepp.h.

References m_argpos, and m_stmt.

Referenced by queryScalar().

template<typename T>
T SQLitePP::Statement::queryScalar (  )  [inline]

Definition at line 233 of file sqlitepp.h.

References SQLitePP::ResultIterator::get(), SQLitePP::ResultIterator::hasMoreRows(), p_assert, and query().

void SQLitePP::Statement::reset (  )  [inline]

Reset this Statement. Use this before binding other arguments to this Statement.

Definition at line 243 of file sqlitepp.h.

References m_argpos, and m_stmt.

Referenced by BOOST_PP_REPEAT(), and exec().

int SQLitePP::Statement::lastInsertId (  )  [inline]

Definition at line 249 of file sqlitepp.h.

References m_dbhandle.

int SQLitePP::Statement::affectedRows (  )  [inline]

Definition at line 254 of file sqlitepp.h.

References m_dbhandle.


Friends And Related Function Documentation

friend class SqliteDB [friend]

Definition at line 124 of file sqlitepp.h.


Member Data Documentation

sqlite3_stmt* SQLitePP::Statement::m_stmt [private]

Definition at line 119 of file sqlitepp.h.

Referenced by bindArg(), BOOST_PP_REPEAT(), exec(), query(), and reset().

sqlite3* SQLitePP::Statement::m_dbhandle [private]

Definition at line 120 of file sqlitepp.h.

Referenced by affectedRows(), exec(), and lastInsertId().

int SQLitePP::Statement::m_argpos [private]

Definition at line 121 of file sqlitepp.h.

Referenced by bindArg(), query(), and reset().

bool SQLitePP::Statement::m_finalize [private]

Definition at line 122 of file sqlitepp.h.

Referenced by BOOST_PP_REPEAT().


The documentation for this class was generated from the following file:
Generated on Thu Dec 21 16:14:44 2006 for The Phrasehunter by  doxygen 1.5.1