#include <XLFormulaEngine.hpp>
|
| | XLFormulaEngine () |
| | ~XLFormulaEngine () |
| | XLFormulaEngine (const XLFormulaEngine &)=delete |
| XLFormulaEngine & | operator= (const XLFormulaEngine &)=delete |
| | XLFormulaEngine (XLFormulaEngine &&)=delete |
| XLFormulaEngine & | operator= (XLFormulaEngine &&)=delete |
| void | setAstCacheEnabled (bool enabled) noexcept |
| bool | astCacheEnabled () const noexcept |
| void | setAstCacheCapacity (std::size_t capacity) noexcept |
| std::size_t | astCacheCapacity () const noexcept |
| std::size_t | astCacheSize () const |
| void | clearAstCache () |
| XLCellValue | evaluate (std::string_view formula, const XLCellResolver &resolver={}, XLFormulaDiagnosticReporter *reporter=nullptr) const |
| | Evaluate a formula string.
|
| XLCellValue | evaluate (std::string_view formula, XLEvalSession &session, XLFormulaDiagnosticReporter *reporter=nullptr) const |
| | Evaluate with a full evaluation session (names, current cell, depth, …).
|
| XLFormulaArg | evaluateArray (std::string_view formula, const XLCellResolver &resolver={}, XLFormulaDiagnosticReporter *reporter=nullptr) const |
| | Evaluate a formula preserving full array/range shape (Phase B spill path).
|
| XLFormulaArg | evaluateArray (std::string_view formula, XLEvalSession &session, XLFormulaDiagnosticReporter *reporter=nullptr) const |
| | Session-aware array evaluation (FILTER/UNIQUE/SORT/SEQUENCE, range arithmetic, …).
|
◆ XLFormulaEngine() [1/3]
| XLFormulaEngine::XLFormulaEngine |
( |
| ) |
|
◆ ~XLFormulaEngine()
| XLFormulaEngine::~XLFormulaEngine |
( |
| ) |
|
|
default |
◆ XLFormulaEngine() [2/3]
| OpenXLSX::XLFormulaEngine::XLFormulaEngine |
( |
const XLFormulaEngine & | | ) |
|
|
delete |
◆ XLFormulaEngine() [3/3]
| OpenXLSX::XLFormulaEngine::XLFormulaEngine |
( |
XLFormulaEngine && | | ) |
|
|
delete |
◆ astCacheCapacity()
| std::size_t OpenXLSX::XLFormulaEngine::astCacheCapacity |
( |
| ) |
const |
|
inlinenodiscardnoexcept |
◆ astCacheEnabled()
| bool OpenXLSX::XLFormulaEngine::astCacheEnabled |
( |
| ) |
const |
|
inlinenodiscardnoexcept |
◆ astCacheSize()
| std::size_t XLFormulaEngine::astCacheSize |
( |
| ) |
const |
|
nodiscard |
◆ clearAstCache()
| void XLFormulaEngine::clearAstCache |
( |
| ) |
|
Drop all cached parse trees.
◆ evaluate() [1/2]
Evaluate a formula string.
- Parameters
-
| formula | The formula text (with or without leading '='). |
| resolver | Callback 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.
- Note
- Prefer pairing with an XLEvaluationContext via makeResolver(context) so formula code depends only on the sheet-read port, not a concrete worksheet type:
Evaluation context backed by a live worksheet (and its workbook for sheet-qualified refs).
Definition XLEvaluationContext.hpp:75
◆ evaluate() [2/2]
Evaluate with a full evaluation session (names, current cell, depth, …).
Multi-cell array results are reduced via implicit intersection (top-left). Use evaluateArray() when the full spill shape is required.
◆ evaluateArray() [1/2]
Evaluate a formula preserving full array/range shape (Phase B spill path).
◆ evaluateArray() [2/2]
Session-aware array evaluation (FILTER/UNIQUE/SORT/SEQUENCE, range arithmetic, …).
◆ expandRange()
Expand an A1 cell/range reference using the given resolver.
Public so session-aware functions (INDIRECT, OFFSET) can build LazyRanges.
◆ makeResolver() [1/3]
Create a CellResolver that reads live values from an IXLCellProvider interface.
- Parameters
-
| provider | The cell data provider (can be an XLWorksheet or mock provider). |
- Returns
- A resolver callable capturing a reference to
provider.
- Note
- The returned resolver is only valid while
provider is alive.
◆ makeResolver() [2/3]
Create a CellResolver that reads live values from an evaluation context.
- Parameters
-
| context | The abstract sheet-read port. |
- Returns
- A resolver callable capturing a reference to
context.
- Note
- The returned resolver is only valid while
context is alive.
◆ makeResolver() [3/3]
Create a CellResolver that reads live values from an XLWorksheet.
- Parameters
-
- Returns
- A resolver callable capturing a reference to
wks.
- Note
- The returned resolver is only valid while
wks is alive.
-
Prefer XLWorksheetEvaluationContext + evaluate(formula, context) for new code.
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ setAstCacheCapacity()
| void XLFormulaEngine::setAstCacheCapacity |
( |
std::size_t | capacity | ) |
|
|
noexcept |
Max distinct formulas retained in the cache (default 512). LRU-ish drop of arbitrary entry when full.
◆ setAstCacheEnabled()
| void OpenXLSX::XLFormulaEngine::setAstCacheEnabled |
( |
bool | enabled | ) |
|
|
inlinenoexcept |
Enable/disable parse-tree caching (default: enabled).
◆ XLFormulaParser
| friend class XLFormulaParser |
|
friend |
The documentation for this class was generated from the following files: