import_formula

Defined in header: <orcus/spreadsheet/import_interface.hpp>

class import_formula

Interface for importing the properties of a single formula cell. A formula cell contains a formula expression that can be computed, and optionally a cached result of the last computation performed on the expression.

Public Functions

virtual ~import_formula()
virtual void set_position(row_t row, col_t col) = 0

Set the position of a cell.

Parameters:
  • row – row position.

  • col – column position.

virtual void set_formula(formula_grammar_t grammar, std::string_view formula) = 0

Set formula string to a cell.

Parameters:
  • grammar – grammar to use to compile the formula string into tokens.

  • formula – formula expression to store.

virtual void set_shared_formula_index(size_t index) = 0

Register the formula stored in a cell as a shared formula to be shared with other cells, if the cell contains a formula string.

If a cell references a shared formula stored in another cell, only specify the index of that shared formula without specifying a formula string of its own. In that case, it is expected that another formula cell registers its formula string for that index.

Parameters:

index – shared string index to register the formula with.

virtual void set_result_string(std::string_view value) = 0

Set cached result of string type.

Parameters:

value – string result value.

virtual void set_result_value(double value) = 0

Set cached result of numeric type.

Parameters:

value – numeric value to set as a cached result.

virtual void set_result_bool(bool value) = 0

Set cached result of boolean type.

Parameters:

value – boolean value to set as a cached result.

virtual void set_result_empty() = 0

Set empty value as a cached result.

virtual void commit() = 0

Commit all the formula data to the specified cell.