11#ifndef OPENXLSX_XLCELLITERATOR_HPP
12#define OPENXLSX_XLCELLITERATOR_HPP
16# pragma warning(disable : 4251)
17# pragma warning(disable : 4275)
22#include "OpenXLSX-Exports.hpp"
55 enum class CellStatus : uint8_t { NotLoaded = 0, NoSuchCell = 1, Loaded = 2 };
69 static constexpr bool XLCreateIfMissing =
true;
70 static constexpr bool XLDoNotCreateIfMissing =
false;
76 void updateCurrentCell(
bool createIfMissing)
const;
96 [[nodiscard]]
bool endReached() const noexcept {
return m_endReached; }
101 [[nodiscard]] uint64_t distance(
const XLCellIterator& last)
const;
106 [[nodiscard]] std::string address()
const;
115 mutable uint32_t m_hintRow;
116 mutable XLCell m_currentCell;
117 mutable CellStatus m_currentCellStatus;
118 uint32_t m_currentRow;
119 uint16_t m_currentColumn;
120 std::vector<XLStyleIndex>
const* m_colStyles;
135 {
return static_cast<std::iterator_traits<XLCellIterator>::difference_type
>(first.
distance(last)); }
A forward iterator for iterating over a range of cells.
Definition XLCellIterator.hpp:47
bool operator==(const XLCellIterator &rhs) const noexcept
Definition XLCellIterator.cpp:252
XLCellIterator & operator++()
Definition XLCellIterator.cpp:203
XLCell & reference
Definition XLCellIterator.hpp:53
uint64_t distance(const XLCellIterator &last) const
Definition XLCellIterator.cpp:284
XLCellIterator & operator=(XLCellIterator &&other) noexcept=default
bool endReached() const noexcept
Definition XLCellIterator.hpp:96
XLCell value_type
Definition XLCellIterator.hpp:50
std::forward_iterator_tag iterator_category
Definition XLCellIterator.hpp:49
XLCell * pointer
Definition XLCellIterator.hpp:52
XLCellIterator(const XLCellIterator &other)=default
CellStatus
Definition XLCellIterator.hpp:55
XLCellIterator(XLCellIterator &&other) noexcept=default
int64_t difference_type
Definition XLCellIterator.hpp:51
bool cellExists() const
Definition XLCellIterator.cpp:275
~XLCellIterator()=default
XLCellIterator & operator=(const XLCellIterator &other)=default
XLCellIterator(const XLCellRange &cellRange, XLIteratorLocation loc, std::vector< XLStyleIndex > const *colStyles)
Definition XLCellIterator.cpp:102
pointer operator->()
Definition XLCellIterator.cpp:243
std::string address() const
Definition XLCellIterator.cpp:301
reference operator*()
Definition XLCellIterator.cpp:234
bool operator!=(const XLCellIterator &rhs) const noexcept
Definition XLCellIterator.cpp:270
Represents a rectangular area of cells within a worksheet.
Definition XLCellRange.hpp:40
Definition XLCellReference.hpp:44
An implementation class encapsulating the properties and behaviours of a spreadsheet cell.
Definition XLCell.hpp:51
Definition IXLCellProvider.hpp:24
XMLNode findRowNode(XMLNode sheetDataNode, uint32_t rowNumber)
locate the XML row node within sheetDataNode for the row at rowNumber
Definition XLCellIterator.cpp:28
XLIteratorLocation
Definition XLIterator.hpp:17
XMLNode findCellNode(XMLNode rowNode, uint16_t columnNumber)
locate the XML cell node within rownode for the cell at columnNumber
Definition XLCellIterator.cpp:60
OpenXLSX_xml_node XMLNode
Definition XLXmlParser.hpp:64
std::ostream & operator<<(std::ostream &os, const XLCell &c)
ostream output of XLCell content
Definition XLCell.hpp:329
std::reference_wrapper< const XLSharedStrings > XLSharedStringsRef
Definition XLSharedStrings.hpp:67
Definition XLCellIterator.hpp:131
std::iterator_traits< XLCellIterator >::difference_type distance< XLCellIterator >(XLCellIterator first, XLCellIterator last)
Definition XLCellIterator.hpp:134