orcus::
pstring
¶This string class does not store any char arrays, but it only stores the position of the first char in the memory, and the size of the char array.
Public Functions
pstring
()¶pstring
(const char *_pos)¶pstring
(const char *_pos, size_t _size)¶str
() const¶size
() const¶operator[]
(size_t idx) const¶get
() const¶operator==
(const char *_str) const¶operator!=
(const char *_str) const¶empty
() const¶clear
()¶resize
(size_t new_size)¶hash
¶orcus::
string_pool
¶Implements string hash map.
Public Functions
string_pool
(const string_pool&)¶operator=
(const string_pool&)¶string_pool
()¶~string_pool
()¶intern
(const char *str)¶Intern a string.
str
: string to intern. It must be null-terminated.intern
(const char *str, size_t n)¶Intern a string.
str
: string to intern. It doesn’t need to be null-terminated. n
: length of the string.intern
(const pstring &str)¶Intern a string.
str
: string to intern.dump
() const¶clear
()¶size
() const¶swap
(string_pool &other)¶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.
other
: string pool instance to merge in. orcus::
tokens
¶Public Functions
tokens
(const char **token_names, size_t token_name_count)¶is_valid_token
(xml_token_t token) const¶Check if a token returned from get_token() method is valid.
get_token
(const pstring &name) const¶Get token from a specified name.
name
: textural token nameget_token_name
(xml_token_t token) const¶Get textural token name from a token value.
token
: numeric token valueorcus::
cell_buffer
¶Temporary cell buffer used to convert cell values when needed. This is used in the sax and csv parsers.
orcus::
zip_archive
¶Public Functions
zip_archive
(zip_archive_stream *stream)¶~zip_archive
()¶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.
dump_file_entry
(size_t index) const¶Dump the content of a specified file entry to stdout.
index
: file entry index dump_file_entry
(const char *entry_name) const¶Dump the content of a specified file entry to stdout.
entry_name
: file entry name. get_file_entry_name
(size_t index) const¶Get file entry name from its index.
index
: file entry indexget_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.
read_file_entry
(const pstring &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.
entry_name
: file entry name buf
: buffer to put the retrieved data stream into.orcus::
xml_token_t
¶orcus::
xmlns_id_t
¶orcus::
xml_name_t
¶Public Functions
xml_name_t
()¶xml_name_t
(xmlns_id_t _ns, const pstring &_name)¶xml_name_t
(const xml_name_t &r)¶orcus::
xml_token_attr_t
¶Public Functions
xml_token_attr_t
()¶xml_token_attr_t
(xmlns_id_t _ns, xml_token_t _name, const pstring &_value, bool _transient)¶xml_token_attr_t
(xmlns_id_t _ns, xml_token_t _name, const pstring &_raw_name, const pstring &_value, bool _transient)¶Public Members
ns
¶name
¶transient
¶Whether or not the attribute value is transient. A transient value is not guaranteed to be valid after the start_element call ends. A non-transient value is guaranteed to be valid during the life cycle of the xml stream it belongs to.