#include <ngen_sqlite.hpp>
|
| | iterator ()=delete |
| |
| | iterator (stmt_t &&stmt) |
| |
| bool | done () const noexcept |
| | Check if a row iterator is finished.
|
| |
| iterator & | next () |
| | Step into the next row of a SQLite query.
|
| |
| iterator & | restart () |
| | Restart an iteration to its initial state.
|
| |
| int | current_row () const noexcept |
| | Get the current row index for the iterator.
|
| |
| int | num_columns () const noexcept |
| | Get the number of columns within this iterator.
|
| |
| int | find (const std::string &name) const noexcept |
| | Return the column index for a named column.
|
| |
| const boost::span< const std::string > | columns () const noexcept |
| | Get a span of column names.
|
| |
| const boost::span< const int > | types () const noexcept |
| | Get a span of column types.
|
| |
| template<typename Tp > |
| Tp | get (int col) const |
| | Get a column value from a row iterator by index.
|
| |
| template<typename Tp > |
| Tp | get (const std::string &col) const |
| | Get a column value from a row iterator by name.
|
| |
| template<> |
| auto | get (int col) const -> double |
| |
◆ iterator() [1/2]
| ngen::sqlite::database::iterator::iterator |
( |
| ) |
|
|
delete |
◆ iterator() [2/2]
| ngen::sqlite::database::iterator::iterator |
( |
stmt_t && | stmt | ) |
|
|
explicit |
◆ columns()
| auto ngen::sqlite::database::iterator::columns |
( |
| ) |
const |
|
noexcept |
◆ current_row()
| auto ngen::sqlite::database::iterator::current_row |
( |
| ) |
const |
|
noexcept |
Get the current row index for the iterator.
- Returns
- int the current row index, or -1 if next() hasn't been called
◆ done()
| auto ngen::sqlite::database::iterator::done |
( |
| ) |
const |
|
noexcept |
Check if a row iterator is finished.
- Returns
- true if next() returned SQLITE_DONE
-
false if there is more rows available
◆ find()
| auto ngen::sqlite::database::iterator::find |
( |
const std::string & | name | ) |
const |
|
noexcept |
Return the column index for a named column.
- Parameters
-
| name | column name to search for |
- Returns
- int index of given column name, or -1 if not found.
Referenced by get().
◆ get() [1/3]
template<typename Tp >
| Tp ngen::sqlite::database::iterator::get |
( |
const std::string & | col | ) |
const |
|
inline |
Get a column value from a row iterator by name.
- Template Parameters
-
| T | Type to parse value as, i.e. int |
- Parameters
-
- Returns
- T value at the named column
References find(), and get().
◆ get() [2/3]
template<typename Tp >
| Tp ngen::sqlite::database::iterator::get |
( |
int | col | ) |
const |
◆ get() [3/3]
| auto ngen::sqlite::database::iterator::get< int > |
( |
int | col | ) |
const -> double
|
◆ handle_get_index_()
| void ngen::sqlite::database::iterator::handle_get_index_ |
( |
int | col | ) |
const |
|
private |
◆ next()
| auto ngen::sqlite::database::iterator::next |
( |
| ) |
|
Step into the next row of a SQLite query.
If the query is finished, next() acts idempotently, but will change done() to return true.
- Returns
- sqlite_iter& returns itself
Referenced by iterator().
◆ num_columns()
| auto ngen::sqlite::database::iterator::num_columns |
( |
| ) |
const |
|
noexcept |
Get the number of columns within this iterator.
- Returns
- int number of columns in query
◆ ptr_()
| auto ngen::sqlite::database::iterator::ptr_ |
( |
| ) |
const |
|
privatenoexcept |
◆ restart()
| auto ngen::sqlite::database::iterator::restart |
( |
| ) |
|
Restart an iteration to its initial state.
next() must be called after calling this.
- Returns
- sqlite_iter& returns itself
Referenced by iterator().
◆ types()
| auto ngen::sqlite::database::iterator::types |
( |
| ) |
const |
|
noexcept |
◆ done_
| int ngen::sqlite::database::iterator::done_ = false |
|
private |
◆ names_
| std::vector<std::string> ngen::sqlite::database::iterator::names_ |
|
private |
◆ ncol_
| int ngen::sqlite::database::iterator::ncol_ = 0 |
|
private |
◆ step_
| int ngen::sqlite::database::iterator::step_ = -1 |
|
private |
◆ stmt_
| stmt_t ngen::sqlite::database::iterator::stmt_ |
|
private |
◆ types_
| std::vector<int> ngen::sqlite::database::iterator::types_ |
|
private |
The documentation for this struct was generated from the following files: