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
orcus::pstring::
pstring
()¶orcus::pstring::
pstring
(const char *_pos)¶orcus::pstring::
pstring
(const char *_pos, size_t _size)¶orcus::pstring::
str
() const¶orcus::pstring::
size
() const¶orcus::pstring::
operator[]
(size_t idx) const¶orcus::pstring::
get
() const¶orcus::pstring::
operator==
(const char *_str) const¶orcus::pstring::
operator!=
(const char *_str) const¶orcus::pstring::
empty
() const¶orcus::pstring::
clear
()¶orcus::pstring::
resize
(size_t new_size)¶Implements string hash map.
Public Functions
orcus::string_pool::
string_pool
(const string_pool&)¶orcus::string_pool::
operator=
(const string_pool&)¶orcus::string_pool::
string_pool
()¶orcus::string_pool::
~string_pool
()¶orcus::string_pool::
intern
(const char *str)¶Intern a string.
str
: string to intern. It must be null-terminated.orcus::string_pool::
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.orcus::string_pool::
intern
(const pstring &str)¶Intern a string.
str
: string to intern.orcus::string_pool::
dump
() const¶orcus::string_pool::
clear
()¶orcus::string_pool::
size
() const¶orcus::string_pool::
swap
(string_pool &other)¶orcus::string_pool::
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. Public Functions
orcus::tokens::
tokens
(const char **token_names, size_t token_name_count)¶orcus::tokens::
is_valid_token
(xml_token_t token) const¶Check if a token returned from get_token() method is valid.
orcus::tokens::
get_token
(const pstring &name) const¶Get token from a specified name.
name
: textural token nameorcus::tokens::
get_token_name
(xml_token_t token) const¶Get textural token name from a token value.
token
: numeric token valueTemporary cell buffer used to convert cell values when needed. This is used in the sax and csv parsers.
Public Functions
orcus::cell_buffer::
cell_buffer
()¶Logical buffer size. May differ from the actual buffer size.
orcus::cell_buffer::
append
(const char *p, size_t len)¶orcus::cell_buffer::
reset
()¶orcus::cell_buffer::
get
() const¶orcus::cell_buffer::
size
() const¶orcus::cell_buffer::
empty
() const¶Public Functions
orcus::zip_archive::
zip_archive
(zip_archive_stream *stream)¶orcus::zip_archive::
~zip_archive
()¶orcus::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.
orcus::zip_archive::
dump_file_entry
(size_t index) const¶Dump the content of a specified file entry to stdout.
index
: file entry index orcus::zip_archive::
dump_file_entry
(const char *entry_name) const¶Dump the content of a specified file entry to stdout.
entry_name
: file entry name. orcus::zip_archive::
get_file_entry_name
(size_t index) const¶Get file entry name from its index.
index
: file entry indexorcus::zip_archive::
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.
orcus::zip_archive::
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.Public Functions
orcus::xml_name_t::
xml_name_t
()¶orcus::xml_name_t::
xml_name_t
(xmlns_id_t _ns, const pstring &_name)¶orcus::xml_name_t::
xml_name_t
(const xml_name_t &r)¶Public Functions
orcus::xml_token_attr_t::
xml_token_attr_t
()¶orcus::xml_token_attr_t::
xml_token_attr_t
(xmlns_id_t _ns, xml_token_t _name, const pstring &_value, bool _transient)¶orcus::xml_token_attr_t::
xml_token_attr_t
(xmlns_id_t _ns, xml_token_t _name, const pstring &_raw_name, const pstring &_value, bool _transient)¶Public Members
orcus::xml_token_attr_t::
ns
¶orcus::xml_token_attr_t::
name
¶orcus::xml_token_attr_t::
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.