7 #ifndef _litesql_cursor_hpp 8 #define _litesql_cursor_hpp 43 std::vector<T> dump();
51 Cursor<T>::Cursor(
const Database& db_, Backend::Cursor * c)
52 : db(db_), cursor(c), done(false), dataReady(false) {
63 currentRow = cursor->fetchOne();
64 if (currentRow.size() == 0) {
77 for (;!done;operator++())
78 res.push_back(
operator*());
88 return T(db,currentRow);
Definition: backend.hpp:14
An abstract base class for cursors that iterate result sets returned by relational database...
Definition: backend.hpp:23
Cursor< T > & operator++(int)
steps to next record
Definition: cursor.hpp:41
A base class of databases.
Definition: database.hpp:37
std::string operator*(int amount, const std::string &s)
returns a string which is duplicated 'amount' times
Definition: string.cpp:101
contains class Record and typedef Records
Cursor< T > & operator++()
steps to next record
Definition: cursor.hpp:60
exception thrown when a record is not found
Definition: except.hpp:32
~Cursor()
deletes Backend::Cursor
Definition: cursor.hpp:56
SQL data row wrapper.
Definition: types.hpp:19
bool rowsLeft()
returns true if there are records left in the result set
Definition: cursor.hpp:47
Classes Backend, Backend::Cursor and Backend::Result.
used to iterate results of SQL statement, creates objects of type T from retrieved records...
Definition: cursor.hpp:22
std::vector< T > dump()
returns the rest of the result set in vector
Definition: cursor.hpp:75
T operator*()
returns current record
Definition: cursor.hpp:82