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

A structure that represents a cell to be appended via the streaming API. More...

#include <XLStreamWriter.hpp>

Public Member Functions

 XLStreamCell (XLCellValue val)
 XLStreamCell (XLCellValue val, XLStyleIndex style)
 XLStreamCell (XLCellValue val, XLStyleIndex style, std::string formulaText)

Static Public Member Functions

static XLStreamCell withFormula (std::string formulaText, XLCellValue cached=XLCellValue {})
static XLStreamCell withArrayFormula (std::string formulaText, std::string ref={}, XLCellValue cached=XLCellValue {})
 Array formula (t="array", optional ref= for multi-cell CSE).
static XLStreamCell withSharedFormula (int si, std::string formulaText={}, std::string ref={}, XLCellValue cached=XLCellValue {})
 Shared formula master (t="shared" si=… ref=…) or dependent (empty formula body, si= only).
static XLStreamCell withDateTime (const XLDateTime &dt, std::optional< XLStyleIndex > style=std::nullopt)
 Date/time cell: stores Excel serial and requests an automatic date number format.

Data Fields

XLCellValue value
std::optional< XLStyleIndex > styleIndex
std::optional< std::string > formula
bool treatAsDate {false}
XLStreamFormulaType formulaType {XLStreamFormulaType::Normal}
std::optional< std::string > formulaRef
std::optional< int > formulaSi
bool formulaCa {false}

Detailed Description

A structure that represents a cell to be appended via the streaming API.

Constructor & Destructor Documentation

◆ XLStreamCell() [1/3]

OpenXLSX::XLStreamCell::XLStreamCell ( XLCellValue val)
inlineexplicit

◆ XLStreamCell() [2/3]

OpenXLSX::XLStreamCell::XLStreamCell ( XLCellValue val,
XLStyleIndex style )
inline

◆ XLStreamCell() [3/3]

OpenXLSX::XLStreamCell::XLStreamCell ( XLCellValue val,
XLStyleIndex style,
std::string formulaText )
inline

Member Function Documentation

◆ withArrayFormula()

XLStreamCell OpenXLSX::XLStreamCell::withArrayFormula ( std::string formulaText,
std::string ref = {},
XLCellValue cached = XLCellValue {} )
inlinestatic

Array formula (t="array", optional ref= for multi-cell CSE).

◆ withDateTime()

XLStreamCell OpenXLSX::XLStreamCell::withDateTime ( const XLDateTime & dt,
std::optional< XLStyleIndex > style = std::nullopt )
inlinestatic

Date/time cell: stores Excel serial and requests an automatic date number format.

Parameters
dtExcel date/time value.
styleOptional explicit style; when omitted the writer caches a default date style.

◆ withFormula()

XLStreamCell OpenXLSX::XLStreamCell::withFormula ( std::string formulaText,
XLCellValue cached = XLCellValue {} )
inlinestatic

◆ withSharedFormula()

XLStreamCell OpenXLSX::XLStreamCell::withSharedFormula ( int si,
std::string formulaText = {},
std::string ref = {},
XLCellValue cached = XLCellValue {} )
inlinestatic

Shared formula master (t="shared" si=… ref=…) or dependent (empty formula body, si= only).

Field Documentation

◆ formula

std::optional<std::string> OpenXLSX::XLStreamCell::formula

◆ formulaCa

bool OpenXLSX::XLStreamCell::formulaCa {false}

◆ formulaRef

std::optional<std::string> OpenXLSX::XLStreamCell::formulaRef

◆ formulaSi

std::optional<int> OpenXLSX::XLStreamCell::formulaSi

◆ formulaType

XLStreamFormulaType OpenXLSX::XLStreamCell::formulaType {XLStreamFormulaType::Normal}

◆ styleIndex

std::optional<XLStyleIndex> OpenXLSX::XLStreamCell::styleIndex

◆ treatAsDate

bool OpenXLSX::XLStreamCell::treatAsDate {false}

When true and styleIndex is empty, writer applies the cached default date/time style.

◆ value

XLCellValue OpenXLSX::XLStreamCell::value

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