Global interfaces

The following global interfaces are used to abstract the concrete filter and document classes from orcus’s CLI framework.

class import_filter

Base interface for import filters.

Subclassed by orcus::orcus_csv, orcus::orcus_gnumeric, orcus::orcus_ods, orcus::orcus_parquet, orcus::orcus_xls_xml, orcus::orcus_xlsx

Public Functions

import_filter(format_t input)
virtual ~import_filter()
virtual void read_file(std::string_view filepath) = 0

Read the content of a file.

Parameters:

filepath – path to a local file. It must be a system path.

virtual void read_stream(std::string_view stream) = 0

Read the content of an in-memory stream.

Parameters:

stream – in-memory stream to read from.

virtual std::string_view get_name() const = 0

Get the name of a filter.

Returns:

name of a filter.

void set_config(const orcus::config &v)
const orcus::config &get_config() const
class document_dumper

Base interface for document content dumpers.

Subclassed by orcus::spreadsheet::document

Public Functions

virtual ~document_dumper()
virtual void dump(dump_format_t format, const std::string &output) const = 0

Dump the content of a document in a specified format, either into set of multiple files, or a single file.

Parameters:
  • format – Output format type in which to dump the content.

  • output – Depending on the output format type, this can be either an output directory path where multiple output files get created, or an output file path where the content of the entire document gets dumped into.

virtual void dump_check(std::ostream &os) const = 0

Dump the content of a document in a specialized “check” format suitable for content verification.

Parameters:

os – output stream to write the transformed content to.