namespace orcus
Enum
character_set_t
-
enum class orcus::character_set_t
Character set types, generated from IANA character-sets specifications.
Values:
-
enumerator unspecified
-
enumerator adobe_standard_encoding
-
enumerator adobe_symbol_encoding
-
enumerator amiga_1251
-
enumerator ansi_x3_110_1983
-
enumerator asmo_449
-
enumerator big5
-
enumerator big5_hkscs
-
enumerator bocu_1
-
enumerator brf
-
enumerator bs_4730
-
enumerator bs_viewdata
-
enumerator cesu_8
-
enumerator cp50220
-
enumerator cp51932
-
enumerator csa_z243_4_1985_1
-
enumerator csa_z243_4_1985_2
-
enumerator csa_z243_4_1985_gr
-
enumerator csn_369103
-
enumerator dec_mcs
-
enumerator din_66003
-
enumerator dk_us
-
enumerator ds_2089
-
enumerator ebcdic_at_de
-
enumerator ebcdic_at_de_a
-
enumerator ebcdic_ca_fr
-
enumerator ebcdic_dk_no
-
enumerator ebcdic_dk_no_a
-
enumerator ebcdic_es
-
enumerator ebcdic_es_a
-
enumerator ebcdic_es_s
-
enumerator ebcdic_fi_se
-
enumerator ebcdic_fi_se_a
-
enumerator ebcdic_fr
-
enumerator ebcdic_it
-
enumerator ebcdic_pt
-
enumerator ebcdic_uk
-
enumerator ebcdic_us
-
enumerator ecma_cyrillic
-
enumerator es
-
enumerator es2
-
enumerator euc_jp
-
enumerator euc_kr
-
enumerator extended_unix_code_fixed_width_for_japanese
-
enumerator gb18030
-
enumerator gb2312
-
enumerator gb_1988_80
-
enumerator gb_2312_80
-
enumerator gbk
-
enumerator gost_19768_74
-
enumerator greek7
-
enumerator greek7_old
-
enumerator greek_ccitt
-
enumerator hp_desktop
-
enumerator hp_legal
-
enumerator hp_math8
-
enumerator hp_pi_font
-
enumerator hp_roman8
-
enumerator hz_gb_2312
-
enumerator ibm00858
-
enumerator ibm00924
-
enumerator ibm01140
-
enumerator ibm01141
-
enumerator ibm01142
-
enumerator ibm01143
-
enumerator ibm01144
-
enumerator ibm01145
-
enumerator ibm01146
-
enumerator ibm01147
-
enumerator ibm01148
-
enumerator ibm01149
-
enumerator ibm037
-
enumerator ibm038
-
enumerator ibm1026
-
enumerator ibm1047
-
enumerator ibm273
-
enumerator ibm274
-
enumerator ibm275
-
enumerator ibm277
-
enumerator ibm278
-
enumerator ibm280
-
enumerator ibm281
-
enumerator ibm284
-
enumerator ibm285
-
enumerator ibm290
-
enumerator ibm297
-
enumerator ibm420
-
enumerator ibm423
-
enumerator ibm424
-
enumerator ibm437
-
enumerator ibm500
-
enumerator ibm775
-
enumerator ibm850
-
enumerator ibm851
-
enumerator ibm852
-
enumerator ibm855
-
enumerator ibm857
-
enumerator ibm860
-
enumerator ibm861
-
enumerator ibm862
-
enumerator ibm863
-
enumerator ibm864
-
enumerator ibm865
-
enumerator ibm866
-
enumerator ibm868
-
enumerator ibm869
-
enumerator ibm870
-
enumerator ibm871
-
enumerator ibm880
-
enumerator ibm891
-
enumerator ibm903
-
enumerator ibm904
-
enumerator ibm905
-
enumerator ibm918
-
enumerator ibm_symbols
-
enumerator ibm_thai
-
enumerator iec_p27_1
-
enumerator inis
-
enumerator inis_8
-
enumerator inis_cyrillic
-
enumerator invariant
-
enumerator iso_10367_box
-
enumerator iso_10646_j_1
-
enumerator iso_10646_ucs_2
-
enumerator iso_10646_ucs_4
-
enumerator iso_10646_ucs_basic
-
enumerator iso_10646_unicode_latin1
-
enumerator iso_10646_utf_1
-
enumerator iso_11548_1
-
enumerator iso_2022_cn
-
enumerator iso_2022_cn_ext
-
enumerator iso_2022_jp
-
enumerator iso_2022_jp_2
-
enumerator iso_2022_kr
-
enumerator iso_2033_1983
-
enumerator iso_5427
-
enumerator iso_5427_1981
-
enumerator iso_5428_1980
-
enumerator iso_646_basic_1983
-
enumerator iso_646_irv_1983
-
enumerator iso_6937_2_25
-
enumerator iso_6937_2_add
-
enumerator iso_8859_1
-
enumerator iso_8859_10
-
enumerator iso_8859_13
-
enumerator iso_8859_14
-
enumerator iso_8859_15
-
enumerator iso_8859_16
-
enumerator iso_8859_1_windows_3_0_latin_1
-
enumerator iso_8859_1_windows_3_1_latin_1
-
enumerator iso_8859_2
-
enumerator iso_8859_2_windows_latin_2
-
enumerator iso_8859_3
-
enumerator iso_8859_4
-
enumerator iso_8859_5
-
enumerator iso_8859_6
-
enumerator iso_8859_6_e
-
enumerator iso_8859_6_i
-
enumerator iso_8859_7
-
enumerator iso_8859_8
-
enumerator iso_8859_8_e
-
enumerator iso_8859_8_i
-
enumerator iso_8859_9
-
enumerator iso_8859_9_windows_latin_5
-
enumerator iso_8859_supp
-
enumerator iso_ir_90
-
enumerator iso_unicode_ibm_1261
-
enumerator iso_unicode_ibm_1264
-
enumerator iso_unicode_ibm_1265
-
enumerator iso_unicode_ibm_1268
-
enumerator iso_unicode_ibm_1276
-
enumerator it
-
enumerator jis_c6220_1969_jp
-
enumerator jis_c6220_1969_ro
-
enumerator jis_c6226_1978
-
enumerator jis_c6226_1983
-
enumerator jis_c6229_1984_a
-
enumerator jis_c6229_1984_b
-
enumerator jis_c6229_1984_b_add
-
enumerator jis_c6229_1984_hand
-
enumerator jis_c6229_1984_hand_add
-
enumerator jis_c6229_1984_kana
-
enumerator jis_encoding
-
enumerator jis_x0201
-
enumerator jis_x0212_1990
-
enumerator jus_i_b1_002
-
enumerator jus_i_b1_003_mac
-
enumerator jus_i_b1_003_serb
-
enumerator koi7_switched
-
enumerator koi8_r
-
enumerator koi8_u
-
enumerator ks_c_5601_1987
-
enumerator ksc5636
-
enumerator kz_1048
-
enumerator latin_greek
-
enumerator latin_greek_1
-
enumerator latin_lap
-
enumerator macintosh
-
enumerator microsoft_publishing
-
enumerator mnem
-
enumerator mnemonic
-
enumerator msz_7795_3
-
enumerator nats_dano
-
enumerator nats_dano_add
-
enumerator nats_sefi
-
enumerator nats_sefi_add
-
enumerator nc_nc00_10_81
-
enumerator nf_z_62_010
-
enumerator nf_z_62_010_1973
-
enumerator ns_4551_1
-
enumerator ns_4551_2
-
enumerator osd_ebcdic_df03_irv
-
enumerator osd_ebcdic_df04_1
-
enumerator osd_ebcdic_df04_15
-
enumerator pc8_danish_norwegian
-
enumerator pc8_turkish
-
enumerator pt
-
enumerator pt2
-
enumerator ptcp154
-
enumerator scsu
-
enumerator sen_850200_b
-
enumerator sen_850200_c
-
enumerator shift_jis
-
enumerator t_101_g2
-
enumerator t_61_7bit
-
enumerator t_61_8bit
-
enumerator tis_620
-
enumerator tscii
-
enumerator unicode_1_1
-
enumerator unicode_1_1_utf_7
-
enumerator unknown_8bit
-
enumerator us_ascii
-
enumerator us_dk
-
enumerator utf_16
-
enumerator utf_16be
-
enumerator utf_16le
-
enumerator utf_32
-
enumerator utf_32be
-
enumerator utf_32le
-
enumerator utf_7
-
enumerator utf_7_imap
-
enumerator utf_8
-
enumerator ventura_international
-
enumerator ventura_math
-
enumerator ventura_us
-
enumerator videotex_suppl
-
enumerator viqr
-
enumerator viscii
-
enumerator windows_1250
-
enumerator windows_1251
-
enumerator windows_1252
-
enumerator windows_1253
-
enumerator windows_1254
-
enumerator windows_1255
-
enumerator windows_1256
-
enumerator windows_1257
-
enumerator windows_1258
-
enumerator windows_31j
-
enumerator windows_874
-
enumerator unspecified
dump_format_t
format_t
length_unit_t
-
enum class orcus::length_unit_t
Unit of length, as used in length_t.
Values:
-
enumerator unknown
-
enumerator centimeter
-
enumerator millimeter
-
enumerator xlsx_column_digit
Special unit of length used by Excel, defined as the maximum digit width of font used as the “Normal” style font.
Note
Since it’s not possible to determine the actual length using this unit, it is approximated by 1.9 millimeters.
-
enumerator inch
-
enumerator point
-
enumerator twip
One twip is a twentieth of a point equal to 1/1440 of an inch.
-
enumerator pixel
-
enumerator unknown
string_escape_char_t
-
enum class orcus::string_escape_char_t
Type of character immediately following an escape character ‘'.
Values:
-
enumerator invalid
-
enumerator regular_char
Regular character such as ‘”’ and ‘'
-
enumerator control_char
Character such as ‘t’ for tab, ‘n’ for line break etc.
-
enumerator unicode
‘u’ which is followed by 4 hexadecimal digits.
-
enumerator invalid
Type aliases
css_properties_t
-
typedef std::unordered_map<std::string_view, std::vector<css_property_value_t>> orcus::css_properties_t
css_pseudo_element_properties_t
-
typedef std::unordered_map<css::pseudo_element_t, css_properties_t> orcus::css_pseudo_element_properties_t
xml_token_attrs_t
-
using orcus::xml_token_attrs_t = std::vector<xml_token_attr_t>
xml_token_t
-
using orcus::xml_token_t = std::size_t
Integral type that represents a tokenized XML element name.
xmlns_id_t
-
using orcus::xmlns_id_t = const char*
Type that represents a normalized XML namespace identifier. Internally it is a pointer value that points to a static char buffer that stores a namespace name.
Constants
INDEX_NOT_FOUND
-
const std::size_t orcus::INDEX_NOT_FOUND
Generic constant to be used to indicate that a valid index value is expected but not found.
XMLNS_UNKNOWN_ID
-
const xmlns_id_t orcus::XMLNS_UNKNOWN_ID
Value associated with an unknown XML namespace.
XML_UNKNOWN_TOKEN
-
const xml_token_t orcus::XML_UNKNOWN_TOKEN
Value associated with an unknown XML token.
Functions
calc_logical_string_length
-
std::size_t orcus::calc_logical_string_length(std::string_view s)
Calculate the logical length of a UTF-8 encoded string.
- Parameters:
s – string to calculate the logical length of.
- Returns:
logical length of the UTF-8 encoded string.
convert
-
double orcus::convert(double value, length_unit_t unit_from, length_unit_t unit_to)
create_filter
-
std::shared_ptr<iface::import_filter> orcus::create_filter(format_t type, spreadsheet::iface::import_factory *factory)
Create an instance of import_filter for a specified format.
- Parameters:
type – Format type to create an instace of import_filter of.
factory – Pointer to an import factory instance. It must not be null.
- Returns:
Pointer to an instance of import_filter for specified format.
create_parse_error_output
-
std::string orcus::create_parse_error_output(std::string_view strm, std::ptrdiff_t offset)
Generate a sensible error output for parse error including the line where the error occurred and the offset of the error position on that line.
- Parameters:
strm – entire character stream where the error occurred.
offset – offset of the error position within the stream.
- Returns:
string formatted to be usable as an error message for stdout.
decode_from_base64
-
std::vector<uint8_t> orcus::decode_from_base64(std::string_view base64)
Decode a based64-encoded character sequence into a sequence of bytes.
- Parameters:
base64 – encoded character sequence.
- Returns:
decoded byte sequence.
detect
encode_to_base64
-
std::string orcus::encode_to_base64(const std::vector<uint8_t> &input)
Encode a sequence of bytes into base64-encoded characters.
- Parameters:
input – sequence of bytes to encode.
- Returns:
base64-encoded character sequence representing the input bytes.
get_dump_format_entries
-
std::vector<std::pair<std::string_view, dump_format_t>> orcus::get_dump_format_entries()
Get a list of available output format entries. Each entry consists of the name of a format and its enum value equivalent.
- Returns:
list of available output format entries.
get_string_escape_char_type
-
string_escape_char_t orcus::get_string_escape_char_type(char c)
Given a character that occurs immediately after the escape character ‘', return what type this character is.
- Parameters:
c – character that occurs immediately after the escape character ‘'.
- Returns:
enum value representing the type of escape character.
get_version_major
-
int orcus::get_version_major()
get_version_micro
-
int orcus::get_version_micro()
get_version_minor
-
int orcus::get_version_minor()
is_alpha
-
bool orcus::is_alpha(char c)
is_blank
-
bool orcus::is_blank(char c)
is_in
-
bool orcus::is_in(char c, std::string_view allowed)
Check if the characater is one of allowed characters. Note that you can only specify up to 16 allowed characters.
- Parameters:
c – character to check.
allowed – string containing all allowed characters.
- Returns:
true if the character is one of the allowed characters, false otherwise.
is_numeric
-
bool orcus::is_numeric(char c)
locate_first_different_char
-
std::size_t orcus::locate_first_different_char(std::string_view left, std::string_view right)
Given two strings, locate the position of the first character that is different between the two strings. Note that if one of the strings is empty (or both of them are empty), it returns 0.
- Parameters:
left – one of the strings to compare.
right – one of the strings to compare.
- Returns:
position of the first character that is different between the two compared strings.
locate_line_with_offset
-
line_with_offset orcus::locate_line_with_offset(std::string_view strm, std::ptrdiff_t offset)
Given a string consisting of multiple lines i.e. multiple line breaks, find the line that contains the specified offset position.
- Parameters:
strm – string stream containing multiple lines to search.
offset – offset position.
- Throws:
std::invalid_argument – if the offset value equals or exceeds the length of the string stream being searched.
- Returns:
structure containing information about the line containing the offset position.
parse_double_quoted_string
-
parse_quoted_string_state orcus::parse_double_quoted_string(const char *&p, std::size_t max_length, cell_buffer &buffer)
parse_integer
-
const char *orcus::parse_integer(const char *p, const char *p_end, long &value)
Parse a decimal number string into a signed integer value.
Note
Use of this function should be eventually replaced with std::from_chars() once it becomes available.
- Parameters:
p – pointer to the first character to start parsing from.
p_end – pointer to the first character not allowed to parse.
value – output parameter to assign the matched value to.
- Returns:
pointer to the first non-matching character.
parse_numeric
-
const char *orcus::parse_numeric(const char *p, const char *p_end, double &value)
Parse a sequence of characters into a double-precision numeric value.
- Parameters:
p – pointer to the first character to start parsing from.
p_end – pointer to the first character not allowed to parse.
value – output parameter to assign the matched value to.
- Returns:
pointer to the first non-matching character.
parse_single_quoted_string
-
parse_quoted_string_state orcus::parse_single_quoted_string(const char *&p, std::size_t max_length, cell_buffer &buffer)
Two single-quote characters (‘’) represent one single-quote character.
parse_to_closing_double_quote
-
const char *orcus::parse_to_closing_double_quote(const char *p, std::size_t max_length)
Starting from the opening double quote position, parse string all the way to the closing quote. Two single-quote characters (‘’) will be interpreted as encoded one single-quote character.
- Parameters:
p – it should point to the opening single quote character.
max_length – maximum length to parse.
- Returns:
address of the character immediately after the closing quote, or nullptr in case no closing quote is found.
parse_to_closing_single_quote
-
const char *orcus::parse_to_closing_single_quote(const char *p, std::size_t max_length)
Starting from the opening single quote position, parse string all the way to the closing quote. Two single-quote characters (‘’) will be interpreted as encoded one single-quote character.
- Parameters:
p – it should point to the opening single quote character.
max_length – maximum length to parse.
- Returns:
address of the character immediately after the closing quote, or nullptr in case no closing quote is found.
to_bool
-
bool orcus::to_bool(std::string_view s)
to_character_set
-
character_set_t orcus::to_character_set(std::string_view s)
Parse a string that represents a character set and convert it to a corresponding enum value.
- Parameters:
s – string representing a character set.
- Returns:
enum value representing a character set, or character_set_t::unspecified in case it cannot be determined.
to_double
-
double orcus::to_double(std::string_view s, const char **p_parse_ended = nullptr)
to_double_checked
-
std::optional<double> orcus::to_double_checked(std::string_view s)
to_dump_format_enum
-
dump_format_t orcus::to_dump_format_enum(std::string_view s)
Parse a string that represents an output format type and convert it to a corresponding enum value.
- Parameters:
s – string representing an output format type.
- Returns:
enum value representing a character set, or character_set_t::unknown in case it cannot be determined.
to_length
-
length_t orcus::to_length(std::string_view str)
Parse a string value containing a part representing a numerical value optionally followed by a part representing a unit of measurement.
Examples of such string value are: “1.234in”, “0.34cm” and so on.
- Parameters:
str – original string value.
- Returns:
structure containing a numerical value and a unit of measurement that the original string value represents.
to_long
-
long orcus::to_long(std::string_view s, const char **p_parse_ended = nullptr)
to_long_checked
-
std::optional<long> orcus::to_long_checked(std::string_view s)
trim
-
std::string_view orcus::trim(std::string_view str)
Struct
config
-
struct config
Public Types
-
using data_type = std::variant<csv_config>
Public Members
-
bool debug
Enable or disable runtime debug output to stdout or stderr.
-
bool structure_check
Control whether or not to perform strict check of the xml structure of a stream being parsed. When enabled, it throws an xml_structure_error exception when an incorrect xml structure is detected.
-
struct csv_config
configuration settings specific to the CSV format. This struct must be POD.
-
using data_type = std::variant<csv_config>
css_chained_simple_selector_t
-
struct css_chained_simple_selector_t
Public Functions
-
bool operator==(const css_chained_simple_selector_t &r) const
-
css_chained_simple_selector_t()
-
css_chained_simple_selector_t(const css_simple_selector_t &ss)
-
css_chained_simple_selector_t(css::combinator_t op, const css_simple_selector_t &ss)
-
bool operator==(const css_chained_simple_selector_t &r) const
css_property_value_t
-
struct css_property_value_t
Structure representing a single CSS property value.
Public Types
-
using value_type = std::variant<std::string_view, css::rgba_color_t, css::hsla_color_t>
Public Functions
-
css_property_value_t()
-
css_property_value_t(const css_property_value_t &r)
-
css_property_value_t(std::string_view _str)
Constructor that takes a string value.
- Parameters:
_str – string value to store. This value should point to a string buffer that’s already been interned. The caller is responsible for managing the life cycle of the source string buffer.
-
css_property_value_t &operator=(const css_property_value_t &r)
-
void swap(css_property_value_t &r)
-
using value_type = std::variant<std::string_view, css::rgba_color_t, css::hsla_color_t>
css_selector_t
-
struct css_selector_t
Each CSS selector consists of one or more chained simple selectors.
Public Types
-
typedef std::vector<css_chained_simple_selector_t> chained_type
-
typedef std::vector<css_chained_simple_selector_t> chained_type
css_simple_selector_t
-
struct css_simple_selector_t
Public Types
-
typedef std::unordered_set<std::string_view> classes_type
Public Functions
-
css_simple_selector_t()
-
void clear()
-
bool empty() const
-
bool operator==(const css_simple_selector_t &r) const
-
bool operator!=(const css_simple_selector_t &r) const
Public Members
-
std::string_view name
-
std::string_view id
-
classes_type classes
-
css::pseudo_class_t pseudo_classes
-
struct hash
Public Functions
-
size_t operator()(const css_simple_selector_t &ss) const
-
size_t operator()(const css_simple_selector_t &ss) const
-
typedef std::unordered_set<std::string_view> classes_type
date_time_t
-
struct date_time_t
Struct that holds a date or date-time value.
Public Functions
-
date_time_t()
-
date_time_t(int _year, int _month, int _day)
-
date_time_t(int _year, int _month, int _day, int _hour, int _minute, double _second)
-
date_time_t(const date_time_t &other)
-
~date_time_t()
-
date_time_t &operator=(date_time_t other)
-
bool operator==(const date_time_t &other) const
-
bool operator!=(const date_time_t &other) const
-
bool operator<(const date_time_t &other) const
-
std::string to_string() const
Convert the date-time value to an ISO-formatted string representation.
- Returns:
ISO-formatted string representation of the date-time value.
-
void swap(date_time_t &other)
Swap the value with another instance.
- Parameters:
other – another instance to swap values with.
Public Static Functions
-
static date_time_t from_chars(std::string_view str)
Parse an ISO-formatted string representation of a date-time value, and convert it into a date_time_t value. A string representation allows either a date only or a date and time value, but it does not allow a time only value.
Here are some examples of ISO-formatted date and date-time values:
2013-04-09 (date only)
2013-04-09T21:34:09.55 (date and time)
- Parameters:
str – string representation of a date-time value.
- Returns:
converted date-time value consisting of a set of numeric values.
-
date_time_t()
json_config
-
struct json_config
-
Public Members
-
std::string input_path
Path of the JSON file being parsed, in case the JSON string originates from a file. This parameter is required if external JSON files need to be resolved. Otherwise it’s optional.
-
bool preserve_object_order = true
Control whether or not to preserve the order of object’s child name/value pairs. By definition, JSON’s object is an unordered set of name/value pairs, but in some cases preserving the original order may be desirable.
-
bool resolve_references = false
Control whether or not to resolve JSON references to external files.
-
bool persistent_string_values = true
When true, the document tree should allocate memory and hold copies of string values in the tree. When false, no extra memory is allocated for string values in the tree and the string values simply point to the original json string stream.
In other words, when this option is set to false, the caller must ensure that the json string stream instance stays alive for the entire life cycle of the document tree.
-
std::string input_path
length_t
-
struct length_t
Holds a length value with unit of measurement.
Public Functions
-
length_t()
-
length_t(length_unit_t _unit, double _value)
-
std::string to_string() const
-
length_t()
line_with_offset
-
struct line_with_offset
Public Functions
-
line_with_offset(std::string _line, std::size_t _line_number, std::size_t _offset_on_line)
-
line_with_offset(const line_with_offset &other)
-
line_with_offset(line_with_offset &&other)
-
~line_with_offset()
-
bool operator==(const line_with_offset &other) const
-
bool operator!=(const line_with_offset &other) const
-
line_with_offset(std::string _line, std::size_t _line_number, std::size_t _offset_on_line)
parse_error_value_t
-
struct parse_error_value_t
Parser token that represents the state of a parse error, used by threaded_json_parser and threaded_sax_token_parser when transferring parse status between threads.
Public Functions
-
parse_error_value_t()
-
parse_error_value_t(const parse_error_value_t &other)
-
parse_error_value_t(std::string_view _str, std::ptrdiff_t _offset)
-
parse_error_value_t &operator=(const parse_error_value_t &other)
-
bool operator==(const parse_error_value_t &other) const
-
bool operator!=(const parse_error_value_t &other) const
-
parse_error_value_t()
parse_quoted_string_state
-
struct parse_quoted_string_state
Stores state of string parsing. Upon successful parsing the str points to the first character of the string and the length stores the size of the string. When the parsing fails, the str value becomes nullptr and the length stores the error code.
Public Members
-
const char *str
-
std::size_t length
-
bool transient
When true, the str pointer points to the temporary buffer storage provided by the caller instead of the original character stream. The caller must allocate memory and copy the value to it before the buffer content changes if the parsed string value needs to be stored.
When false, str points to a position in the original stream, and the caller doens’t need to allocate memory to store the string value as long as the original character stream is alive.
-
bool has_control_character
When true, the string contains at least one control character - a character whose value ranges between 0x00 and 0x1F.
-
const char *str
sax_ns_parser_attribute
-
struct sax_ns_parser_attribute
sax_ns_parser_element
-
struct sax_ns_parser_element
sax_parser_default_config
xml_declaration_t
-
struct xml_declaration_t
Struct holding XML declaration properties.
Public Functions
-
xml_declaration_t()
-
xml_declaration_t(uint8_t _version_major, uint8_t _version_minor, character_set_t _encoding, bool _standalone)
-
xml_declaration_t(const xml_declaration_t &other)
-
~xml_declaration_t()
-
xml_declaration_t &operator=(const xml_declaration_t &other)
-
bool operator==(const xml_declaration_t &other) const
-
bool operator!=(const xml_declaration_t &other) const
Public Members
-
uint8_t version_major
-
uint8_t version_minor
-
character_set_t encoding
-
bool standalone
-
xml_declaration_t()
xml_name_t
-
struct xml_name_t
Represents a name with a normalized namespace in XML documents. This can be used either as an element name or as an attribute name.
Public Functions
-
xml_name_t() noexcept
-
xml_name_t(xmlns_id_t _ns, std::string_view _name)
-
xml_name_t(const xml_name_t &other)
-
xml_name_t &operator=(const xml_name_t &other)
-
bool operator==(const xml_name_t &other) const noexcept
-
bool operator!=(const xml_name_t &other) const noexcept
-
std::string to_string(const xmlns_context &cxt, to_string_type type) const
Convert a namespace-name value pair to a string representation with the namespace value converted to either an alias or a unique “short name”. Refer to get_alias() and get_short_name() for the explanations of an alias and short name.
- Parameters:
cxt – namespace context object associated with the XML stream currently being parsed.
type – policy on how to convert a namespace identifier to a string representation.
- Returns:
string representation of a namespace-name value pair.
-
std::string to_string(const xmlns_repository &repo) const
Convert a namespace-name value pair to a string representation with the namespace value converted to a unique “short name”. Refer to get_short_name() for the explanations of a short name.
- Parameters:
repo – namespace repository.
- Returns:
string representation of a namespace-name value pair.
-
xml_name_t() noexcept
xml_table_range_t
-
struct xml_table_range_t
xml_token_attr_t
-
struct xml_token_attr_t
Struct containing properties of a tokenized XML attribute.
Public Functions
-
xml_token_attr_t()
-
xml_token_attr_t(const xml_token_attr_t &other)
-
xml_token_attr_t(xmlns_id_t _ns, xml_token_t _name, std::string_view _value, bool _transient)
-
xml_token_attr_t(xmlns_id_t _ns, xml_token_t _name, std::string_view _raw_name, std::string_view _value, bool _transient)
-
xml_token_attr_t &operator=(const xml_token_attr_t &other)
Public Members
-
xmlns_id_t ns
-
xml_token_t name
-
std::string_view raw_name
-
std::string_view value
-
bool transient
Whether or not the attribute value is transient. A transient value is only guaranteed to be valid until the end of the start_element call, after which its validity is not guaranteed. A non-transient value is guaranteed to be valid during the life cycle of the xml stream it belongs to.
-
xml_token_attr_t()
xml_token_element_t
-
struct xml_token_element_t
Struct containing XML element properties passed to the handler of sax_token_parser via its
start_element()
andend_element()
calls.Public Functions
-
xml_token_element_t &operator=(xml_token_element_t) = delete
-
xml_token_element_t()
-
xml_token_element_t(xmlns_id_t _ns, xml_token_t _name, std::string_view _raw_name, std::vector<xml_token_attr_t> &&_attrs)
-
xml_token_element_t(const xml_token_element_t &other)
-
xml_token_element_t(xml_token_element_t &&other)
-
xml_token_element_t &operator=(xml_token_element_t) = delete
yaml_config
zip_file_entry_header
-
struct zip_file_entry_header
Structure containing file entry header attributes.
Public Functions
-
zip_file_entry_header()
-
zip_file_entry_header(const zip_file_entry_header &other)
-
zip_file_entry_header(zip_file_entry_header &&other)
-
~zip_file_entry_header()
-
zip_file_entry_header &operator=(const zip_file_entry_header &other)
-
zip_file_entry_header &operator=(zip_file_entry_header &&other)
Public Members
-
uint32_t header_signature = 0
-
uint16_t required_version = 0
-
uint16_t flag = 0
-
uint16_t compression_method = 0
-
uint16_t last_modified_time = 0
-
uint16_t last_modified_date = 0
-
uint32_t crc32 = 0
-
uint32_t compressed_size = 0
-
uint32_t uncompressed_size = 0
-
std::string filename
-
std::vector<uint8_t> extra_field
-
zip_file_entry_header()
Classes
cell_buffer
-
class cell_buffer
Temporary cell buffer used to decode encoded cell values. This is used in the sax, json and csv parsers.
css_document_tree
-
class css_document_tree
Class representing CSS rules.
Public Functions
-
css_document_tree(const css_document_tree&) = delete
-
css_document_tree()
-
css_document_tree(css_document_tree &&other)
-
~css_document_tree()
-
css_document_tree &operator=(css_document_tree &&other)
-
void load(std::string_view stream)
Load raw string stream containing CSS rules to populate the document tree.
- Parameters:
stream – raw CSS rules.
-
void insert_properties(const css_selector_t &selector, css::pseudo_element_t pseudo_elem, const css_properties_t &props)
Insert or replace properties for given selector and pseudo element flags.
- Parameters:
selector – selector to store properties for.
pseudo_elem – pseudo element flags for the last simple selector.
props – new properties to insert.
-
const css_properties_t *get_properties(const css_selector_t &selector, css::pseudo_element_t pseudo_elem) const
Get properties associated with given selector and one or more pseudo elements.
- Parameters:
selector – selector to get properties for.
pseudo_elem – pseudo element flags for the last simple selector. This value is a bitfield.
- Returns:
const pointer to the property set instance, or NULL in case there is no properties for the given selector.
-
const css_pseudo_element_properties_t *get_all_properties(const css_selector_t &selector) const
Get all sets of properties associated with given selector, for all pseudo element values.
- Parameters:
selector – selector to get properties for.
- Returns:
const pointer to the map of property sets with pseudo element values as the keys, or NULL in case there is no properties for the given selector.
-
void dump() const
-
void swap(css_document_tree &other) noexcept
-
class insertion_error : public orcus::general_error
Public Functions
-
insertion_error(const std::string &msg)
-
insertion_error(const std::string &msg)
-
css_document_tree(const css_document_tree&) = delete
css_handler
-
class css_handler
Empty handler for CSS parser. Sub-class from it and implement necessary methods.
Public Functions
-
inline void at_rule_name(std::string_view name)
Called upon encountering an at-rule.
- Parameters:
name – name of the at-rule.
-
inline void simple_selector_type(std::string_view type)
Called upon encountering a simple selector type. A simple selector may consist of
<type>.<class>#<id>
and this function only passes the type part of the simple selector expression.
- Parameters:
type – simple selector type.
-
inline void simple_selector_class(std::string_view cls)
Called upon encountering a simple selector class. A simple selector may consist of
<type>.<class>#<id>
and this function only passes the class part of the simple selector expression.
- Parameters:
cls – simple selector class.
-
inline void simple_selector_pseudo_element(orcus::css::pseudo_element_t pe)
Called upon encountering a pseudo element of a simple selector. For instance, given the following CSS block:
p::first-line { color: blue; text-transform: uppercase; }
the
first-line
part is the pseudo element of the selector namedp
.- Parameters:
pe – pseudo element of a simple selector.
-
inline void simple_selector_pseudo_class(orcus::css::pseudo_class_t pc)
Called upon encountering a pseudo class of a simple selector. For instance, given the following CSS block:
button:hover { color: blue; }
the
hover
part is the pseudo class of the selector namedbutton
.- Parameters:
pc – pseudo class of a simple selector.
-
inline void simple_selector_id(std::string_view id)
Called upon encountering a simple selector id. A simple selector may consist of
<type>.<class>#<id>
and this function only passes the id part of the simle selector expression.
- Parameters:
id – simple selector id.
-
inline void end_simple_selector()
Called at the end of a simple selector expression.
- Todo:
find out the difference between a simple selector and a selector, and document it.
-
inline void end_selector()
Called at the end of a selector expression.
- Todo:
find out the difference between a simple selector and a selector, and document it.
-
inline void combinator(orcus::css::combinator_t combinator)
Calling upon encountering a combinator. A combinator is an operator that combines other selectors. Given the following CSS block:
div > p { background-color: yellow; }
the
>
is the combinator that combines thediv
andp
selectors.- Parameters:
combinator – type of combinator encountered.
-
inline void property_name(std::string_view name)
Called at each property name.
- Parameters:
name – property name string.
-
inline void value(std::string_view value)
Called at each ordinary property value string.
- Parameters:
value – value string.
-
inline void rgb(uint8_t red, uint8_t green, uint8_t blue)
Called at each RGB color value of a property.
- Parameters:
red – value of red (0-255)
green – value of green (0-255)
blue – value of blue (0-255)
-
inline void rgba(uint8_t red, uint8_t green, uint8_t blue, double alpha)
Called at each RGB color value of a property with alpha transparency value.
- Parameters:
red – value of red (0-255)
green – value of green (0-255)
blue – value of blue (0-255)
alpha – alpha transparency value
-
inline void hsl(uint8_t hue, uint8_t sat, uint8_t light)
Called at each HSL color value of a property.
- Parameters:
hue – hue
sat – saturation
light – lightness
-
inline void hsla(uint8_t hue, uint8_t sat, uint8_t light, double alpha)
Called at each HSL color value of a property with alpha transparency value.
- Parameters:
hue – hue
sat – saturation
light – lightness
alpha – alpha value
-
inline void url(std::string_view url)
Called at each URL value of a property.
- Parameters:
url – URL value string.
-
inline void begin_parse()
Called when the parsing begins.
-
inline void end_parse()
Called when the parsing ends.
-
inline void begin_block()
Called at the beginning of each block. An opening brace ‘{’ marks the beginning of a block.
-
inline void end_block()
Called at the end of each block. A closing brace ‘}’ marks the end of a block.
-
inline void begin_property()
Called at the beginning of a single property expression. Each property expression may consist of
<name> : <value>, ..., <value>
terminated by either a
;
or}
.
-
inline void end_property()
Called at the end of a single property expression.
-
inline void at_rule_name(std::string_view name)
css_parser
-
template<typename HandlerT>
class css_parser : public orcus::css::parser_base Parser for CSS documents.
- Template Parameters:
HandlerT – Hanlder type with member functions for event callbacks. Refer to css_handler.
csv_handler
-
class csv_handler
Public Functions
-
inline void begin_parse()
Called when the parser starts parsing a stream.
-
inline void end_parse()
Called when the parser finishes parsing a stream.
-
inline void begin_row()
Called at the beginning of every row.
-
inline void end_row()
Called at the end of every row.
-
inline void cell(std::string_view value, bool transient)
Called after every cell is parsed.
- Parameters:
value – cell content.
transient – when true, the text content has been converted and is stored in a temporary buffer. In such case, there is no guarantee that the text content remain available after the end of the call. When this value is false, the text content is guaranteed to be valid so long as the original CSV stream content is valid.
-
inline void begin_parse()
csv_parser
-
template<typename HandlerT>
class csv_parser : public orcus::csv::parser_base Parser for CSV documents.
- Template Parameters:
HandlerT – Hanlder type with member functions for event callbacks. Refer to csv_handler.
Public Functions
-
csv_parser(std::string_view content, handler_type &hdl, const csv::parser_config &config)
-
void parse()
file_content
-
class file_content
Represents the content of a file.
The file content is memory-mapped initially, but may later become in-memory if the non-utf-8 content gets converted to utf-8.
Public Functions
-
file_content(const file_content&) = delete
-
file_content &operator=(const file_content&) = delete
-
file_content()
-
file_content(file_content &&other)
-
file_content(std::string_view filepath)
-
~file_content()
-
const char *data() const
Obtain the memory address to the first character in the content buffer.
- Returns:
pointer to the first character in the buffer.
-
size_t size() const
Return the size of the content i.e. the number of characters in the content buffer.
- Returns:
size of the content.
-
bool empty() const
Query whether or not the content is empty.
- Returns:
true if the content is empty, otherwise false.
-
void swap(file_content &other)
Swap content with another instance.
- Parameters:
other – another instance to swap content with.
-
void load(std::string_view filepath)
Load from a new file. This will invalidate the pointer returned from the data() method prior to the call.
- Parameters:
filepath – path of the file to load from.
-
void convert_to_utf8()
Convert a non-utf-8 stream to a utf-8 one if the source stream contains a byte order mark. If not, it does nothing. When the conversion happens, the converted content will be stored in-memory.
-
std::string_view str() const
-
file_content(const file_content&) = delete
general_error
-
class general_error : public std::exception
Subclassed by orcus::css_document_tree::insertion_error, orcus::interface_error, orcus::invalid_map_error, orcus::json::document_error, orcus::json_structure_error, orcus::parse_error, orcus::value_error, orcus::xml_structure_error, orcus::xpath_error, orcus::yaml::document_error, orcus::zip_error
import_ods
-
class import_ods
Public Functions
-
import_ods() = delete
-
import_ods(const import_ods&) = delete
-
import_ods &operator=(const import_ods&) = delete
Public Static Functions
-
static void read_styles(std::string_view s, spreadsheet::iface::import_styles *data)
-
import_ods() = delete
import_xlsx
-
class import_xlsx
Public Functions
-
import_xlsx() = delete
-
import_xlsx(const import_xlsx&) = delete
-
import_xlsx &operator=(const import_xlsx&) = delete
Public Static Functions
-
static void read_table(std::string_view s, spreadsheet::iface::import_table &table, spreadsheet::iface::import_reference_resolver &resolver)
-
import_xlsx() = delete
interface_error
-
class interface_error : public orcus::general_error
This gets thrown when a public interface method is expected to return a non-null pointer to another interface but actually returns a null pointer.
invalid_arg_error
-
class invalid_arg_error : public std::invalid_argument
invalid_map_error
-
class invalid_map_error : public orcus::general_error
json_handler
-
class json_handler
Public Functions
-
inline void begin_parse()
Called when the parsing begins.
-
inline void end_parse()
Called when the parsing ends.
-
inline void begin_array()
Called when the opening brace of an array is encountered.
-
inline void end_array()
Called when the closing brace of an array is encountered.
-
inline void begin_object()
Called when the opening curly brace of an object is encountered.
-
inline void object_key(std::string_view key, bool transient)
Called when a key value string of an object is encountered.
- Parameters:
key – key value string.
transient – true if the string value is stored in a temporary buffer which is not guaranteed to hold the string value after the end of this callback. When false, the pointer points to somewhere in the JSON stream being parsed.
-
inline void end_object()
Called when the closing curly brace of an object is encountered.
-
inline void boolean_true()
Called when a boolean ‘true’ keyword is encountered.
-
inline void boolean_false()
Called when a boolean ‘false’ keyword is encountered.
-
inline void null()
Called when a ‘null’ keyword is encountered.
-
inline void string(std::string_view val, bool transient)
Called when a string value is encountered.
- Parameters:
val – string value.
transient – true if the string value is stored in a temporary buffer which is not guaranteed to hold the string value after the end of this callback. When false, the pointer points to somewhere in the JSON stream being parsed.
-
inline void number(double val)
Called when a numeric value is encountered.
- Parameters:
val – numeric value.
-
inline void begin_parse()
json_parser
-
template<typename HandlerT>
class json_parser : public orcus::json::parser_base Parser for JSON documents.
- Template Parameters:
HandlerT – Hanlder type with member functions for event callbacks. Refer to json_handler.
Public Functions
-
json_parser(std::string_view content, handler_type &hdl)
Constructor.
- Parameters:
content – string stream containing JSON string.
hdl – handler class instance.
-
void parse()
Call this method to start parsing.
json_structure_error
-
class json_structure_error : public orcus::general_error
malformed_xml_error
-
class malformed_xml_error : public orcus::parse_error
This exception is thrown when SAX parser detects a malformed XML document.
memory_content
-
class memory_content
Represents the content of an in-memory buffer. Note that this class will NOT own the content of the source buffer but simply will reference it, except when the original buffer is a non-utf-8 stream and the caller chooses to convert it to utf-8 by calling its convert_to_utf8() method.
Public Functions
-
memory_content(const file_content&) = delete
-
memory_content &operator=(const file_content&) = delete
-
memory_content()
-
memory_content(std::string_view s)
-
memory_content(memory_content &&other)
-
~memory_content()
-
const char *data() const
-
size_t size() const
-
bool empty() const
-
void swap(memory_content &other)
-
void convert_to_utf8()
Convert a non-utf-8 stream to a utf-8 one if the source stream contains a byte order mark. If not, it does nothing. When the conversion happens, the converted content will be owned by the object.
-
std::string_view str() const
-
memory_content(const file_content&) = delete
orcus_csv
-
class orcus_csv : public orcus::iface::import_filter
Public Functions
-
orcus_csv() = delete
-
orcus_csv(spreadsheet::iface::import_factory *factory)
-
~orcus_csv()
-
virtual void read_file(std::string_view filepath) override
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) override
Read the content of an in-memory stream.
- Parameters:
stream – in-memory stream to read from.
-
virtual std::string_view get_name() const override
Get the name of a filter.
- Returns:
name of a filter.
-
orcus_csv() = delete
orcus_gnumeric
-
class orcus_gnumeric : public orcus::iface::import_filter
Public Functions
-
orcus_gnumeric() = delete
-
orcus_gnumeric(const orcus_gnumeric&) = delete
-
orcus_gnumeric &operator=(const orcus_gnumeric&) = delete
-
orcus_gnumeric(spreadsheet::iface::import_factory *factory)
-
~orcus_gnumeric()
-
virtual void read_file(std::string_view filepath) override
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) override
Read the content of an in-memory stream.
- Parameters:
stream – in-memory stream to read from.
-
virtual std::string_view get_name() const override
Get the name of a filter.
- Returns:
name of a filter.
Public Static Functions
-
static bool detect(const unsigned char *blob, size_t size)
-
orcus_gnumeric() = delete
orcus_json
-
class orcus_json
Public Functions
-
orcus_json(const orcus_json&) = delete
-
orcus_json &operator=(const orcus_json&) = delete
-
orcus_json(spreadsheet::iface::import_factory *im_fact)
-
~orcus_json()
-
void set_cell_link(std::string_view path, std::string_view sheet, spreadsheet::row_t row, spreadsheet::col_t col)
-
void start_range(std::string_view sheet, spreadsheet::row_t row, spreadsheet::col_t col, bool row_header)
-
void append_field_link(std::string_view path, std::string_view label)
-
void set_range_row_group(std::string_view path)
-
void commit_range()
-
void append_sheet(std::string_view name)
-
void read_stream(std::string_view stream)
-
void read_map_definition(std::string_view stream)
Read a JSON string that contains an entire set of mapping rules.
This method also inserts all necessary sheets into the document model.
- Parameters:
stream – JSON string.
-
void detect_map_definition(std::string_view stream)
Read a JSON string, and detect and define mapping rules for one or more ranges.
- Parameters:
stream – JSON string.
-
orcus_json(const orcus_json&) = delete
orcus_ods
-
class orcus_ods : public orcus::iface::import_filter
Public Functions
-
orcus_ods(spreadsheet::iface::import_factory *factory)
-
~orcus_ods()
-
virtual void read_file(std::string_view filepath) override
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) override
Read the content of an in-memory stream.
- Parameters:
stream – in-memory stream to read from.
-
virtual std::string_view get_name() const override
Get the name of a filter.
- Returns:
name of a filter.
Public Static Functions
-
static bool detect(const unsigned char *blob, size_t size)
-
orcus_ods(spreadsheet::iface::import_factory *factory)
orcus_parquet
-
class orcus_parquet : public orcus::iface::import_filter
Public Functions
-
orcus_parquet(const orcus_parquet&) = delete
-
orcus_parquet &operator=(const orcus_parquet&) = delete
-
orcus_parquet(spreadsheet::iface::import_factory *factory)
-
~orcus_parquet()
-
virtual void read_file(std::string_view filepath) override
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) override
Read the content of an in-memory stream.
- Parameters:
stream – in-memory stream to read from.
-
virtual std::string_view get_name() const override
Get the name of a filter.
- Returns:
name of a filter.
Public Static Functions
-
static bool detect(const unsigned char *blob, std::size_t size)
-
orcus_parquet(const orcus_parquet&) = delete
orcus_xls_xml
-
class orcus_xls_xml : public orcus::iface::import_filter
Public Functions
-
orcus_xls_xml(spreadsheet::iface::import_factory *factory)
-
~orcus_xls_xml()
-
orcus_xls_xml(const orcus_xls_xml&) = delete
-
orcus_xls_xml &operator=(const orcus_xls_xml&) = delete
-
virtual void read_file(std::string_view filepath) override
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) override
Read the content of an in-memory stream.
- Parameters:
stream – in-memory stream to read from.
-
virtual std::string_view get_name() const override
Get the name of a filter.
- Returns:
name of a filter.
Public Static Functions
-
static bool detect(const unsigned char *blob, size_t size)
-
orcus_xls_xml(spreadsheet::iface::import_factory *factory)
orcus_xlsx
-
class orcus_xlsx : public orcus::iface::import_filter
Public Functions
-
orcus_xlsx(spreadsheet::iface::import_factory *factory)
-
~orcus_xlsx()
-
orcus_xlsx(const orcus_xlsx&) = delete
-
orcus_xlsx &operator=(const orcus_xlsx&) = delete
-
virtual void read_file(std::string_view filepath) override
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) override
Read the content of an in-memory stream.
- Parameters:
stream – in-memory stream to read from.
-
virtual std::string_view get_name() const override
Get the name of a filter.
- Returns:
name of a filter.
Public Static Functions
-
static bool detect(const unsigned char *blob, size_t size)
-
orcus_xlsx(spreadsheet::iface::import_factory *factory)
orcus_xml
-
class orcus_xml
Public Functions
-
orcus_xml(xmlns_repository &ns_repo, spreadsheet::iface::import_factory *im_fact, spreadsheet::iface::export_factory *ex_fact)
-
~orcus_xml()
-
void set_namespace_alias(std::string_view alias, std::string_view uri, bool default_ns = false)
Define a namespace and its alias used in a map file.
- Parameters:
alias – alias for the namespace.
uri – namespace value.
default_ns – whether or not to use this namespace as the default namespace. When this value is set to true, the namespace being set will be applied for all elements and attributes used in the paths without explicit namespace values.
-
void set_cell_link(std::string_view xpath, std::string_view sheet, spreadsheet::row_t row, spreadsheet::col_t col)
Define a mapping of a single element or attribute to a single cell location.
- Parameters:
xpath – path to the element or attribute to link.
sheet – sheet index (0-based) of the linked cell location.
row – row index (0-based) of the linked cell location.
col – column index (0-based) of the linked cell location.
-
void start_range(std::string_view sheet, spreadsheet::row_t row, spreadsheet::col_t col)
Initiate the mapping definition of a linked range. The definition will get committed when the
commit_range
method is called.- Parameters:
sheet – sheet index (0-based) of the linked cell location.
row – row index (0-based) of the linked cell location.
col – column index (0-based) of the linked cell location.
-
void append_field_link(std::string_view xpath, std::string_view label)
Append a field that is mapped to a specified path in the XML document to the current linked range.
- Parameters:
xpath – path to the element or attribute to link as a field.
label – custom header label to use in lieu of the name of the linked entity.
-
void set_range_row_group(std::string_view xpath)
Set the element located in the specified path as a row group in the current linked range.
If the element is defined as a row-group element, the row index will increment whenever that element closes.
- Parameters:
xpath – path to the element to use as a row group element.
-
void commit_range()
Commit the mapping definition of the current range.
-
void append_sheet(std::string_view name)
Append a new sheet to the spreadsheet document.
- Parameters:
name – name of the sheet.
-
void read_stream(std::string_view stream)
Read the stream containing the source XML document.
- Parameters:
stream – stream containing the content of the source XML document.
-
void read_map_definition(std::string_view stream)
Read an XML stream that contains an entire set of mapping rules.
This method also inserts all necessary sheets into the document model.
- Parameters:
stream – stream containing the XML string.
-
void detect_map_definition(std::string_view stream)
Read a stream containing the source XML document, automatically detect all linkable ranges and import them one range per sheet.
- Parameters:
stream – stream containing the source XML document.
-
void write_map_definition(std::string_view stream, std::ostream &out) const
Read a stream containing the source XML document, automatically detect all linkable ranges, and write a map definition file depicting the detected ranges.
- Parameters:
stream – stream containing the source XML document.
out – output stream to write the map definition file to.
-
void write(std::string_view stream, std::ostream &out) const
Write the linked cells and ranges in the spreadsheet document as an XML document using the same map definition rules used to load the content.
Note that this requires the source XML document stream, as it re-uses parts of the source stream.
- Parameters:
stream – stream containing the source XML document.
out – output stream to write the XML document to.
-
orcus_xml(xmlns_repository &ns_repo, spreadsheet::iface::import_factory *im_fact, spreadsheet::iface::export_factory *ex_fact)
parse_error
-
class parse_error : public orcus::general_error
Exception related to a parsing error that includes an offset in the stream where the error occurred.
Subclassed by orcus::malformed_xml_error
parser_base
-
class parser_base
Subclassed by orcus::css::parser_base, orcus::csv::parser_base, orcus::json::parser_base, orcus::sax::parser_base, orcus::yaml::parser_base
sax_handler
-
class sax_handler
Public Functions
-
inline void doctype(const orcus::sax::doctype_declaration &dtd)
Called when a doctype declaration <!DOCTYPE … > is encountered.
- Parameters:
dtd – struct containing doctype declaration data.
-
inline void start_declaration(std::string_view decl)
Called when <?… is encountered, where the ‘…’ may be an arbitraray dentifier. One common declaration is <?xml which is typically given at the start of an XML stream.
- Parameters:
decl – name of the identifier.
-
inline void end_declaration(std::string_view decl)
Called when the closing tag (>) of a <?… ?> is encountered.
- Parameters:
decl – name of the identifier.
-
inline void start_element(const orcus::sax::parser_element &elem)
Called at the start of each element.
- Parameters:
elem – information of the element being parsed.
-
inline void end_element(const orcus::sax::parser_element &elem)
Called at the end of each element.
- Parameters:
elem – information of the element being parsed.
-
inline void characters(std::string_view val, bool transient)
Called when a segment of a text content is parsed. Each text content is a direct child of an element, which may have multiple child contents when the element also has a child element that are direct sibling to the text contents or the text contents are splitted by a comment.
- Parameters:
val – value of the text content.
transient – when true, the text content has been converted and is stored in a temporary buffer due to presence of one or more encoded characters, in which case the passed text value needs to be either immediately converted to a non-text value or be interned within the scope of the callback.
-
inline void attribute(const orcus::sax::parser_attribute &attr)
Called upon parsing of an attribute of an element. Note that when the attribute’s transient flag is set, the attribute value is stored in a temporary buffer due to presence of one or more encoded characters, and must be processed within the scope of the callback.
- Parameters:
attr – struct containing attribute information.
-
inline void doctype(const orcus::sax::doctype_declaration &dtd)
sax_ns_handler
-
class sax_ns_handler
Public Functions
-
inline void doctype(const orcus::sax::doctype_declaration &dtd)
Called when a doctype declaration <!DOCTYPE … > is encountered.
- Parameters:
dtd – struct containing doctype declaration data.
-
inline void start_declaration(std::string_view decl)
Called when <?… is encountered, where the ‘…’ may be an arbitraray dentifier. One common declaration is <?xml which is typically given at the start of an XML stream.
- Parameters:
decl – name of the identifier.
-
inline void end_declaration(std::string_view decl)
Called when the closing tag (>) of a <?… ?> is encountered.
- Parameters:
decl – name of the identifier.
-
inline void start_element(const orcus::sax_ns_parser_element &elem)
Called at the start of each element.
- Parameters:
elem – information of the element being parsed.
-
inline void end_element(const orcus::sax_ns_parser_element &elem)
Called at the end of each element.
- Parameters:
elem – information of the element being parsed.
-
inline void characters(std::string_view val, bool transient)
Called when a segment of a text content is parsed. Each text content is a direct child of an element, which may have multiple child contents when the element also has a child element that are direct sibling to the text contents or the text contents are splitted by a comment.
- Parameters:
val – value of the text content.
transient – when true, the text content has been converted and is stored in a temporary buffer due to presence of one or more encoded characters, in which case the passed text value needs to be either immediately converted to a non-text value or be interned within the scope of the callback.
-
inline void attribute(std::string_view name, std::string_view val)
Called upon parsing of an attribute of a declaration. The value of an attribute is assumed to be transient thus should be consumed within the scope of this callback.
- Todo:
Perhaps we should pass the transient flag here as well like all the other places.
- Parameters:
name – name of an attribute.
val – value of an attribute.
-
inline void attribute(const orcus::sax_ns_parser_attribute &attr)
Called upon parsing of an attribute of an element. Note that when the attribute’s transient flag is set, the attribute value is stored in a temporary buffer due to a presence of encoded characters, and must be processed within the scope of the callback.
- Parameters:
attr – struct containing attribute information.
-
inline void doctype(const orcus::sax::doctype_declaration &dtd)
sax_ns_parser
-
template<typename HandlerT>
class sax_ns_parser SAX based XML parser with extra namespace handling.
It uses an instance of xmlns_context passed by the caller to validate and convert namespace values into identifiers. The namespace identifier of each encountered element is always given even if one is not explicitly given.
This parser keeps track of element scopes and detects non-matching element pairs.
- Template Parameters:
HandlerT – Handler type with member functions for event callbacks. Refer to sax_ns_handler.
Public Functions
-
sax_ns_parser(std::string_view content, xmlns_context &ns_cxt, handler_type &handler)
-
~sax_ns_parser() = default
-
void parse()
Start parsing the document.
- Throws:
orcus::malformed_xml_error – when it encounters a non-matching closing element.
sax_parser
-
template<typename HandlerT, typename ConfigT = sax_parser_default_config>
class sax_parser : public orcus::sax::parser_base SAX parser for XML documents.
This parser is barebone in that it only parses the document and picks up all encountered elements and attributes without checking proper element pairs. The user is responsible for checking whether or not the document is well-formed in terms of element scopes.
This parser additionally records the begin and end offset positions of each element.
- Template Parameters:
HandlerT – Handler type with member functions for event callbacks. Refer to sax_handler.
ConfigT – Parser configuration.
Public Functions
-
sax_parser(std::string_view content, handler_type &handler)
-
~sax_parser() = default
-
void parse()
sax_token_handler
-
class sax_token_handler
Public Functions
-
inline void declaration(const orcus::xml_declaration_t &decl)
Called immediately after the entire XML declaration has been parsed.
- Parameters:
decl – struct containing the attributes of the XML declaration.
-
inline void start_element(const orcus::xml_token_element_t &elem)
Called at the start of each element.
- Parameters:
elem – struct containing the element’s information as well as all the attributes that belong to the element.
-
inline void end_element(const orcus::xml_token_element_t &elem)
Called at the end of each element.
- Parameters:
elem – struct containing the element’s information as well as all the attributes that belong to the element.
-
inline void characters(std::string_view val, bool transient)
Called when a segment of a text content is parsed. Each text content is a direct child of an element, which may have multiple child contents when the element also has a child element that are direct sibling to the text contents or the text contents are splitted by a comment.
- Parameters:
val – value of the text content.
transient – when true, the text content has been converted and is stored in a temporary buffer due to presence of one or more encoded characters, in which case the passed text value needs to be either immediately converted to a non-text value or be interned within the scope of the callback.
-
inline void declaration(const orcus::xml_declaration_t &decl)
sax_token_handler_wrapper_base
sax_token_parser
-
template<typename HandlerT>
class sax_token_parser SAX parser that tokenizes element and attribute names while parsing. All pre-defined elements and attribute names are translated into integral identifiers via use of tokens. The user of this class needs to provide a pre-defined set of element and attribute names at construction time.
This parser internally uses sax_ns_parser.
- Template Parameters:
HandlerT – Handler type with member functions for event callbacks. Refer to sax_token_handler.
Public Functions
-
sax_token_parser(std::string_view content, const tokens &_tokens, xmlns_context &ns_cxt, handler_type &handler)
-
~sax_token_parser() = default
-
void parse()
string_pool
-
class string_pool
This class implements a shared string pool with the ability to merge with other pools.
Note
This class is not copy-constructible, but is move-constructible.
Public Functions
-
string_pool(const string_pool&) = delete
-
string_pool &operator=(const string_pool&) = delete
-
string_pool()
-
string_pool(string_pool &&other)
-
~string_pool()
-
std::pair<std::string_view, bool> intern(std::string_view str)
Intern a string.
- Parameters:
str – string to intern.
- Returns:
pair whose first value is the interned string, and the second value specifies whether it is a newly created instance (true) or a reuse of an existing instance (false).
-
std::vector<std::string_view> get_interned_strings() const
Return all interned strings.
- Returns:
sequence of all interned strings. The sequence will be sorted.
-
void dump() const
Dump pool’s content to stdout.
- Todo:
This needs to be reworked to make it more generally usable.
-
void clear()
Clear pool’s content.
-
size_t size() const
Query the total number of strings stored in the pool.
- Returns:
size_t total number of strings in the pool.
-
void swap(string_pool &other)
Swap the content with another string-pool instance.
- Parameters:
other – string-pool instance to swap contents with.
-
void merge(string_pool &other)
Merge another string pool instance in. This will not invalidate any string references to the other pool.
The other string pool instance will become empty when this call returns.
- Parameters:
other – string pool instance to merge in.
-
string_pool(const string_pool&) = delete
threaded_json_parser
-
template<typename _Handler>
class threaded_json_parser -
Public Functions
-
threaded_json_parser(const char *p, size_t n, handler_type &hdl, size_t min_token_size)
Constructor.
- Parameters:
p – pointer to a string stream containing JSON string.
n – size of the stream.
hdl – handler class instance.
min_token_size – minimum size of the internal token buffer.
-
threaded_json_parser(const char *p, size_t n, handler_type &hdl, size_t min_token_size, size_t max_token_size)
Constructor.
- Parameters:
p – pointer to a string stream containing JSON string.
n – size of the stream.
hdl – handler class instance.
min_token_size – minimum size of the internal token buffer.
max_token_size – maximum size of the internal token buffer.
-
void parse()
Call this method to start parsing.
-
json::parser_stats get_stats() const
Get statistics on the parsing session. Call this only after the parsing has finished.
- Returns:
structure containing statistics of the parsing session.
-
void swap_string_pool(string_pool &pool)
-
threaded_json_parser(const char *p, size_t n, handler_type &hdl, size_t min_token_size)
threaded_sax_token_parser
-
template<typename _Handler>
class threaded_sax_token_parser -
Public Functions
-
threaded_sax_token_parser(const char *p, size_t n, const tokens &tks, xmlns_context &ns_cxt, handler_type &hdl, size_t min_token_size)
Constructor.
- Parameters:
p – pointer to a string stream containing XML content.
n – size of the stream.
tks – XML token map instance.
ns_cxt – namespace context instance.
hdl – handler class instance.
min_token_size – minimum size of the internal token buffer.
-
threaded_sax_token_parser(const char *p, size_t n, const tokens &tks, xmlns_context &ns_cxt, handler_type &hdl, size_t min_token_size, size_t max_token_size)
Constructor.
- Parameters:
p – pointer to a string stream containing XML content.
n – size of the stream.
tks – XML token map instance.
ns_cxt – namespace context instance.
hdl – handler class instance.
min_token_size – minimum size of the internal token buffer.
max_token_size – maximum size of the internal token buffer.
-
void parse()
Call this method to start parsing.
-
void swap_string_pool(string_pool &pool)
-
threaded_sax_token_parser(const char *p, size_t n, const tokens &tks, xmlns_context &ns_cxt, handler_type &hdl, size_t min_token_size)
tokens
-
class tokens
XML token store that provides mapping of integral token indentifiers and their original names. Instances of this class are typically used as global constants.
Note
The string values for the original token names should be static values whose values and memory addresses remain unchanged during the life cycle of the instance that references them.
Note
This class is not copy-constructible.
Public Functions
-
tokens() = delete
-
tokens(const char **token_names, size_t token_name_count)
-
~tokens()
-
bool is_valid_token(xml_token_t token) const
Check if a token returned from get_token() method is valid.
- Returns:
true if valid, false otherwise.
-
xml_token_t get_token(std::string_view name) const
Get token from a specified name.
- Parameters:
name – textural token name
- Returns:
token value representing the given textural token.
-
std::string_view get_token_name(xml_token_t token) const
Get textural token name from a token value.
- Parameters:
token – numeric token value
- Returns:
textural token name, or empty string in case the given token is not valid.
-
tokens() = delete
value_error
-
class value_error : public orcus::general_error
xml_structure_error
-
class xml_structure_error : public orcus::general_error
xml_structure_tree
-
class xml_structure_tree
Tree representing the structure of elements in XML content. Recurring elements under the same parent are represented by a single element instance. This tree only includes elements; no attributes and content nodes appear in this tree.
Public Types
-
typedef std::vector<entity_name> entity_names_type
-
using range_handler_type = std::function<void(xml_table_range_t&&)>
Public Functions
-
xml_structure_tree() = delete
-
xml_structure_tree(const xml_structure_tree&) = delete
-
xml_structure_tree &operator=(const xml_structure_tree&) = delete
-
xml_structure_tree(xmlns_context &xmlns_cxt)
-
xml_structure_tree(xml_structure_tree &&other)
-
~xml_structure_tree()
-
void parse(std::string_view s)
-
void dump_compact(std::ostream &os) const
-
void process_ranges(range_handler_type rh) const
-
void swap(xml_structure_tree &other)
-
struct element
-
struct entity_name
Public Functions
-
entity_name()
-
entity_name(xmlns_id_t _ns, std::string_view _name)
-
bool operator<(const entity_name &r) const
-
bool operator==(const entity_name &r) const
-
struct hash
Public Functions
-
size_t operator()(const entity_name &val) const
-
size_t operator()(const entity_name &val) const
-
entity_name()
-
class walker
This class allows client to traverse the tree.
Public Functions
-
walker() = delete
-
~walker()
-
element root()
Set current position to the root element, and return the root element.
- Returns:
root element.
-
element descend(const entity_name &name)
Descend into a specified child element.
- Parameters:
name – name of a child element.
- Throws:
general_error – if no child elements exist for the specified name.
- Returns:
child element
-
element move_to(const std::string &path)
Move to the element specified by a path expression. The path expression may be generated by
xml_structure_tree::walker::get_path
.- Parameters:
path – a simple XPath like expression
- Returns:
element pointed to by the path.
-
entity_names_type get_children()
Get a list of names of all child elements at the current element position. The list of names is in order of appearance.
- Returns:
list of child element names in order of appearance.
-
entity_names_type get_attributes()
Get a list of names of all attributes that belong to current element. The list of names is in order of appearance.
- Returns:
list of attribute names in order of appearance.
-
size_t get_xmlns_index(xmlns_id_t ns) const
Get a numerical, 0-based index of given XML namespace.
- Parameters:
ns – XML namespace ID.
- Returns:
numeric, 0-based index of XML namespace if found, or
xml_structure_tree::walker::index_not_found
if the namespace is not found in this structure.
-
std::string get_xmlns_short_name(xmlns_id_t ns) const
-
std::string to_string(const entity_name &name) const
Convert an entity name to its proper string representation.
- Parameters:
name – entity name to convert to string.
- Returns:
string representation of the entity name, including the namespace.
-
std::string get_path() const
Get a XPath like ID for the element inside of the XML tree.
-
walker() = delete
-
typedef std::vector<entity_name> entity_names_type
xml_writer
-
class xml_writer
This class lets you produce XML contents from scratch. It writes its content to any object supporting the std::ostream interface.
Public Functions
-
xml_writer(const xml_writer&) = delete
-
xml_writer &operator=(const xml_writer&) = delete
-
xml_writer(xmlns_repository &ns_repo, std::ostream &os)
-
xml_writer(xml_writer &&other)
-
xml_writer &operator=(xml_writer &&other)
-
~xml_writer()
Destructor. Any remaining element(s) on the stack will get popped when the destructor is called.
-
scope push_element_scope(const xml_name_t &name)
Push a new element to the stack, and write an opening element to the output stream. It differs from the
push_element
method in that the new element will be automatically popped when the returned object goes out of scope.- Parameters:
name – name of the new element.
- Returns:
scope object which automatically pops the element when it goes out of scope.
-
void push_element(const xml_name_t &name)
Push a new element to the stack, and write an opening element to the output stream.
- Parameters:
name – name of the element.
-
xmlns_id_t add_namespace(std::string_view alias, std::string_view value)
Add a namespace definition for the next element to be pushed.
- Parameters:
alias – alias for the namespace.
value – value of the namespace definition.
- Returns:
ID for the namespace being added.
-
void add_attribute(const xml_name_t &name, std::string_view value)
Add a new attribute for the next element to be pushed.
- Parameters:
name – name of the attribute to be added.
value – value of the attribute to be added.
-
void add_content(std::string_view content)
Add a content to the current element on the stack. The content will be properly encoded.
- Parameters:
content – content to be added to the current element.
-
xml_name_t pop_element()
Pop the current element from the stack, and write a closing element to the output stream.
- Returns:
the name of the element being popped.
-
class scope
-
xml_writer(const xml_writer&) = delete
xmlns_context
-
class xmlns_context
XML namespace context. A new context should be used for each xml stream since the namespace keys themselves are not interned. Don’t hold an instance of this class any longer than the life cycle of the xml stream it is used in.
An empty key value i.e.
""
is associated with a default namespace.Public Functions
-
xmlns_context()
-
xmlns_context(xmlns_context&&)
-
xmlns_context(const xmlns_context &r)
-
~xmlns_context()
-
xmlns_context &operator=(const xmlns_context &r)
-
xmlns_context &operator=(xmlns_context &&r)
-
xmlns_id_t push(std::string_view alias, std::string_view uri)
Push a new namespace alias-value pair to the stack.
- Parameters:
alias – namespace alias to push onto the stack. If the same alias is already present, this overwrites it until it gets popped off the stack.
uri – namespace name to associate with the alias.
- Returns:
normalized namespace identifier for the namespace name.
-
void pop(std::string_view alias)
Pop a namespace alias from the stack.
- Parameters:
alias – namespace alias to pop from the stack.
-
xmlns_id_t get(std::string_view alias) const
Get the currnet namespace identifier for a specified namespace alias.
- Parameters:
alias – namespace alias to get the current namespace identifier for.
- Returns:
current namespace identifier associated with the alias.
-
size_t get_index(xmlns_id_t ns_id) const
Get a unique index value associated with a specified identifier. An index value is guaranteed to be unique regardless of contexts.
- Parameters:
ns_id – a namespace identifier to obtain index for.
- Returns:
index value associated with the identifier.
-
std::string get_short_name(xmlns_id_t ns_id) const
Get a ‘short’ name associated with a specified identifier. A short name is a string value conveniently short enough for display purposes, but still guaranteed to be unique to the identifier it is associated with.
Note
The xmlns_repository class has method of the same name, and that method works identically to this method.
- Parameters:
ns_id – a namespace identifier to obtain short name for.
- Returns:
short name for the specified identifier.
-
std::string_view get_alias(xmlns_id_t ns_id) const
Get an alias currently associated with a given namespace identifier.
- Parameters:
ns_id – namespace identifier.
- Returns:
alias name currently associted with the given namespace identifier, or an empty string if the given namespace is currently not associated with any aliases.
-
std::vector<xmlns_id_t> get_all_namespaces() const
-
void dump(std::ostream &os) const
-
void dump_state(std::ostream &os) const
Dump the internal state for debugging in YAML format.
-
void swap(xmlns_context &other) noexcept
-
xmlns_context()
xmlns_repository
-
class xmlns_repository
Central XML namespace repository that stores all namespaces that are used in the current session.
Warning
this class is not copyable, but is movable; however, the moved-from object will not be usable after the move.
Public Functions
-
xmlns_repository(const xmlns_repository&) = delete
-
xmlns_repository &operator=(const xmlns_repository&) = delete
-
xmlns_repository()
-
xmlns_repository(xmlns_repository &&other)
-
~xmlns_repository()
-
xmlns_repository &operator=(xmlns_repository&&)
-
void add_predefined_values(const xmlns_id_t *predefined_ns)
Add a set of predefined namespace values to the repository.
- Parameters:
predefined_ns – predefined set of namespace values. This is a null-terminated array of xmlns_id_t. This xmlns_repository instance will assume that the instances of these xmlns_id_t values will be available throughout its life cycle; caller needs to ensure that they won’t get deleted before the corresponding xmlns_repository instance is deleted.
-
xmlns_context create_context()
Create a context object associated with this namespace repository.
Warning
Since this context object references values stored in the repo, make sure that it will not out-live the repository object itself.
- Returns:
context object to use for a new XML stream.
-
xmlns_id_t get_identifier(size_t index) const
Get XML namespace identifier from its numerical index.
- Parameters:
index – numeric index of namespace.
- Returns:
valid namespace identifier, or XMLNS_UNKNOWN_ID if not found.
-
std::string get_short_name(xmlns_id_t ns_id) const
See xmlns_context::get_short_name() for the explanation of this method, which works identically to it.
-
xmlns_repository(const xmlns_repository&) = delete
xpath_error
-
class xpath_error : public orcus::general_error
Error indicating improper xpath syntax.
yaml_handler
-
class yaml_handler
Blank handler class for yaml_parser. One can sub-class this and overwrite callback functions one needs to handle.
Public Functions
-
inline void begin_parse()
Called when the parser starts parsing a content.
-
inline void end_parse()
Called when the parser finishes parsing an entire content.
-
inline void begin_document()
Called when a new document is encountered.
-
inline void end_document()
Called when the parser has finished parsing a document.
-
inline void begin_sequence()
Called when a sequence begins.
-
inline void end_sequence()
Called when a sequence ends.
-
inline void begin_map()
Called when a map begins.
-
inline void begin_map_key()
Called when the parser starts parsing a map key.
-
inline void end_map_key()
Called when the parser finishes parsing a map key.
-
inline void end_map()
Called when the parser finishes parsing an entire map.
-
inline void string(std::string_view value)
Called when a string value is encountered.
- Parameters:
value – string value.
-
inline void number(double val)
Called when a numeric value is encountered.
- Parameters:
val – numeric value.
-
inline void boolean_true()
Called when a boolean ‘true’ keyword is encountered.
-
inline void boolean_false()
Called when a boolean ‘false’ keyword is encountered.
-
inline void null()
Called when a ‘null’ keyword is encountered.
-
inline void begin_parse()
yaml_parser
-
template<typename HandlerT>
class yaml_parser : public orcus::yaml::parser_base Parser for YAML documents.
Warning
This parser is still highly experimental. Use with caution.
- Template Parameters:
HandlerT – Hanlder type with member functions for event callbacks. Refer to yaml_handler.
zip_archive
-
class zip_archive
Public Functions
-
zip_archive() = delete
-
zip_archive(const zip_archive&) = delete
-
zip_archive &operator=(const zip_archive) = delete
-
zip_archive(zip_archive_stream *stream)
-
~zip_archive()
-
void load()
Loading involves the parsing of the central directory of a zip archive (located toward the end of the stream) and building of file entry data which are stored in the central directory.
-
zip_file_entry_header get_file_entry_header(std::size_t index) const
Retrieve the header information for a file entry specified by index.
- Parameters:
index – file entry index.
- Returns:
header information for a file entry.
-
zip_file_entry_header get_file_entry_header(std::string_view name) const
Retrieve the header information for a file entry specified by name.
- Parameters:
name – file entry name.
- Returns:
header information for a file entry.
-
std::string_view get_file_entry_name(std::size_t index) const
Get file entry name from its index.
- Parameters:
index – file entry index
- Returns:
file entry name
-
size_t get_file_entry_count() const
Return the number of file entries stored in this zip archive. Note that a file entry may be a directory, so the number of files stored in the zip archive may not equal the number of file entries.
- Returns:
number of file entries.
-
std::vector<unsigned char> read_file_entry(std::string_view entry_name) const
Retrieve data stream of specified file entry. The retrieved data stream gets uncompressed if the original stream is compressed.
- Parameters:
entry_name – file entry name.
- Throws:
zip_error – thrown when any problem is encountered during data stream retrieval.
- Returns:
buffer containing the data stream for specified entry.
-
zip_archive() = delete
zip_archive_stream
-
class zip_archive_stream
Subclassed by orcus::zip_archive_stream_blob, orcus::zip_archive_stream_fd
zip_archive_stream_blob
-
class zip_archive_stream_blob : public orcus::zip_archive_stream
Zip archive whose content is already loaded onto memory.
Public Functions
-
zip_archive_stream_blob() = delete
-
zip_archive_stream_blob(const uint8_t *blob, std::size_t size)
-
virtual ~zip_archive_stream_blob()
-
virtual size_t size() const
-
virtual size_t tell() const
-
virtual void seek(size_t pos)
-
virtual void read(unsigned char *buffer, size_t length) const
-
zip_archive_stream_blob() = delete
zip_archive_stream_fd
-
class zip_archive_stream_fd : public orcus::zip_archive_stream
Zip archive based on file descriptor. The caller needs to provide the file path to the zip archive.
zip_error
-
class zip_error : public orcus::general_error
Exception related to parsing of zip archive stream.