document

Defined in header: <ixion/document.hpp>

class document

Higher level document representation designed to handle both cell value storage as well as formula cell calculations.

Public Functions

document()
document(formula_name_resolver_t cell_address_type)

Constructor with custom cell address type.

Parameters:

cell_address_type – cell address type to use for cell addresses represented by string values.

~document()
void append_sheet(std::string name)
void set_sheet_name(sheet_t sheet, std::string name)

Set a new name to an existing sheet.

Parameters:
  • sheet – 0-based sheet index.

  • name – New name of a sheet.

cell_access get_cell_access(const cell_pos &pos) const
void set_numeric_cell(const cell_pos &pos, double val)
void set_string_cell(const cell_pos &pos, std::string_view s)
void set_boolean_cell(const cell_pos &pos, bool val)
void empty_cell(const cell_pos &pos)
double get_numeric_value(const cell_pos &pos) const
std::string_view get_string_value(const cell_pos &pos) const
void set_formula_cell(const cell_pos &pos, std::string_view formula)
void calculate(size_t thread_count)

Calculate all the “dirty” formula cells in the document.

Parameters:

thread_count – number of threads to use to perform calculation. When 0 is specified, it only uses the main thread.

struct cell_pos

Public Types

enum class cp_type

Values:

enumerator string
enumerator address

Public Functions

cell_pos() = delete
cell_pos(const char *p)
cell_pos(std::string_view s)
cell_pos(const std::string &s)
cell_pos(const abs_address_t &addr)
cell_pos(const cell_pos &other)
cell_pos &operator=(const cell_pos &other)

Public Members

cp_type type
std::variant<std::string_view, ixion::abs_address_t> value