From d22eea2fd6130b431bc11694410775b993c5ab7a Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Thu, 17 Jun 2021 19:38:26 +0100 Subject: Make RecordSet foreach ready --- lib/dbRecordSet.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'lib/dbRecordSet.h') diff --git a/lib/dbRecordSet.h b/lib/dbRecordSet.h index e430e58..a9da882 100644 --- a/lib/dbRecordSet.h +++ b/lib/dbRecordSet.h @@ -25,6 +25,11 @@ namespace MyGrate { return std::make_unique((*this)[I + O]...); } + bool operator==(const RowView &) const; + RowView & operator++(); + const RowView & operator*() const; + std::size_t currentRow() const; + private: const RecordSet * recordSet; std::size_t row; @@ -39,6 +44,9 @@ namespace MyGrate { virtual DbValue at(std::size_t, std::size_t) const = 0; RowView operator[](std::size_t row) const; DbValue operator*() const; + + RowView begin() const; + RowView end() const; }; using RecordSetPtr = std::unique_ptr; } -- cgit v1.2.3