wrap an SQLite3 prepared statement More...
#include <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 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, const Block &block, void(*destructor)(void *)) |
bind a byte blob to the statement More... | |
int | bind (int index, int number) |
bind an integer to the statement More... | |
std::string | getString (int column) |
get a string from column . More... | |
Block | getBlock (int column) |
get a block from column . More... | |
int | getInt (int column) |
get an integer from column . More... | |
const uint8_t * | getBlob (int column) |
get a pointer of byte blob from column . More... | |
int | getSize (int column) |
get the size of column . More... | |
int | step () |
wrapper of sqlite3_step More... | |
operator sqlite3_stmt * () | |
implicitly converts to sqlite3_stmt* to be used in SQLite C API 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.
References NDN_THROW.
ndn::util::Sqlite3Statement::~Sqlite3Statement | ( | ) |
finalize the statement
Definition at line 29 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.
Referenced by ndn::security::pib::PibSqlite3::addCertificate(), ndn::security::pib::PibSqlite3::addIdentity(), ndn::security::pib::PibSqlite3::addKey(), ndn::security::pib::PibSqlite3::getCertificate(), ndn::security::pib::PibSqlite3::getCertificatesOfKey(), ndn::security::pib::PibSqlite3::getDefaultCertificateOfKey(), ndn::security::pib::PibSqlite3::getDefaultKeyOfIdentity(), ndn::security::pib::PibSqlite3::getKeyBits(), ndn::security::pib::PibSqlite3::getKeysOfIdentity(), ndn::security::pib::PibSqlite3::hasCertificate(), ndn::security::pib::PibSqlite3::hasIdentity(), ndn::security::pib::PibSqlite3::hasKey(), ndn::security::pib::PibSqlite3::removeCertificate(), ndn::security::pib::PibSqlite3::removeIdentity(), ndn::security::pib::PibSqlite3::removeKey(), ndn::security::pib::PibSqlite3::setDefaultCertificateOfKey(), ndn::security::pib::PibSqlite3::setDefaultIdentity(), ndn::security::pib::PibSqlite3::setDefaultKeyOfIdentity(), and ndn::security::pib::PibSqlite3::setTpmLocator().
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.
References buf.
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.
References ndn::Block::size(), and ndn::Block::wire().
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.
std::string ndn::util::Sqlite3Statement::getString | ( | int | column | ) |
get a string from column
.
Definition at line 72 of file sqlite3-statement.cpp.
Referenced by ndn::security::pib::PibSqlite3::getTpmLocator().
Block ndn::util::Sqlite3Statement::getBlock | ( | int | column | ) |
get a block from column
.
Definition at line 79 of file sqlite3-statement.cpp.
Referenced by ndn::security::pib::PibSqlite3::getCertificate(), ndn::security::pib::PibSqlite3::getCertificatesOfKey(), ndn::security::pib::PibSqlite3::getDefaultCertificateOfKey(), ndn::security::pib::PibSqlite3::getDefaultIdentity(), ndn::security::pib::PibSqlite3::getDefaultKeyOfIdentity(), ndn::security::pib::PibSqlite3::getIdentities(), and ndn::security::pib::PibSqlite3::getKeysOfIdentity().
int ndn::util::Sqlite3Statement::getInt | ( | int | column | ) |
get an integer from column
.
Definition at line 86 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 93 of file sqlite3-statement.cpp.
Referenced by ndn::security::pib::PibSqlite3::getKeyBits().
int ndn::util::Sqlite3Statement::getSize | ( | int | column | ) |
get the size of column
.
Definition at line 99 of file sqlite3-statement.cpp.
Referenced by ndn::security::pib::PibSqlite3::getKeyBits().
int ndn::util::Sqlite3Statement::step | ( | ) |
wrapper of sqlite3_step
Definition at line 105 of file sqlite3-statement.cpp.
Referenced by ndn::security::pib::PibSqlite3::addCertificate(), ndn::security::pib::PibSqlite3::addIdentity(), ndn::security::pib::PibSqlite3::addKey(), ndn::security::pib::PibSqlite3::clearIdentities(), ndn::security::pib::PibSqlite3::getCertificate(), ndn::security::pib::PibSqlite3::getCertificatesOfKey(), ndn::security::pib::PibSqlite3::getDefaultCertificateOfKey(), ndn::security::pib::PibSqlite3::getDefaultIdentity(), ndn::security::pib::PibSqlite3::getDefaultKeyOfIdentity(), ndn::security::pib::PibSqlite3::getIdentities(), ndn::security::pib::PibSqlite3::getKeyBits(), ndn::security::pib::PibSqlite3::getKeysOfIdentity(), ndn::security::pib::PibSqlite3::getTpmLocator(), ndn::security::pib::PibSqlite3::hasCertificate(), ndn::security::pib::PibSqlite3::hasIdentity(), ndn::security::pib::PibSqlite3::hasKey(), ndn::security::pib::PibSqlite3::removeCertificate(), ndn::security::pib::PibSqlite3::removeIdentity(), ndn::security::pib::PibSqlite3::removeKey(), ndn::security::pib::PibSqlite3::setDefaultCertificateOfKey(), ndn::security::pib::PibSqlite3::setDefaultIdentity(), ndn::security::pib::PibSqlite3::setDefaultKeyOfIdentity(), and ndn::security::pib::PibSqlite3::setTpmLocator().
ndn::util::Sqlite3Statement::operator sqlite3_stmt * | ( | ) |
implicitly converts to sqlite3_stmt* to be used in SQLite C API
Definition at line 110 of file sqlite3-statement.cpp.