Spreadsheet Document¶
Document¶
-
class
document
: public orcus::iface::document_dumper¶ Internal document representation used only for testing the filters. It uses ixion’s model_context implementation to store raw cell values.
Public Functions
-
document
()¶
-
~document
()¶
-
styles &
get_styles
()¶
-
const styles &
get_styles
() const¶
-
pivot_collection &
get_pivot_collection
()¶
-
const pivot_collection &
get_pivot_collection
() const¶
-
void
calc_formulas
()¶
-
void
clear
()¶ Clear document content, to make it empty.
-
virtual void
dump_flat
(const std::string &outdir) const¶ Dump document content to specified output directory.
-
virtual void
dump_html
(const std::string &outdir) const¶ File name should not contain an extension. The final name will be [filename] + _ + [sheet name] + .html.
- Parameters
filename
: base file name
-
virtual void
dump_json
(const std::string &outdir) const¶
-
virtual void
dump_csv
(const std::string &outdir) const¶
-
virtual void
dump_check
(std::ostream &os) const¶ Dump document content to stdout in the special format used for content verification during unit test.
-
size_t
sheet_size
() const¶
-
void
set_origin_date
(int year, int month, int day)¶
-
date_time_t
get_origin_date
() const¶
-
void
set_formula_grammar
(formula_grammar_t grammar)¶
-
formula_grammar_t
get_formula_grammar
() const¶
-
const ixion::formula_name_resolver *
get_formula_name_resolver
() const¶
-
ixion::model_context &
get_model_context
()¶
-
const ixion::model_context &
get_model_context
() const¶
-
const document_config &
get_config
() const¶
-
void
set_config
(const document_config &cfg)¶
-
string_pool &
get_string_pool
()¶
-
void
insert_table
(table_t *p)¶ Insert a new table object into the document. The document will take ownership of the inserted object after the call. The object will get inserted only when there is no pre-existing table object of the same name. The object not being inserted will be deleted.
- Parameters
p
: table object to insert.
-
void
finalize
()¶
-
Sheet¶
-
class
sheet
¶ This class represents a single sheet instance in the internal document model.
Public Functions
-
virtual
~sheet
()¶
-
void
set_date_time
(row_t row, col_t col, int year, int month, int day, int hour, int minute, double second)¶
-
void
set_col_width
(col_t col, col_width_t width)¶
-
col_width_t
get_col_width
(col_t col, col_t *col_start, col_t *col_end) const¶
-
void
set_row_height
(row_t row, 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.
- Return
- merged cell range.
- Parameters
row
: row position of the upper-left cell.col
: column position of the upper-left cell.
-
auto_filter_t *
get_auto_filter_data
()¶
-
const auto_filter_t *
get_auto_filter_data
() const¶
-
void
set_auto_filter_data
(auto_filter_t *p)¶
-
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.
- Return
- smallest range that contains all non-empty cells.
-
sheet_range
get_sheet_range
(row_t row_start, col_t col_start, row_t row_end, col_t col_end) const¶ Return a sheet range object that represents a sub-range within the sheet.
- Return
- sheet range object.
- Parameters
row_start
: start row position (0-based).col_start
: start column position (0-based).row_end
: end row position (0-based).col_end
: end column position (0-based).
-
date_time_t
get_date_time
(row_t row, col_t col) const¶
-
void
finalize
()¶
-
void
dump_flat
(std::ostream &os) const¶
-
void
dump_html
(std::ostream &os) const¶
-
void
dump_json
(std::ostream &os) const¶
-
void
dump_csv
(std::ostream &os) const¶
-
virtual
Import Factory¶
-
class
import_factory
: public orcus::spreadsheet::iface::import_factory¶ Public Functions
-
virtual
~import_factory
()¶
-
virtual iface::import_global_settings *
get_global_settings
()¶
- Return
- pointer to the shared strings instance. It may return NULL if the client app doesn’t support shared strings.
-
virtual iface::import_styles *
get_styles
()¶ - Return
- pointer to the styles instance. It may return NULL if the client app doesn’t support styles.
-
virtual iface::import_named_expression *
get_named_expression
()¶
-
virtual iface::import_reference_resolver *
get_reference_resolver
()¶
-
virtual iface::import_pivot_cache_definition *
create_pivot_cache_definition
(orcus::spreadsheet::pivot_cache_id_t cache_id)¶ Create an interface for pivot cache definition import for a specified cache ID. In case a pivot cache alrady exists for the passed ID, the client app should overwrite the existing cache with a brand-new cache instance.
- Return
- pointer to the pivot cache interface instance. If may return NULL if the client app doesn’t support pivot tables.
- Parameters
cache_id
: numeric ID associated with the pivot cache.
-
virtual iface::import_pivot_cache_records *
create_pivot_cache_records
(orcus::spreadsheet::pivot_cache_id_t cache_id)¶ Create an interface for pivot cache records import for a specified cache ID.
- Return
- pointer to the pivot cache records interface instance. If may return nullptr if the client app doesn’t support pivot tables.
- Parameters
cache_id
: numeric ID associated with the pivot cache.
-
virtual iface::import_sheet *
append_sheet
(sheet_t sheet_index, const char *sheet_name, size_t sheet_name_length)¶ Append a sheet with specified sheet position index and name.
- Return
- pointer to the sheet instance. It may return nullptr if the client app fails to append a new sheet.
- Parameters
sheet_index
: position index of the sheet to be appended. It is 0-based i.e. the first sheet to be appended will have an index value of 0.sheet_name
: pointer to the first character in the buffer where the sheet name is stored.sheet_name_length
: length of the sheet name.
-
virtual iface::import_sheet *
get_sheet
(const char *sheet_name, size_t sheet_name_length)¶ - Return
- pointer to the sheet instance whose name matches the name passed to this method. It returns nullptr if no sheet instance exists by the specified name.
-
virtual iface::import_sheet *
get_sheet
(sheet_t sheet_index)¶ Retrieve sheet instance by specified numerical sheet index.
- Return
- pointer to the sheet instance, or nullptr if no sheet instance exists at specified sheet index position.
- Parameters
sheet_index
: sheet index
-
virtual void
finalize
()¶ This method is called at the end of import, to give the implementor a chance to perform post-processing if necessary.
-
void
set_character_set
(character_set_t charset)¶
-
character_set_t
get_character_set
() const¶
-
virtual