sheet
Defined in header: <orcus/spreadsheet/sheet.hpp>
-
class sheet
This class represents a single sheet instance in the internal document model.
Public Functions
-
~sheet() noexcept
-
void set_string(row_t row, col_t col, std::string_view s)
Set a string value to a specified cell address.
- Parameters:
row – Row position of the cell.
col – Column position of the cell.
s – String value to set to the cell.
-
void set_string(row_t row, col_t col, string_id_t sindex)
-
void set_date_time(row_t row, col_t col, int year, int month, int day, int hour, int minute, double second)
-
void set_formula(row_t row, col_t col, const ixion::formula_tokens_store_ptr_t &tokens)
-
void set_formula(row_t row, col_t col, const ixion::formula_tokens_store_ptr_t &tokens, ixion::formula_result result)
-
void set_grouped_formula(const range_t &range, ixion::formula_tokens_t tokens)
-
void set_grouped_formula(const range_t &range, ixion::formula_tokens_t tokens, ixion::formula_result result)
-
void set_col_width(col_t col, col_t col_span, col_width_t width)
-
col_width_t get_col_width(col_t col, col_t *col_start, col_t *col_end) const
Get column width in twips.
- Parameters:
col – column index
col_start – pointer to a variable to store the index of the starting column of the range with the same width. Pass nullptr if the caller doesn’t need this information.
col_end – pointer to a variable to store the index of the ending column plus one, of the range with the same width. Pass nullptr if the caller doesn’t need this information.
- Returns:
width of the specified column index (in twips).
-
void set_row_height(row_t row, row_t row_span, row_height_t height)
-
row_height_t get_row_height(row_t row, row_t *row_start, row_t *row_end) const
-
range_t get_merge_cell_range(row_t row, col_t col) const
Return the size of a merged cell range.
- Parameters:
row – row position of the upper-left cell.
col – column position of the upper-left cell.
- Returns:
merged cell range.
-
void set_auto_filter(std::unique_ptr<auto_filter_t> filter)
-
const auto_filter_t *get_auto_filter() const
-
ixion::abs_range_t get_data_range() const
Return the smallest range that contains all non-empty cells in this sheet. The top-left corner of the returned range is always column 0 and row 0.
- Returns:
smallest range that contains all non-empty cells.
-
date_time_t get_date_time(row_t row, col_t col) const
-
void dump_flat(std::ostream &os) const
Dump the content of an entire sheet in flat-text format where cell values are placed in a ASCII art box.
- Parameters:
os – Output stream to dump the content to.
-
void dump_check(std::ostream &os, std::string_view sheet_name) const
Dump the content of an entire sheet where each line contains the position and content of a single cell.
- Parameters:
os – Output stream to dump the content to.
sheet_name – Sheet name to use in the output.
-
void dump_html(std::ostream &os) const
Dump the content of an entire sheet in HTML format.
- Parameters:
os – Output stream to dump the content to.
-
void dump_json(std::ostream &os) const
Dump the content of an entire sheet in JSON format.
- Parameters:
os – Output stream to dump the content to.
-
void dump_csv(std::ostream &os) const
Dump the content of an entire sheet in CSV format.
- Parameters:
os – Output stream to dump the content to.
-
void dump_debug_state(const std::filesystem::path &output_dir, std::string_view sheet_name) const
Dump the stored state of a sheet across multiple files. This is useful for debugging.
- Parameters:
output_dir – Path to the output directory in which to dump the state files.
sheet_name – Sheet name to use in the debug state files.
Friends
- friend struct detail::sheet_impl
-
~sheet() noexcept