Wrapper class for actual SQLite statement objects. More...
#include <SQLiteDB.h>
Public Member Functions | |
Statement () | |
Default constructor. | |
Statement (const Statement &statement) | |
Copy constructor. | |
virtual | ~Statement () |
Destructor. | |
DB | GetDB () const |
Retrieve the DB wrapper object that this statement belongs to. | |
bool | IsValid () const |
Tests if this statement object is valid (points to an actual statement object). | |
bool | Execute () |
Runs an execution (non-SELECT) statement. | |
Recordset | Query () |
Runs a SELECT statement. | |
bool | HasParameter (const TCHAR *pParam) const |
Checks if the statement has a parameter with this name. | |
bool | HasParameter (const std::tstring &sParam) const |
Checks if the statement has a parameter with this name. | |
void | clear () |
Disconnects the statement wrapper from the real statment object. | |
bool | BindParameter (const TCHAR *pParam, const TCHAR *pValue) |
Sets the value of a parameter in the statement. | |
bool | BindParameter (const std::tstring &sParam, const std::tstring &sValue) |
Sets the value of a parameter in the statement. | |
bool | BindParameter (const std::tstring &sParam, const TCHAR *pValue) |
Sets the value of a parameter in the statement. | |
bool | BindParameter (const TCHAR *pParam, const std::tstring &sValue) |
Sets the value of a parameter in the statement. | |
bool | BindParameter (const TCHAR *pParam, int nValue) |
Set the value of a paramenter in the statement. | |
bool | BindParameter (const std::tstring &sParam, int nValue) |
Sets the value of a parameter in the statement. | |
bool | BindParameter (int nParam, const TCHAR *pValue) |
Sets the value of a parameter in the statement (by order). | |
bool | BindParameter (int nParam, const std::tstring &sValue) |
Sets the value of a parameter in the statement (by order). | |
bool | BindParameter (int nParam, int nValue) |
Sets the value of a parameter in the statement (by order). | |
sqlite_int64 | GetLastInsertRowid () const |
Retrieve the ID of the last row inserted by the wrapped statement. | |
std::tstring | GetLastError () |
Retrieve the description of the last error that occured while running the statement. | |
virtual const Statement & | operator= (const Statement &other) |
Assignment operator. | |
Protected Member Functions | |
Statement (RealStatement *pReal) | |
Constructor from an actual statement object. | |
void | AddRef () const |
Adds a reference to the actual statement object. | |
void | DecRef () const |
Deletes a reference to the actual statement object (can delete the object). | |
Protected Attributes | |
RealStatement * | m_pReal |
Pointer to the wrapped statement object. |
Wrapper class for actual SQLite statement objects.
Definition at line 229 of file SQLiteDB.h.
SQLite::Statement::Statement | ( | const Statement & | statement | ) | [inline] |
Copy constructor.
statement | The statement wrapper object to copy |
Definition at line 241 of file SQLiteDB.h.
References AddRef().
SQLite::Statement::Statement | ( | RealStatement * | pReal | ) | [inline, protected] |
Constructor from an actual statement object.
pReal | The actual statement object to wrap |
Definition at line 251 of file SQLiteDB.h.
References AddRef().
bool SQLite::Statement::BindParameter | ( | int | nParam, | |
int | nValue | |||
) |
Sets the value of a parameter in the statement (by order).
nParam | Index of the parameter to set the value of | |
nValue | The value to set |
Definition at line 904 of file SQLiteDB.cpp.
References SQLite::RealStatement::BindParameter(), IsValid(), and m_pReal.
bool SQLite::Statement::BindParameter | ( | int | nParam, | |
const std::tstring & | sValue | |||
) | [inline] |
Sets the value of a parameter in the statement (by order).
nParam | The parameter to set (by order) | |
sValue | The value to set it to |
Definition at line 330 of file SQLiteDB.h.
References BindParameter().
Referenced by BindParameter().
bool SQLite::Statement::BindParameter | ( | const std::tstring & | sParam, | |
int | nValue | |||
) | [inline] |
Sets the value of a parameter in the statement.
sParam | The parameter to set | |
nValue | The value to set it to |
Definition at line 319 of file SQLiteDB.h.
References BindParameter().
Referenced by BindParameter().
bool SQLite::Statement::BindParameter | ( | const TCHAR * | pParam, | |
const std::tstring & | sValue | |||
) | [inline] |
Sets the value of a parameter in the statement.
pParam | The parameter to set | |
sValue | The value to set it to |
Definition at line 308 of file SQLiteDB.h.
References BindParameter().
Referenced by BindParameter().
bool SQLite::Statement::BindParameter | ( | const std::tstring & | sParam, | |
const TCHAR * | pValue | |||
) | [inline] |
Sets the value of a parameter in the statement.
sParam | The parameter to set | |
pValue | The value to set it to |
Definition at line 301 of file SQLiteDB.h.
References BindParameter().
Referenced by BindParameter().
bool SQLite::Statement::BindParameter | ( | const std::tstring & | sParam, | |
const std::tstring & | sValue | |||
) | [inline] |
Sets the value of a parameter in the statement.
sParam | The parameter to set | |
sValue | The value to set it to |
Definition at line 294 of file SQLiteDB.h.
References BindParameter().
Referenced by BindParameter().
bool SQLite::Statement::Execute | ( | ) |
Runs an execution (non-SELECT) statement.
Definition at line 835 of file SQLiteDB.cpp.
References SQLite::RealStatement::Execute(), IsValid(), and m_pReal.
Referenced by SQLite::RealTransaction::Execute().
DB SQLite::Statement::GetDB | ( | ) | const |
Retrieve the DB wrapper object that this statement belongs to.
Definition at line 964 of file SQLiteDB.cpp.
References SQLite::RealStatement::GetDB(), and m_pReal.
Referenced by SQLite::RealTransaction::Execute(), and SQLite::RealTransaction::Query().
std::tstring SQLite::Statement::GetLastError | ( | ) |
Retrieve the description of the last error that occured while running the statement.
Definition at line 914 of file SQLiteDB.cpp.
References SQLite::RealStatement::GetLastError(), and m_pReal.
sqlite_int64 SQLite::Statement::GetLastInsertRowid | ( | ) | const |
Retrieve the ID of the last row inserted by the wrapped statement.
Definition at line 954 of file SQLiteDB.cpp.
References SQLite::RealStatement::GetLastInsertRowid(), and m_pReal.
bool SQLite::Statement::HasParameter | ( | const std::tstring & | sParam | ) | const [inline] |
Checks if the statement has a parameter with this name.
sParam | The name to test |
Definition at line 278 of file SQLiteDB.h.
References HasParameter().
Referenced by HasParameter().
bool SQLite::Statement::IsValid | ( | ) | const |
Tests if this statement object is valid (points to an actual statement object).
Definition at line 825 of file SQLiteDB.cpp.
References SQLite::RealStatement::IsValid(), and m_pReal.
Referenced by BindParameter(), Execute(), and Query().
Assignment operator.
other | The statement wrapper object to copy |
Definition at line 356 of file SQLiteDB.h.
Recordset SQLite::Statement::Query | ( | ) |
Runs a SELECT statement.
Definition at line 845 of file SQLiteDB.cpp.
References IsValid(), m_pReal, and SQLite::RealStatement::Query().
Referenced by SQLite::RealTransaction::Query().