7 #ifndef litesql_cursor_hpp
8 #define litesql_cursor_hpp
42 std::vector<T>
dump();
50 Cursor<T>::Cursor(
const Database& db_, Backend::Cursor * c)
51 : db(db_), cursor(c), done(false), dataReady(false) {
62 currentRow = cursor->fetchOne();
63 if (currentRow.size() == 0) {
76 for (;!done;operator++())
77 res.push_back(
operator*());
87 return T(db,currentRow);
Classes Backend, Backend::Cursor and Backend::Result.
An abstract base class for cursors that iterate result sets returned by relational database.
Definition: backend.hpp:24
used to iterate results of SQL statement, creates objects of type T from retrieved records.
Definition: cursor.hpp:21
bool rowsLeft()
returns true if there are records left in the result set
Definition: cursor.hpp:46
~Cursor()
deletes Backend::Cursor
Definition: cursor.hpp:55
Cursor< T > & operator++()
steps to next record
Definition: cursor.hpp:59
std::vector< T > dump()
returns the rest of the result set in vector
Definition: cursor.hpp:74
Cursor< T > & operator++(int)
steps to next record
Definition: cursor.hpp:40
T operator*()
returns current record
Definition: cursor.hpp:81
A base class of databases.
Definition: database.hpp:33
exception thrown when a record is not found
Definition: except.hpp:33
SQL data row wrapper.
Definition: types.hpp:20
contains litesql's exception classes