Wrap an SQLite3 prepared statement. More...
#include <ndn-cxx/util/sqlite3-statement.hpp>
Public Member Functions | |
Sqlite3Statement (sqlite3 *database, const std::string &statement) | |
Initialize and prepare Sqlite3 statement. More... | |
~Sqlite3Statement () | |
Finalize the statement. More... | |
int | bind (int index, const Block &block, void(*destructor)(void *)) |
Bind a byte blob to the statement. More... | |
int | bind (int index, const char *value, size_t size, void(*destructor)(void *)) |
Bind a string to the statement. More... | |
int | bind (int index, const std::string &value, void(*destructor)(void *)) |
Bind a string to the statement. More... | |
int | bind (int index, const void *value, size_t size, void(*destructor)(void *)) |
Bind a byte blob to the statement. More... | |
int | bind (int index, int number) |
Bind an integer to the statement. More... | |
const uint8_t * | getBlob (int column) |
Get a pointer of byte blob from column . More... | |
Block | getBlock (int column) |
Get a block from column . More... | |
int | getInt (int column) |
Get an integer from column . More... | |
int | getSize (int column) |
Get the size of column . More... | |
std::string | getString (int column) |
Get a string from column . More... | |
operator sqlite3_stmt * () | |
Implicitly converts to sqlite3_stmt* to be used in SQLite C API. More... | |
int | step () |
Wrapper of sqlite3_step . More... | |
Wrap an SQLite3 prepared statement.
Definition at line 37 of file sqlite3-statement.hpp.
ndn::util::Sqlite3Statement::Sqlite3Statement | ( | sqlite3 * | database, |
const std::string & | statement | ||
) |
Initialize and prepare Sqlite3 statement.
database | handler to open sqlite3 database |
statement | SQL statement |
std::domain_error | SQL statement is bad |
Definition at line 34 of file sqlite3-statement.cpp.
ndn::util::Sqlite3Statement::~Sqlite3Statement | ( | ) |
Finalize the statement.
Definition at line 29 of file sqlite3-statement.cpp.
int ndn::util::Sqlite3Statement::bind | ( | int | index, |
const Block & | block, | ||
void(*)(void *) | destructor | ||
) |
Bind a byte blob to the statement.
index | The binding position |
block | The binding block |
destructor | SQLite3 destructor, e.g., SQLITE_TRANSIENT |
Definition at line 60 of file sqlite3-statement.cpp.
int ndn::util::Sqlite3Statement::bind | ( | int | index, |
const char * | value, | ||
size_t | size, | ||
void(*)(void *) | destructor | ||
) |
Bind a string to the statement.
index | The binding position |
value | The pointer of the binding string |
size | The size of the binding string |
destructor | SQLite3 destructor, e.g., SQLITE_TRANSIENT |
Definition at line 42 of file sqlite3-statement.cpp.
int ndn::util::Sqlite3Statement::bind | ( | int | index, |
const std::string & | value, | ||
void(*)(void *) | destructor | ||
) |
Bind a string to the statement.
index | The binding position |
value | The binding string |
destructor | SQLite3 destructor, e.g., SQLITE_TRANSIENT |
Definition at line 48 of file sqlite3-statement.cpp.
int ndn::util::Sqlite3Statement::bind | ( | int | index, |
const void * | value, | ||
size_t | size, | ||
void(*)(void *) | destructor | ||
) |
Bind a byte blob to the statement.
index | The binding position |
value | The pointer of the blob |
size | The size of the blob |
destructor | SQLite3 destructor, e.g., SQLITE_TRANSIENT |
Definition at line 54 of file sqlite3-statement.cpp.
int ndn::util::Sqlite3Statement::bind | ( | int | index, |
int | number | ||
) |
Bind an integer to the statement.
index | The binding position |
number | The binding integer |
Definition at line 66 of file sqlite3-statement.cpp.
const uint8_t * ndn::util::Sqlite3Statement::getBlob | ( | int | column | ) |
Get a pointer of byte blob from column
.
Definition at line 92 of file sqlite3-statement.cpp.
Block ndn::util::Sqlite3Statement::getBlock | ( | int | column | ) |
Get a block from column
.
Definition at line 79 of file sqlite3-statement.cpp.
int ndn::util::Sqlite3Statement::getInt | ( | int | column | ) |
Get an integer from column
.
Definition at line 86 of file sqlite3-statement.cpp.
int ndn::util::Sqlite3Statement::getSize | ( | int | column | ) |
Get the size of column
.
Definition at line 98 of file sqlite3-statement.cpp.
std::string ndn::util::Sqlite3Statement::getString | ( | int | column | ) |
Get a string from column
.
Definition at line 72 of file sqlite3-statement.cpp.
ndn::util::Sqlite3Statement::operator sqlite3_stmt * | ( | ) |
Implicitly converts to sqlite3_stmt*
to be used in SQLite C API.
Definition at line 109 of file sqlite3-statement.cpp.
int ndn::util::Sqlite3Statement::step | ( | ) |
Wrapper of sqlite3_step
.
Definition at line 104 of file sqlite3-statement.cpp.