Utilities¶
-
class
string_pool
¶ Implements string hash map.
Public Functions
-
string_pool
(const string_pool&)¶
-
string_pool &
operator=
(const string_pool&)¶
-
string_pool
()¶
-
~string_pool
()¶
-
std::pair<std::string_view, bool>
intern
(std::string_view str)¶ Intern a string.
- Return
- 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).
- Parameters
str
: string to intern.
-
std::vector<std::string_view>
get_interned_strings
() const¶ Return all interned strings.
- Return
- sequence of all interned strings. The sequence will be sorted.
-
void
dump
() const¶
-
void
clear
()¶
-
size_t
size
() const¶
-
void
swap
(string_pool &other)¶
-
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.
-
-
class
tokens
¶ Public Functions
-
tokens
()¶
-
tokens
(const char **token_names, size_t token_name_count)¶
-
bool
is_valid_token
(xml_token_t token) const¶ Check if a token returned from get_token() method is valid.
- Return
- true if valid, false otherwise.
-
xml_token_t
get_token
(std::string_view name) const¶ Get token from a specified name.
- Return
- token value representing the given textural token.
- Parameters
name
: textural token name
-
std::string_view
get_token_name
(xml_token_t token) const¶ Get textural token name from a token value.
- Return
- textural token name, or empty string in case the given token is not valid.
- Parameters
token
: numeric token value
-
-
class
cell_buffer
¶ Temporary cell buffer used to convert cell values when needed. This is used in the sax and csv parsers.
-
class
zip_archive
¶ Public Functions
-
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.
-
void
dump_file_entry
(size_t index) const¶ Dump the content of a specified file entry to stdout.
- Parameters
index
: file entry index
-
void
dump_file_entry
(std::string_view entry_name) const¶ Dump the content of a specified file entry to stdout.
- Parameters
entry_name
: file entry name.
-
std::string_view
get_file_entry_name
(std::size_t index) const¶ Get file entry name from its index.
- Return
- file entry name
- Parameters
index
: file entry index
-
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.
- Return
- number of file entries.
-
bool
read_file_entry
(std::string_view entry_name, std::vector<unsigned char> &buf) const¶ Retrieve data stream of specified file entry into buffer. The retrieved data stream gets uncompressed if the original stream is compressed. The method will overwrite the content of passed buffer if there is any pre-existing data in it.
- Return
- true if successful, false otherwise.
- Parameters
entry_name
: file entry namebuf
: buffer to put the retrieved data stream into.
-
XML Types¶
-
using
orcus
::
xml_token_t
= size_t¶
-
using
orcus
::
xmlns_id_t
= const char *¶
-
struct
xml_name_t
¶ -
Public Functions
-
xml_name_t
()¶
-
xml_name_t
(xmlns_id_t _ns, std::string_view _name)¶
-
xml_name_t
(const xml_name_t &r)¶
-
xml_name_t &
operator=
(const xml_name_t &other)¶
-
bool
operator==
(const xml_name_t &other) const¶
-
bool
operator!=
(const xml_name_t &other) const¶
-
std::string
to_string
(const xmlns_context &cxt, to_string_type type) const¶
-
std::string
to_string
(const xmlns_repository &repo) const¶
-
-
struct
xml_token_attr_t
¶ Public Functions
-
xml_token_attr_t
()¶
-
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)¶
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.
-
Other Types¶
-
enum
orcus
::
length_unit_t
¶ Values:
-
unknown
= 0¶
-
centimeter
¶
-
millimeter
¶
-
xlsx_column_digit
¶
-
inch
¶
-
point
¶
-
twip
¶
-
pixel
¶
-
-
struct
date_time_t
¶ 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¶
-
void
swap
(date_time_t &other)¶
-