diff options
author | Karol Kosek <krkk@krkk.ct8.pl> | 2021-08-24 22:35:33 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-08-31 16:43:18 +0200 |
commit | 8dbb996200657536502d4b9a780167e9e3825a03 (patch) | |
tree | 2c1711ec53ca2e40a475b5a53e606b415ef52a5f /Userland | |
parent | f56e24098134039293e88519a62eb33007c80ab0 (diff) | |
download | serenity-8dbb996200657536502d4b9a780167e9e3825a03.zip |
Spreadsheet: Implement begin() and end()
Diffstat (limited to 'Userland')
-rw-r--r-- | Userland/Applications/Spreadsheet/Readers/XSV.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/Userland/Applications/Spreadsheet/Readers/XSV.h b/Userland/Applications/Spreadsheet/Readers/XSV.h index 127164deb4..adc2e67805 100644 --- a/Userland/Applications/Spreadsheet/Readers/XSV.h +++ b/Userland/Applications/Spreadsheet/Readers/XSV.h @@ -107,7 +107,14 @@ public: size_t index() const { return m_index; } size_t size() const { return m_xsv.headers().size(); } - // FIXME: Implement begin() and end(), keeping `Field' out of the API. + using ConstIterator = AK::SimpleIterator<const Row, const StringView>; + using Iterator = AK::SimpleIterator<Row, StringView>; + + constexpr ConstIterator begin() const { return ConstIterator::begin(*this); } + constexpr Iterator begin() { return Iterator::begin(*this); } + + constexpr ConstIterator end() const { return ConstIterator::end(*this); } + constexpr Iterator end() { return Iterator::end(*this); } private: XSV& m_xsv; |