Go to the documentation of this file.
50 sqlite3_stmt* statement,
53 statement_(statement),
54 connection_(connection),
55 dataInitialized_(init) {
74 __FILE__, __LINE__,
"~SQLiteQueryResult()", e.
errorMessage());
169 std::vector<std::string> columnNames;
177 columnCount = sqlite3_column_count(
statement_);
178 for (
int i = 0; i < columnCount; i++) {
179 columnNames.push_back(sqlite3_column_name(
statement_, i));
182 if (result == SQLITE_ROW) {
185 for (
int i = 0; i < dataCount; i++) {
186 char* columnText = (
char*)sqlite3_column_text(
statement_, i);
188 if (columnText == NULL) {
195 }
else if (result == SQLITE_DONE) {
205 if (
columnNames_.size() == 0 && columnNames.size() != 0) {
virtual void bindString(unsigned int position, const std::string &value)
virtual const DataObject & data(std::size_t column) const =0
static void writeToErrorLog(const std::string fileName, const int lineNumber, const std::string functionName, const std::string message, const int neededVerbosity=0)
std::vector< DataObject > currentData_
data of the current row
std::vector< std::string > columnNames_
column names
virtual const DataObject & data(std::size_t columnIndex) const
#define assert(condition)
SQLiteConnection * connection_
sqlite connection handle
void throwIfSQLiteError(int result)
sqlite3_stmt * statement_
the compiled SQLite statement handle
void finalizeQuery(sqlite3_stmt *statement)
std::string errorMessage() const
virtual ~SQLiteQueryResult()
virtual void bindInt(unsigned int position, int value)
virtual void setString(std::string value)
std::vector< DataObject > nextData_
data of the next row
virtual std::string columnName(std::size_t columnIndex) const
static NullDataObject & instance()
SQLiteQueryResult(sqlite3_stmt *statement, SQLiteConnection *connection, bool init=true)
virtual int columns() const
bool dataInitialized_
has next() been called for this query