#include <chmxx.h>
Public Types | |
enum | readdir_type { files = 1, dirs = 2, special = 4, meta = 8 } |
Use a combination of these as argument to the readdir. More... | |
Public Methods | |
chmfile (const std::string &path) | |
Construct a new chmfile object from given path. | |
virtual | ~chmfile () |
bool | is_open () const |
Tests whether archive is valid and open. | |
void | close () |
Close the archive and free resources. | |
operator bool () const | |
Tests whether opened archive is valid. | |
bool | read (const std::string &path, std::ostream &out) const |
Read the entire contents of given file and write to stream out. | |
bool | read (const std::string &path, std::vector< char > &out) const |
Read the entire contents of a file and store inside given vector. | |
bool | read (const std::string &path, char *buf, size_t buf_size) const |
Read buf_size bytes from path and place into buf. | |
std::streamsize | file_size (const std::string &path) const |
Returns the size of given file inside archive, returns 0 if file does not exist. | |
bool | file_exists (const std::string &path) const |
Returns a boolean value whether given file exists inside the archive. | |
bool | readdir (const std::string &path, std::list< std::string > &entries, int type=files|dirs) const |
Read entries under given path and append them to the list. | |
std::streambuf * | open (const std::string &path, size_t buf_size=1024) const |
Open given path inside the archive for reading and return a streambuf object. | |
const std::string & | get_title () const |
const std::string & | get_home_file () const |
const std::string & | get_generator () const |
const std::string & | get_index_file () const |
const std::string & | get_topics_file () const |
const std::string & | get_path () const |
const chm_topics_tree * | get_topics_tree () const |
Gets the topics tree. | |
bool | search_index (const std::string &txt, std::list< chm_search_match > &found, bool whole_words=true, bool titles_only=true) const |
Search the archive for given keyword and return found entries in found. | |
bool | cache (const std::string &path) |
Cache given file for _fast_ access inside memory. | |
void | cache_search_database () |
Cache all metadata that is required to perform fast searches inside the index. |
Definition at line 54 of file chmxx.h.
|
Use a combination of these as argument to the readdir.
|
|
Construct a new chmfile object from given path.
|
|
|
|
Cache given file for _fast_ access inside memory. All streams opened for that file will be memory cached. I know this caching business is a bit superfluous. It's not all good too - if you start unreading stuff using the stream the cache will be changed. |
|
Cache all metadata that is required to perform fast searches inside the index.
|
|
Close the archive and free resources.
|
|
Returns a boolean value whether given file exists inside the archive.
|
|
Returns the size of given file inside archive, returns 0 if file does not exist.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Gets the topics tree. If this is called first time the tree is calculated and stored for later use. In case the chm file has no soptics tree NULL is returned. |
|
Tests whether archive is valid and open.
Referenced by operator bool(). |
|
Open given path inside the archive for reading and return a streambuf object. Returns 0 in case file does not exist or an error happened. You're better off to using chmistream than this method. The returned object should be deleted after use. |
|
Tests whether opened archive is valid.
Definition at line 67 of file chmxx.h. References is_open(). |
|
Read buf_size bytes from path and place into buf.
|
|
Read the entire contents of a file and store inside given vector. The vector is resized to file size. |
|
Read the entire contents of given file and write to stream out.
|
|
Read entries under given path and append them to the list. Files of directory type will have '/' at the end of their names. |
|
Search the archive for given keyword and return found entries in found.
|