An iterable wrapper for dbi_result; allows using C++11 range for.
More...
#include <gnc-dbisqlresult.hpp>
An iterable wrapper for dbi_result; allows using C++11 range for.
Definition at line 39 of file gnc-dbisqlresult.hpp.
◆ GncDbiSqlResult()
Definition at line 42 of file gnc-dbisqlresult.hpp.
42 :
43 m_conn{conn}, m_dbi_result{result}, m_iter{this}, m_row{&m_iter},
44 m_sentinel{nullptr} {}
◆ ~GncDbiSqlResult()
| GncDbiSqlResult::~GncDbiSqlResult |
( |
| ) |
|
Definition at line 43 of file gnc-dbisqlresult.cpp.
44{
45
46 if (!m_dbi_result)
47 return;
48
49 int status = dbi_result_free (m_dbi_result);
50
51 if (status == 0)
52 return;
53
54 PERR (
"Error %d in dbi_result_free() result.", m_conn->dberror() );
56}
void qof_backend_set_error(QofBackend *qof_be, QofBackendError err)
Set the error on the specified QofBackend.
@ ERR_BACKEND_SERVER_ERR
error in response from server
#define PERR(format, args...)
Log a serious error.
◆ begin()
Implements GncSqlResult.
Definition at line 65 of file gnc-dbisqlresult.cpp.
66{
67
68 if (m_dbi_result == nullptr ||
69 dbi_result_get_numrows(m_dbi_result) == 0)
70 return m_sentinel;
71 int status = dbi_result_first_row(m_dbi_result);
72 if (status)
73 return m_row;
74 int error = dberror();
75
76 if (error != DBI_ERROR_BADIDX)
77 {
78 PERR (
"Error %d in dbi_result_first_row()", dberror());
80 }
81 return m_sentinel;
82}
◆ dberror()
| int GncDbiSqlResult::dberror |
( |
| ) |
const |
|
noexcept |
◆ end()
◆ size()
| uint64_t GncDbiSqlResult::size |
( |
| ) |
const |
|
virtualnoexcept |
The documentation for this class was generated from the following files: