16 #include "pqxx/compiler-public.hxx"
17 #include "pqxx/compiler-internal-pre.hxx"
19 #include "pqxx/except.hxx"
20 #include "pqxx/field.hxx"
21 #include "pqxx/result.hxx"
40 class PQXX_LIBEXPORT
row
57 ~
row() noexcept =default;
63 PQXX_PURE
bool operator==(const
row &) const noexcept;
64 bool operator!=(const
row &rhs) const noexcept
65 {
return not operator==(rhs); }
68 const_iterator begin() const noexcept;
69 const_iterator cbegin() const noexcept;
70 const_iterator end() const noexcept;
71 const_iterator cend() const noexcept;
77 reference front() const noexcept;
78 reference back() const noexcept;
85 reference operator[](size_type) const noexcept;
86 reference operator[](
int) const noexcept;
90 reference operator[](const
char[]) const;
94 reference operator[](const std::
string &) const;
95 reference at(size_type) const;
96 reference at(
int) const;
100 reference at(const
char[]) const;
104 reference at(const std::
string &) const;
108 {
return m_end-m_begin; }
110 void swap(
row &) noexcept;
113 size_t rownumber() const noexcept {
return size_t(m_index); }
119 size_type column_number(
const std::string &ColName)
const
121 {
return column_number(ColName.c_str()); }
124 size_type column_number(
const char[])
const;
127 oid column_type(size_type)
const;
131 {
return column_type(
size_type(ColNum)); }
135 {
return column_type(column_number(ColName)); }
139 {
return column_type(column_number(ColName)); }
142 oid column_table(size_type ColNum)
const;
146 {
return column_table(
size_type(ColNum)); }
149 {
return column_table(column_number(ColName)); }
159 size_type table_column(size_type)
const;
163 {
return table_column(
size_type(ColNum)); }
167 {
return table_column(column_number(ColName)); }
170 size_t num()
const {
return rownumber(); }
184 row slice(size_type Begin, size_type End)
const;
187 PQXX_PURE
bool empty() const noexcept;
249 {
return col()==i.col();}
251 {
return col()!=i.col();}
253 {
return col()<i.col();}
255 {
return col()<=i.col();}
257 {
return col()>i.col();}
259 {
return col()>=i.col();}
296 PQXX_PURE iterator_type base() const noexcept;
302 using iterator_type::operator->;
303 using iterator_type::operator*;
310 const_reverse_row_iterator &
312 { iterator_type::operator=(r);
return *
this; }
314 { iterator_type::operator--();
return *
this; }
317 { iterator_type::operator++();
return *
this; }
320 { iterator_type::operator-=(i);
return *
this; }
322 { iterator_type::operator+=(i);
return *
this; }
335 {
return rhs.const_row_iterator::operator-(*this); }
343 {
return iterator_type::operator==(rhs); }
345 {
return !operator==(rhs); }
348 {
return iterator_type::operator>(rhs); }
350 {
return iterator_type::operator>=(rhs); }
352 {
return iterator_type::operator<(rhs); }
354 {
return iterator_type::operator<=(rhs); }
359 inline const_row_iterator
371 inline const_row_iterator
401 #include "pqxx/compiler-internal-post.hxx"
bool operator!=(const const_reverse_row_iterator &rhs) const noexcept
Definition: row.hxx:344
Reverse iterator for a row. Use as row::const_reverse_iterator.
Definition: row.hxx:279
const_row_iterator & operator--()
Definition: row.hxx:236
const_row_iterator & operator+=(difference_type i)
Definition: row.hxx:238
std::random_access_iterator_tag iterator_category
Definition: row.hxx:210
size_type table_column(const std::string &ColName) const
What column number in its table did this result column come from?
Definition: row.hxx:166
field_size_type size_type
Definition: field.hxx:52
row_size_type column_number(const char ColName[]) const
Number of given column (throws exception if it doesn't exist).
Definition: row.cxx:207
bool operator<=(const const_reverse_row_iterator &rhs) const
Definition: row.hxx:349
const_row_iterator & operator-=(difference_type i)
Definition: row.hxx:240
bool operator==(const const_row_iterator &i) const
Definition: row.hxx:248
PQXX_PURE iterator_type base() const noexcept
Definition: row.cxx:254
row_difference_type difference_type
Definition: row.hxx:214
bool operator>(const const_reverse_row_iterator &rhs) const
Definition: row.hxx:351
const_reverse_row_iterator operator++()
Definition: row.hxx:313
const_iterator cbegin() const noexcept
Definition: row.cxx:41
const_reverse_row_iterator(const super &rhs) noexcept
Definition: row.hxx:293
const_reverse_row_iterator & operator--()
Definition: row.hxx:316
const_row_iterator(const field &F) noexcept
Definition: row.hxx:219
const_iterator cend() const noexcept
Definition: row.cxx:53
reference at(size_type) const
Definition: row.cxx:163
const_reverse_row_iterator crbegin() const
Definition: row.cxx:77
signed int row_difference_type
Difference between row sizes.
Definition: types.hxx:27
pointer operator->() const
Definition: row.hxx:225
const_row_iterator(const row &T, row_size_type C) noexcept
Definition: row.hxx:217
bool operator<=(const const_row_iterator &i) const
Definition: row.hxx:254
bool operator<(const const_row_iterator &i) const
Definition: row.hxx:252
reference operator[](size_type) const noexcept
Definition: row.cxx:106
const_reverse_row_iterator & operator+=(difference_type i)
Definition: row.hxx:319
bool operator!=(const const_row_iterator &i) const
Definition: row.hxx:250
bool operator>=(const const_row_iterator &i) const
Definition: row.hxx:258
Result set containing data returned by a query or command.
Definition: result.hxx:69
size_t num() const
Definition: row.hxx:170
difference_type operator-(const const_reverse_row_iterator &rhs) const
Definition: row.hxx:334
unsigned int row_size_type
Number of fields in a row of database data.
Definition: types.hxx:24
size_type column_number(const std::string &ColName) const
Number of given column (throws exception if it doesn't exist)
Definition: row.hxx:120
const_reverse_row_iterator(const const_reverse_row_iterator &r)
Definition: row.hxx:290
const_reverse_row_iterator operator-(difference_type i)
Definition: row.hxx:331
oid column_type(size_type) const
Type of given column.
Definition: row.cxx:172
row slice(size_type Begin, size_type End) const
Definition: row.cxx:219
Reference to a field in a result set.
Definition: field.hxx:49
size_type m_begin
First column in slice. This row ignores lower-numbered columns.
Definition: row.hxx:200
const_row_iterator & operator++()
Definition: row.hxx:234
oid column_table(const std::string &ColName) const
What table did this column come from?
Definition: row.hxx:148
oid column_type(const std::string &ColName) const
Type of given column.
Definition: row.hxx:134
row_size_type num() const
Definition: field.hxx:104
PQXX_PURE bool operator==(const row &) const noexcept
Definition: row.cxx:95
oid column_type(int ColNum) const
Type of given column.
Definition: row.hxx:130
oid column_table(size_type ColNum) const
What table did this column come from?
Definition: row.cxx:178
reference operator*() const
Definition: row.hxx:226
bool operator>=(const const_reverse_row_iterator &rhs) const
Definition: row.hxx:353
const_reverse_row_iterator & operator-=(difference_type i)
Definition: row.hxx:321
oid column_type(const char ColName[]) const
Type of given column.
Definition: row.hxx:138
const_reverse_row_iterator rbegin() const
Definition: row.cxx:71
size_t rownumber() const noexcept
Row number, assuming this is a real row and not end()/rend().
Definition: row.hxx:113
bool operator==(const const_reverse_row_iterator &rhs) const noexcept
Definition: row.hxx:342
const_row_iterator operator+(difference_type) const
Definition: row.hxx:360
const_iterator begin() const noexcept
Definition: row.cxx:35
const_result_iterator operator+(result::difference_type o, const_result_iterator i)
Definition: result_iterator.hxx:212
PQXX_PURE bool empty() const noexcept
Definition: row.cxx:231
reference front() const noexcept
Definition: row.cxx:59
bool operator<(const const_reverse_row_iterator &rhs) const
Definition: row.hxx:347
Iterator for fields in a row. Use as row::const_iterator.
Definition: row.hxx:207
Invalid argument passed to libpqxx, similar to std::invalid_argument.
Definition: except.hxx:229
const_reverse_row_iterator crend() const
Definition: row.cxx:89
bool operator>(const const_row_iterator &i) const
Definition: row.hxx:256
const_iterator end() const noexcept
Definition: row.cxx:47
void swap(row &) noexcept
Definition: row.cxx:142
const_reverse_row_iterator rend() const
Definition: row.cxx:83
reference back() const noexcept
Definition: row.cxx:65
size_type table_column(int ColNum) const
What column number in its table did this result column come from?
Definition: row.hxx:162
Something is out of range, similar to std::out_of_range.
Definition: except.hxx:251
row_difference_type difference_type
Definition: row.hxx:44
size_type table_column(size_type) const
What column number in its table did this result column come from?
Definition: row.cxx:184
The home of all libpqxx classes, functions, templates, etc.
Definition: array.hxx:25
const_reverse_row_iterator operator+(difference_type i) const
Definition: row.hxx:329
Reference to one row in a result.
Definition: row.hxx:40
row_size_type size_type
Definition: row.hxx:43
oid column_table(int ColNum) const
What table did this column come from?
Definition: row.hxx:145
const_row_iterator operator-(difference_type) const
Definition: row.hxx:372