?? classchm_1_1chmfile.html
字號:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"><title>chm::chmfile class Reference</title><link href="doxygen.css" rel="stylesheet" type="text/css"></head><body><!-- Generated by Doxygen 1.2.18 --><center><a class="qindex" href="index.html">Main Page</a> <a class="qindex" href="namespaces.html">Namespace List</a> <a class="qindex" href="annotated.html">Compound List</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="functions.html">Compound Members</a> <a class="qindex" href="globals.html">File Members</a> </center><hr><h1>chm::chmfile Class Reference</h1>A chm archive. <a href="#_details">More...</a><p><code>#include <<a class="el" href="chmxx_8h-source.html">chmxx.h</a>></code><p><a href="classchm_1_1chmfile-members.html">List of all members.</a><table border=0 cellpadding=0 cellspacing=0><tr><td></td></tr><tr><td colspan=2><br><h2>Public Types</h2></td></tr><tr><td nowrap align=right valign=top>enum </td><td valign=bottom><a class="el" href="classchm_1_1chmfile.html#s4">readdir_type</a> { <a class="el" href="classchm_1_1chmfile.html#s4s0">files</a> = 1, <a class="el" href="classchm_1_1chmfile.html#s4s1">dirs</a> = 2, <a class="el" href="classchm_1_1chmfile.html#s4s2">special</a> = 4, <a class="el" href="classchm_1_1chmfile.html#s4s3">meta</a> = 8 }</td></tr><tr><td> </td><td><font size=-1><em>Use a combination of these as argument to the readdir.</em> <a href="#s4">More...</a><em></em></font><br><br></td></tr><tr><td colspan=2><br><h2>Public Methods</h2></td></tr><tr><td nowrap align=right valign=top> </td><td valign=bottom><a class="el" href="classchm_1_1chmfile.html#a0">chmfile</a> (const std::string &path)</td></tr><tr><td> </td><td><font size=-1><em>Construct a new chmfile object from given path.</em> <a href="#a0"></a><em></em></font><br><br></td></tr><tr><td nowrap align=right valign=top>virtual </td><td valign=bottom><a class="el" href="classchm_1_1chmfile.html#a1">~chmfile</a> ()</td></tr><tr><td nowrap align=right valign=top>bool </td><td valign=bottom><a class="el" href="classchm_1_1chmfile.html#a2">is_open</a> () const</td></tr><tr><td> </td><td><font size=-1><em>Tests whether archive is valid and open.</em> <a href="#a2"></a><em></em></font><br><br></td></tr><tr><td nowrap align=right valign=top>void </td><td valign=bottom><a class="el" href="classchm_1_1chmfile.html#a3">close</a> ()</td></tr><tr><td> </td><td><font size=-1><em>Close the archive and free resources.</em> <a href="#a3"></a><em></em></font><br><br></td></tr><tr><td nowrap align=right valign=top> </td><td valign=bottom><a class="el" href="classchm_1_1chmfile.html#a4">operator bool</a> () const</td></tr><tr><td> </td><td><font size=-1><em>Tests whether opened archive is valid.</em> <a href="#a4"></a><em></em></font><br><br></td></tr><tr><td nowrap align=right valign=top>bool </td><td valign=bottom><a class="el" href="classchm_1_1chmfile.html#a5">read</a> (const std::string &path, std::ostream &out) const</td></tr><tr><td> </td><td><font size=-1><em>Read the entire contents of given file and write to stream out.</em> <a href="#a5"></a><em></em></font><br><br></td></tr><tr><td nowrap align=right valign=top>bool </td><td valign=bottom><a class="el" href="classchm_1_1chmfile.html#a6">read</a> (const std::string &path, std::vector< char > &out) const</td></tr><tr><td> </td><td><font size=-1><em>Read the entire contents of a file and store inside given vector.</em> <a href="#a6"></a><em></em></font><br><br></td></tr><tr><td nowrap align=right valign=top>bool </td><td valign=bottom><a class="el" href="classchm_1_1chmfile.html#a7">read</a> (const std::string &path, char *buf, size_t buf_size) const</td></tr><tr><td> </td><td><font size=-1><em>Read buf_size bytes from path and place into buf.</em> <a href="#a7"></a><em></em></font><br><br></td></tr><tr><td nowrap align=right valign=top>std::streamsize </td><td valign=bottom><a class="el" href="classchm_1_1chmfile.html#a8">file_size</a> (const std::string &path) const</td></tr><tr><td> </td><td><font size=-1><em>Returns the size of given file inside archive, returns 0 if file does not exist.</em> <a href="#a8"></a><em></em></font><br><br></td></tr><tr><td nowrap align=right valign=top>bool </td><td valign=bottom><a class="el" href="classchm_1_1chmfile.html#a9">file_exists</a> (const std::string &path) const</td></tr><tr><td> </td><td><font size=-1><em>Returns a boolean value whether given file exists inside the archive.</em> <a href="#a9"></a><em></em></font><br><br></td></tr><tr><td nowrap align=right valign=top>bool </td><td valign=bottom><a class="el" href="classchm_1_1chmfile.html#a10">readdir</a> (const std::string &path, std::list< std::string > &entries, int type=files|dirs) const</td></tr><tr><td> </td><td><font size=-1><em>Read entries under given path and append them to the list.</em> <a href="#a10"></a><em></em></font><br><br></td></tr><tr><td nowrap align=right valign=top>std::streambuf * </td><td valign=bottom><a class="el" href="classchm_1_1chmfile.html#a11">open</a> (const std::string &path, size_t buf_size=1024) const</td></tr><tr><td> </td><td><font size=-1><em>Open given path inside the archive for reading and return a streambuf object.</em> <a href="#a11"></a><em></em></font><br><br></td></tr><tr><td nowrap align=right valign=top>const std::string & </td><td valign=bottom><a class="el" href="classchm_1_1chmfile.html#a12">get_title</a> () const</td></tr><tr><td nowrap align=right valign=top>const std::string & </td><td valign=bottom><a class="el" href="classchm_1_1chmfile.html#a13">get_home_file</a> () const</td></tr><tr><td nowrap align=right valign=top>const std::string & </td><td valign=bottom><a class="el" href="classchm_1_1chmfile.html#a14">get_generator</a> () const</td></tr><tr><td nowrap align=right valign=top>const std::string & </td><td valign=bottom><a class="el" href="classchm_1_1chmfile.html#a15">get_index_file</a> () const</td></tr><tr><td nowrap align=right valign=top>const std::string & </td><td valign=bottom><a class="el" href="classchm_1_1chmfile.html#a16">get_topics_file</a> () const</td></tr><tr><td nowrap align=right valign=top>const std::string & </td><td valign=bottom><a class="el" href="classchm_1_1chmfile.html#a17">get_path</a> () const</td></tr><tr><td nowrap align=right valign=top>const <a class="el" href="structchm_1_1chm__topics__tree.html">chm_topics_tree</a> * </td><td valign=bottom><a class="el" href="classchm_1_1chmfile.html#a18">get_topics_tree</a> () const</td></tr><tr><td> </td><td><font size=-1><em>Gets the topics tree.</em> <a href="#a18"></a><em></em></font><br><br></td></tr><tr><td nowrap align=right valign=top>bool </td><td valign=bottom><a class="el" href="classchm_1_1chmfile.html#a19">search_index</a> (const std::string &txt, std::list< <a class="el" href="structchm_1_1chm__search__match.html">chm_search_match</a> > &found, bool whole_words=true, bool titles_only=true) const</td></tr><tr><td> </td><td><font size=-1><em>Search the archive for given keyword and return found entries in found.</em> <a href="#a19"></a><em></em></font><br><br></td></tr><tr><td nowrap align=right valign=top>bool </td><td valign=bottom><a class="el" href="classchm_1_1chmfile.html#a20">cache</a> (const std::string &path)</td></tr><tr><td> </td><td><font size=-1><em>Cache given file for _fast_ access inside memory.</em> <a href="#a20"></a><em></em></font><br><br></td></tr><tr><td nowrap align=right valign=top>void </td><td valign=bottom><a class="el" href="classchm_1_1chmfile.html#a21">cache_search_database</a> ()</td></tr><tr><td> </td><td><font size=-1><em>Cache all metadata that is required to perform fast searches inside the index.</em> <a href="#a21"></a><em></em></font><br><br></td></tr></table><hr><a name="_details"></a><h2>Detailed Description</h2>A chm archive.<p><p>Definition at line <a class="el" href="chmxx_8h-source.html#l00054">54</a> of file <a class="el" href="chmxx_8h-source.html">chmxx.h</a>.<hr><h2>Member Enumeration Documentation</h2><a name="s4" doxytag="chm::chmfile::readdir_type"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> enum chm::chmfile::readdir_type </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Use a combination of these as argument to the readdir.<p><dl compact><dt><b>Enumeration values: </b></dt><dd><table border=0 cellspacing=2 cellpadding=0><tr><td valign=top><em><a name="s4s0" doxytag="files"></a><em>files</em></em> </td><td></td></tr><tr><td valign=top><em><a name="s4s1" doxytag="dirs"></a><em>dirs</em></em> </td><td></td></tr><tr><td valign=top><em><a name="s4s2" doxytag="special"></a><em>special</em></em> </td><td></td></tr><tr><td valign=top><em><a name="s4s3" doxytag="meta"></a><em>meta</em></em> </td><td></td></tr></table></dl><p>Definition at line <a class="el" href="chmxx_8h-source.html#l00086">86</a> of file <a class="el" href="chmxx_8h-source.html">chmxx.h</a>. </td> </tr></table><hr><h2>Constructor & Destructor Documentation</h2><a name="a0" doxytag="chm::chmfile::chmfile"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> chm::chmfile::chmfile </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">const std::string & </td> <td class="mdname1" valign="top" nowrap> <em>path</em> </td> <td class="md" valign="top">) </td> <td class="md" nowrap></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Construct a new chmfile object from given path.<p> </td> </tr></table><a name="a1" doxytag="chm::chmfile::~chmfile"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> virtual chm::chmfile::~chmfile </td> <td class="md" valign="top">( </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top">) </td> <td class="md" nowrap><code> [virtual]</code></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p> </td> </tr></table><hr><h2>Member Function Documentation</h2><a name="a20" doxytag="chm::chmfile::cache"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> bool chm::chmfile::cache </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">const std::string & </td> <td class="mdname1" valign="top" nowrap> <em>path</em> </td> <td class="md" valign="top">) </td> <td class="md" nowrap></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Cache given file for _fast_ access inside memory.<p>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. </td> </tr></table><a name="a21" doxytag="chm::chmfile::cache_search_database"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> void chm::chmfile::cache_search_database </td> <td class="md" valign="top">( </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top">) </td> <td class="md" nowrap></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Cache all metadata that is required to perform fast searches inside the index.<p> </td> </tr></table><a name="a3" doxytag="chm::chmfile::close"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> void chm::chmfile::close </td> <td class="md" valign="top">( </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top">) </td> <td class="md" nowrap></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Close the archive and free resources.<p> </td> </tr></table><a name="a9" doxytag="chm::chmfile::file_exists"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> bool chm::chmfile::file_exists </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">const std::string & </td> <td class="mdname1" valign="top" nowrap> <em>path</em> </td> <td class="md" valign="top">) </td> <td class="md" nowrap> const</td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Returns a boolean value whether given file exists inside the archive.<p> </td> </tr></table><a name="a8" doxytag="chm::chmfile::file_size"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0">
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -