11#ifndef OPENXLSX_IXLCELLPROVIDER_HPP
12#define OPENXLSX_IXLCELLPROVIDER_HPP
14#include "OpenXLSX-Exports.hpp"
44 [[nodiscard]]
virtual std::string
getCellFormula(uint32_t row, uint16_t col)
const = 0;
49 [[nodiscard]]
virtual bool hasCell(uint32_t row, uint16_t col)
const = 0;
54 [[nodiscard]]
virtual std::string
sheetName()
const = 0;
68 size_t count =
static_cast<size_t>(r2 - r1 + 1) *
static_cast<size_t>(c2 - c1 + 1);
69 out.reserve(out.size() + count);
71 for (uint32_t r = r1; r <= r2; ++r) {
72 for (uint16_t c = c1; c <= c2; ++c) {
Abstract immutable interface for accessing cell values and formulas across spreadsheet grids.
Definition IXLCellProvider.hpp:32
virtual std::string sheetName() const =0
Get sheet name.
virtual ~IXLCellProvider()=default
virtual std::string getCellFormula(uint32_t row, uint16_t col) const =0
Get formula string at 1-based (row, column), or empty string if no formula.
virtual XLCellValue getCellValue(uint32_t row, uint16_t col) const =0
Get cell value at 1-based (row, column).
virtual void fetchRangeValues(const XLCellRange &range, std::vector< XLCellValue > &out) const
Batch fetch values for a rectangular range into an output vector.
Definition IXLCellProvider.hpp:61
virtual bool hasCell(uint32_t row, uint16_t col) const =0
Check if cell exists and is populated.
Represents a rectangular area of cells within a worksheet.
Definition XLCellRange.hpp:40
XLCellReference topLeft() const
Definition XLCellRange.cpp:90
XLCellReference bottomRight() const
Definition XLCellRange.cpp:95
uint32_t row() const noexcept
Get the row number of the XLCellReference.
Definition XLCellReference.cpp:157
uint16_t column() const noexcept
Get the column number of the XLCellReference.
Definition XLCellReference.cpp:175
Class encapsulating a cell value.
Definition XLCellValue.hpp:89
Definition IXLCellProvider.hpp:24