OpenXLSX 1.12.1
Modern C++ Excel Library (Fork of OpenXLSX by Kenneth Troldal Balslev)
Loading...
Searching...
No Matches
OpenXLSX::XLStreamReader Class Reference

#include <XLStreamReader.hpp>

Public Member Functions

 XLStreamReader ()=default
 XLStreamReader (const XLStreamReader &)=delete
XLStreamReader & operator= (const XLStreamReader &)=delete
 XLStreamReader (XLStreamReader &&other) noexcept
XLStreamReader & operator= (XLStreamReader &&other) noexcept
 ~XLStreamReader ()
bool hasNext ()
 Checks if there are more rows to read (physical and/or synthetic empty).
std::vector< XLCellValue > nextRow ()
 Parses and returns the next row of cell values (backward-compatible API).
std::vector< XLStreamCellView > nextRowDetailed ()
 Next row with formula, style index, and column metadata per cell.
std::vector< std::string > nextRowStrings ()
 Next row as display strings (optionally applying number formats).
std::vector< XLStreamCellView > nextRowSparse ()
 Next row containing only non-empty cells (no sparse padding).
bool nextRowInto (std::vector< XLCellValue > &out)
 Fill out with the next dense row values; returns false at end.
bool nextRowDetailedInto (std::vector< XLStreamCellView > &out)
 Fill out with the next detailed row; returns false at end.
std::vector< XLStreamCellView > nextRowProjected ()
 Next row with only columns listed in options.columnFilter (or non-empty cells if filter empty).
bool forEachCellInNextRow (const std::function< void(const XLStreamCellView &)> &fn)
 Consume the next logical row and invoke fn for each projected cell.
XLStreamColumns streamColumns ()
 Materialize all columns via one full stream pass (excelize Cols equivalent).
std::string formattedValue (const XLStreamCellView &cell) const
 Format a single cell view using workbook styles when applyNumberFormats is enabled.
uint32_t currentRow () const
 1-based index of the row last returned by nextRow / nextRowDetailed / nextRowStrings.
XLStreamRowOptsView currentRowOpts () const
 Row options for the last returned row.
const std::string & lastError () const
 Last error message from a soft parse failure (empty if none).
void close ()
 Closes the reader and releases resources.
const XLStreamReadOptions & options () const

Friends

class XLWorksheet

Constructor & Destructor Documentation

◆ XLStreamReader() [1/3]

OpenXLSX::XLStreamReader::XLStreamReader ( )
default

◆ XLStreamReader() [2/3]

OpenXLSX::XLStreamReader::XLStreamReader ( const XLStreamReader & )
delete

◆ XLStreamReader() [3/3]

OpenXLSX::XLStreamReader::XLStreamReader ( XLStreamReader && other)
noexcept

◆ ~XLStreamReader()

OpenXLSX::XLStreamReader::~XLStreamReader ( )

Member Function Documentation

◆ close()

void OpenXLSX::XLStreamReader::close ( )

Closes the reader and releases resources.

◆ currentRow()

uint32_t OpenXLSX::XLStreamReader::currentRow ( ) const

1-based index of the row last returned by nextRow / nextRowDetailed / nextRowStrings.

◆ currentRowOpts()

XLStreamRowOptsView OpenXLSX::XLStreamReader::currentRowOpts ( ) const

Row options for the last returned row.

◆ forEachCellInNextRow()

bool OpenXLSX::XLStreamReader::forEachCellInNextRow ( const std::function< void(const XLStreamCellView &)> & fn)

Consume the next logical row and invoke fn for each projected cell.

Returns
false at end of sheet.

◆ formattedValue()

std::string OpenXLSX::XLStreamReader::formattedValue ( const XLStreamCellView & cell) const

Format a single cell view using workbook styles when applyNumberFormats is enabled.

◆ hasNext()

bool OpenXLSX::XLStreamReader::hasNext ( )

Checks if there are more rows to read (physical and/or synthetic empty).

◆ lastError()

const std::string & OpenXLSX::XLStreamReader::lastError ( ) const
inline

Last error message from a soft parse failure (empty if none).

◆ nextRow()

std::vector< XLCellValue > OpenXLSX::XLStreamReader::nextRow ( )

Parses and returns the next row of cell values (backward-compatible API).

Empty cells between non-empty columns are filled as XLValueType::Empty. Does not allocate a DOM tree per row.

◆ nextRowDetailed()

std::vector< XLStreamCellView > OpenXLSX::XLStreamReader::nextRowDetailed ( )

Next row with formula, style index, and column metadata per cell.

◆ nextRowDetailedInto()

bool OpenXLSX::XLStreamReader::nextRowDetailedInto ( std::vector< XLStreamCellView > & out)

Fill out with the next detailed row; returns false at end.

◆ nextRowInto()

bool OpenXLSX::XLStreamReader::nextRowInto ( std::vector< XLCellValue > & out)

Fill out with the next dense row values; returns false at end.

Reuses out capacity to reduce allocations in tight ETL loops.

◆ nextRowProjected()

std::vector< XLStreamCellView > OpenXLSX::XLStreamReader::nextRowProjected ( )

Next row with only columns listed in options.columnFilter (or non-empty cells if filter empty).

Sparse: no empty padding between columns. Ideal for wide-table ETL projection.

◆ nextRowSparse()

std::vector< XLStreamCellView > OpenXLSX::XLStreamReader::nextRowSparse ( )

Next row containing only non-empty cells (no sparse padding).

◆ nextRowStrings()

std::vector< std::string > OpenXLSX::XLStreamReader::nextRowStrings ( )

Next row as display strings (optionally applying number formats).

Empty cells become empty strings. When options.applyNumberFormats is false, uses raw string conversion of XLCellValue (similar to excelize RawCellValue path).

◆ operator=() [1/2]

XLStreamReader & OpenXLSX::XLStreamReader::operator= ( const XLStreamReader & )
delete

◆ operator=() [2/2]

XLStreamReader & OpenXLSX::XLStreamReader::operator= ( XLStreamReader && other)
noexcept

◆ options()

const XLStreamReadOptions & OpenXLSX::XLStreamReader::options ( ) const
inline

◆ streamColumns()

XLStreamColumns OpenXLSX::XLStreamReader::streamColumns ( )

Materialize all columns via one full stream pass (excelize Cols equivalent).

Invalidates further nextRow* use on this reader (consumes the stream).

◆ XLWorksheet

friend class XLWorksheet
friend

The documentation for this class was generated from the following files: