Updating rows kinda works.
Blocking calls are still used.
This commit is contained in:
parent
99d738ee65
commit
628c16e2f4
10 changed files with 179 additions and 81 deletions
|
|
@ -14,6 +14,51 @@ namespace Pgsql {
|
|||
*/
|
||||
class Row {
|
||||
public:
|
||||
class const_iterator {
|
||||
public:
|
||||
const_iterator(const Row &r, int col)
|
||||
: m_row(r)
|
||||
, m_col(col)
|
||||
{}
|
||||
|
||||
const_iterator operator++()
|
||||
{
|
||||
const_iterator t(*this);
|
||||
++m_col;
|
||||
return t;
|
||||
}
|
||||
|
||||
const_iterator& operator++(int)
|
||||
{
|
||||
++m_col;
|
||||
return *this;
|
||||
}
|
||||
|
||||
bool operator==(const const_iterator &rhs)
|
||||
{
|
||||
return m_row == rhs.m_row && m_col == rhs.m_col;
|
||||
}
|
||||
|
||||
bool operator!=(const const_iterator &rhs)
|
||||
{
|
||||
return !operator==(rhs);
|
||||
}
|
||||
|
||||
const Value operator*()
|
||||
{
|
||||
return m_row.get(m_col);
|
||||
}
|
||||
|
||||
const Value operator->()
|
||||
{
|
||||
return m_row.get(m_col);
|
||||
}
|
||||
|
||||
private:
|
||||
const Row &m_row;
|
||||
int m_col;
|
||||
};
|
||||
|
||||
Row(const Result &result, int row);
|
||||
bool next();
|
||||
|
||||
|
|
@ -22,6 +67,12 @@ namespace Pgsql {
|
|||
//Value get(const char *colname) const;
|
||||
//bool get(int col, QString &s);
|
||||
|
||||
const_iterator begin() const
|
||||
{
|
||||
return const_iterator(*this, 0);
|
||||
}
|
||||
|
||||
const_iterator end() const;
|
||||
|
||||
private:
|
||||
const Result& m_result;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue