OpenXLSX 1.12.1
Modern C++ Excel Library (Fork of OpenXLSX by Kenneth Troldal Balslev)
Loading...
Searching...
No Matches
XLFormulaUtils.cpp File Reference
#include "XLFormulaUtils.hpp"
#include <fmt/format.h>
#include <atomic>
#include <cctype>
#include <cmath>
#include <limits>
#include <mutex>

Namespaces

namespace  OpenXLSX
namespace  OpenXLSX::formula

Functions

void OpenXLSX::formula::setFormulaRandomSeed (uint64_t seed)
 Seed the formula RNG (thread-local engines reseed on next use).
void OpenXLSX::formula::clearFormulaRandomSeed ()
std::optional< uint64_t > OpenXLSX::formula::formulaRandomSeed ()
std::mt19937_64 & OpenXLSX::formula::formulaRng ()
double OpenXLSX::formula::toDouble (const XLCellValue &v)
bool OpenXLSX::formula::isNumeric (const XLCellValue &v)
bool OpenXLSX::formula::isEmpty (const XLCellValue &v)
bool OpenXLSX::formula::isError (const XLCellValue &v)
std::string OpenXLSX::formula::toString (const XLCellValue &v)
XLCellValue OpenXLSX::formula::makeError (std::string_view token)
std::string OpenXLSX::formula::strTrim (std::string s)
bool OpenXLSX::formula::tryParseNumericString (std::string_view s, double &out)
 Parse a fully-numeric string (optional leading/trailing space) to double.
XLCellValue OpenXLSX::formula::coerceToNumber (const XLCellValue &v, bool blankAsZero=true)
 Excel-style scalar numeric coercion for math functions and arithmetic.
XLCellValue OpenXLSX::formula::coerceArgScalar (const XLFormulaArg &arg, bool blankAsZero=true)
 Coerce the first scalar of an argument (implicit intersection / top-left).
XLCellValue OpenXLSX::formula::firstError (const XLFormulaArg &arg)
 First error value found in argument cells (Excel left-to-right, top-to-bottom).
XLCellValue OpenXLSX::formula::firstError (const std::vector< XLFormulaArg > &args)
std::vector< double > OpenXLSX::formula::numerics (const std::vector< XLFormulaArg > &args)
std::vector< double > OpenXLSX::formula::numerics (const XLFormulaArg &arg)
std::vector< double > OpenXLSX::formula::numericsOrError (const XLFormulaArg &arg, XLCellValue &outError)
std::vector< double > OpenXLSX::formula::numericsOrError (const std::vector< XLFormulaArg > &args, XLCellValue &outError)
 Like numerics(), but if any cell is an Error, sets outError and returns {}.