OpenXLSX 1.9.1
Loading...
Searching...
No Matches
OpenXLSX::XLFormulaEngine Class Reference

#include <XLFormulaEngine.hpp>

Public Member Functions

 XLFormulaEngine ()
 
 ~XLFormulaEngine ()=default
 
 XLFormulaEngine (const XLFormulaEngine &)=delete
 
XLFormulaEngineoperator= (const XLFormulaEngine &)=delete
 
 XLFormulaEngine (XLFormulaEngine &&)=default
 
XLFormulaEngineoperator= (XLFormulaEngine &&)=default
 
XLCellValue evaluate (std::string_view formula, const XLCellResolver &resolver={}) const
 Evaluate a formula string.
 

Static Public Member Functions

static XLCellResolver makeResolver (const XLWorksheet &wks)
 Create a CellResolver that reads live values from an XLWorksheet.
 

Constructor & Destructor Documentation

◆ XLFormulaEngine() [1/3]

XLFormulaEngine::XLFormulaEngine ( )

◆ ~XLFormulaEngine()

OpenXLSX::XLFormulaEngine::~XLFormulaEngine ( )
default

◆ XLFormulaEngine() [2/3]

OpenXLSX::XLFormulaEngine::XLFormulaEngine ( const XLFormulaEngine )
delete

◆ XLFormulaEngine() [3/3]

OpenXLSX::XLFormulaEngine::XLFormulaEngine ( XLFormulaEngine &&  )
default

Member Function Documentation

◆ evaluate()

XLCellValue XLFormulaEngine::evaluate ( std::string_view  formula,
const XLCellResolver resolver = {} 
) const

Evaluate a formula string.

Parameters
formulaThe formula text (with or without leading '=').
resolverCallback to look up cell values. May be empty if the formula contains no cell references.
Returns
The computed XLCellValue; an error value on evaluation failure.

◆ makeResolver()

XLCellResolver XLFormulaEngine::makeResolver ( const XLWorksheet wks)
static

Create a CellResolver that reads live values from an XLWorksheet.

Parameters
wksThe source worksheet.
Returns
A resolver callable capturing a reference to wks.
Note
The returned resolver is only valid while wks is alive.

◆ operator=() [1/2]

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

◆ operator=() [2/2]

XLFormulaEngine & OpenXLSX::XLFormulaEngine::operator= ( XLFormulaEngine &&  )
default

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