⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 classchm_1_1chmfile.html

📁 It is a chm file viewer lib with source code
💻 HTML
📖 第 1 页 / 共 3 页
字号:
<!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> &nbsp; <a class="qindex" href="namespaces.html">Namespace List</a> &nbsp; <a class="qindex" href="annotated.html">Compound List</a> &nbsp; <a class="qindex" href="files.html">File List</a> &nbsp; <a class="qindex" href="functions.html">Compound Members</a> &nbsp; <a class="qindex" href="globals.html">File Members</a> &nbsp; </center><hr><h1>chm::chmfile Class Reference</h1>A chm archive. <a href="#_details">More...</a><p><code>#include &lt;<a class="el" href="chmxx_8h-source.html">chmxx.h</a>&gt;</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 &nbsp;</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>&nbsp;</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>&nbsp;</td><td valign=bottom><a class="el" href="classchm_1_1chmfile.html#a0">chmfile</a> (const std::string &amp;path)</td></tr><tr><td>&nbsp;</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&nbsp;</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&nbsp;</td><td valign=bottom><a class="el" href="classchm_1_1chmfile.html#a2">is_open</a> () const</td></tr><tr><td>&nbsp;</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&nbsp;</td><td valign=bottom><a class="el" href="classchm_1_1chmfile.html#a3">close</a> ()</td></tr><tr><td>&nbsp;</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>&nbsp;</td><td valign=bottom><a class="el" href="classchm_1_1chmfile.html#a4">operator bool</a> () const</td></tr><tr><td>&nbsp;</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&nbsp;</td><td valign=bottom><a class="el" href="classchm_1_1chmfile.html#a5">read</a> (const std::string &amp;path, std::ostream &amp;out) const</td></tr><tr><td>&nbsp;</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&nbsp;</td><td valign=bottom><a class="el" href="classchm_1_1chmfile.html#a6">read</a> (const std::string &amp;path, std::vector&lt; char &gt; &amp;out) const</td></tr><tr><td>&nbsp;</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&nbsp;</td><td valign=bottom><a class="el" href="classchm_1_1chmfile.html#a7">read</a> (const std::string &amp;path, char *buf, size_t buf_size) const</td></tr><tr><td>&nbsp;</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&nbsp;</td><td valign=bottom><a class="el" href="classchm_1_1chmfile.html#a8">file_size</a> (const std::string &amp;path) const</td></tr><tr><td>&nbsp;</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&nbsp;</td><td valign=bottom><a class="el" href="classchm_1_1chmfile.html#a9">file_exists</a> (const std::string &amp;path) const</td></tr><tr><td>&nbsp;</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&nbsp;</td><td valign=bottom><a class="el" href="classchm_1_1chmfile.html#a10">readdir</a> (const std::string &amp;path, std::list&lt; std::string &gt; &amp;entries, int type=files|dirs) const</td></tr><tr><td>&nbsp;</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 *&nbsp;</td><td valign=bottom><a class="el" href="classchm_1_1chmfile.html#a11">open</a> (const std::string &amp;path, size_t buf_size=1024) const</td></tr><tr><td>&nbsp;</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 &amp;&nbsp;</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 &amp;&nbsp;</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 &amp;&nbsp;</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 &amp;&nbsp;</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 &amp;&nbsp;</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 &amp;&nbsp;</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> *&nbsp;</td><td valign=bottom><a class="el" href="classchm_1_1chmfile.html#a18">get_topics_tree</a> () const</td></tr><tr><td>&nbsp;</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&nbsp;</td><td valign=bottom><a class="el" href="classchm_1_1chmfile.html#a19">search_index</a> (const std::string &amp;txt, std::list&lt; <a class="el" href="structchm_1_1chm__search__match.html">chm_search_match</a> &gt; &amp;found, bool whole_words=true, bool titles_only=true) const</td></tr><tr><td>&nbsp;</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&nbsp;</td><td valign=bottom><a class="el" href="classchm_1_1chmfile.html#a20">cache</a> (const std::string &amp;path)</td></tr><tr><td>&nbsp;</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&nbsp;</td><td valign=bottom><a class="el" href="classchm_1_1chmfile.html#a21">cache_search_database</a> ()</td></tr><tr><td>&nbsp;</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>      &nbsp;    </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>&nbsp;</td><td></td></tr><tr><td valign=top><em><a name="s4s1" doxytag="dirs"></a><em>dirs</em></em>&nbsp;</td><td></td></tr><tr><td valign=top><em><a name="s4s2" doxytag="special"></a><em>special</em></em>&nbsp;</td><td></td></tr><tr><td valign=top><em><a name="s4s3" doxytag="meta"></a><em>meta</em></em>&nbsp;</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 &amp; 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">(&nbsp;</td>          <td class="md" nowrap valign="top">const std::string &amp;&nbsp;</td>          <td class="mdname1" valign="top" nowrap>&nbsp; <em>path</em>          </td>          <td class="md" valign="top">)&nbsp;</td>          <td class="md" nowrap></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </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">(&nbsp;</td>          <td class="mdname1" valign="top" nowrap>&nbsp;          </td>          <td class="md" valign="top">)&nbsp;</td>          <td class="md" nowrap><code> [virtual]</code></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </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">(&nbsp;</td>          <td class="md" nowrap valign="top">const std::string &amp;&nbsp;</td>          <td class="mdname1" valign="top" nowrap>&nbsp; <em>path</em>          </td>          <td class="md" valign="top">)&nbsp;</td>          <td class="md" nowrap></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </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">(&nbsp;</td>          <td class="mdname1" valign="top" nowrap>&nbsp;          </td>          <td class="md" valign="top">)&nbsp;</td>          <td class="md" nowrap></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </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">(&nbsp;</td>          <td class="mdname1" valign="top" nowrap>&nbsp;          </td>          <td class="md" valign="top">)&nbsp;</td>          <td class="md" nowrap></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </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">(&nbsp;</td>          <td class="md" nowrap valign="top">const std::string &amp;&nbsp;</td>          <td class="mdname1" valign="top" nowrap>&nbsp; <em>path</em>          </td>          <td class="md" valign="top">)&nbsp;</td>          <td class="md" nowrap> const</td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </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 + -