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

📄 class_file_module.html

📁 用c++编写http server的源码库,对socket等网络处理的代码可迅速转为己用.
💻 HTML
📖 第 1 页 / 共 2 页
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"><title>libpion: FileModule Class Reference</title><link href="doxygen.css" rel="stylesheet" type="text/css"><link href="tabs.css" rel="stylesheet" type="text/css"></head><body><!-- Generated by Doxygen 1.5.2 --><div class="tabs">  <ul>    <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>    <li><a href="namespaces.html"><span>Namespaces</span></a></li>    <li class="current"><a href="annotated.html"><span>Classes</span></a></li>    <li><a href="files.html"><span>Files</span></a></li>  </ul></div><div class="tabs">  <ul>    <li><a href="annotated.html"><span>Class&nbsp;List</span></a></li>    <li><a href="hierarchy.html"><span>Class&nbsp;Hierarchy</span></a></li>    <li><a href="functions.html"><span>Class&nbsp;Members</span></a></li>  </ul></div><h1>FileModule Class Reference</h1><!-- doxytag: class="FileModule" --><!-- doxytag: inherits="pion::HTTPModule" --><code>#include &lt;<a class="el" href="_file_module_8hpp-source.html">FileModule.hpp</a>&gt;</code><p>Inherits <a class="el" href="classpion_1_1_h_t_t_p_module.html">pion::HTTPModule</a>.<p><a href="class_file_module-members.html">List of all members.</a><hr><a name="_details"></a><h2>Detailed Description</h2><a class="el" href="class_file_module.html">FileModule</a>: module that serves regular files <p><p>Definition at line <a class="el" href="_file_module_8hpp-source.html#l00029">29</a> of file <a class="el" href="_file_module_8hpp-source.html">FileModule.hpp</a>.<table border="0" cellpadding="0" cellspacing="0"><tr><td></td></tr><tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="89750297878b91a8bff76e3470ea0083"></a><!-- doxytag: member="FileModule::FileModule" ref="89750297878b91a8bff76e3470ea0083" args="(void)" -->&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_file_module.html#89750297878b91a8bff76e3470ea0083">FileModule</a> (void)</td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="37cfd16771234e12f91ad2a99510e9f9"></a><!-- doxytag: member="FileModule::~FileModule" ref="37cfd16771234e12f91ad2a99510e9f9" args="()" -->virtual&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_file_module.html#37cfd16771234e12f91ad2a99510e9f9">~FileModule</a> ()</td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">virtual void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_file_module.html#e2bb1db0158386d16e5b6a9fb264f64e">setOption</a> (const std::string &amp;name, const std::string &amp;value)</td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="b9f46dabadef14ba1ca3b5698b310106"></a><!-- doxytag: member="FileModule::handleRequest" ref="b9f46dabadef14ba1ca3b5698b310106" args="(pion::HTTPRequestPtr &amp;request, pion::TCPConnectionPtr &amp;tcp_conn)" -->virtual bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_file_module.html#b9f46dabadef14ba1ca3b5698b310106">handleRequest</a> (<a class="el" href="namespacepion.html#3c0f3fad0f449ebd309eaf4872f2b222">pion::HTTPRequestPtr</a> &amp;request, <a class="el" href="namespacepion.html#1858b89656b28c6498ad9efd6b7e9d41">pion::TCPConnectionPtr</a> &amp;tcp_conn)</td></tr><tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">handles requests for <a class="el" href="class_file_module.html">FileModule</a> <br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="19565fca50d8699b17520b0733d76a9b"></a><!-- doxytag: member="FileModule::start" ref="19565fca50d8699b17520b0733d76a9b" args="(void)" -->virtual void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_file_module.html#19565fca50d8699b17520b0733d76a9b">start</a> (void)</td></tr><tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">called when the module's server is starting <br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="72e5556e073da7eb286dd10f6e693abe"></a><!-- doxytag: member="FileModule::stop" ref="72e5556e073da7eb286dd10f6e693abe" args="(void)" -->virtual void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_file_module.html#72e5556e073da7eb286dd10f6e693abe">stop</a> (void)</td></tr><tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">called when the module's server is stopping <br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="d60804754b7b2efa400d70ea1970d33e"></a><!-- doxytag: member="FileModule::setLogger" ref="d60804754b7b2efa400d70ea1970d33e" args="(pion::PionLogger log_ptr)" -->void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_file_module.html#d60804754b7b2efa400d70ea1970d33e">setLogger</a> (<a class="el" href="namespacepion.html#917bc483e4f692504156efb93c11b322">pion::PionLogger</a> log_ptr)</td></tr><tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">sets the logger to be used <br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="60a20e193d2bd53a5a49289e7f905339"></a><!-- doxytag: member="FileModule::getLogger" ref="60a20e193d2bd53a5a49289e7f905339" args="(void)" --><a class="el" href="namespacepion.html#917bc483e4f692504156efb93c11b322">pion::PionLogger</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_file_module.html#60a20e193d2bd53a5a49289e7f905339">getLogger</a> (void)</td></tr><tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">returns the logger currently in use <br></td></tr><tr><td colspan="2"><br><h2>Protected Types</h2></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="65973259d5a984b3933d8ea7aa97e5f1"></a><!-- doxytag: member="FileModule::CacheMap" ref="65973259d5a984b3933d8ea7aa97e5f1" args="" -->typedef PION_HASH_MAP&lt; std::string,<br> <a class="el" href="struct_file_module_1_1_disk_file.html">DiskFile</a>, boost::hash&lt; std::string &gt; &gt;&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_file_module.html#65973259d5a984b3933d8ea7aa97e5f1">CacheMap</a></td></tr><tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">data type for map of file names to cache entries <br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="2159dcd07ecffdf2aa1ee93d697308d8"></a><!-- doxytag: member="FileModule::MIMETypeMap" ref="2159dcd07ecffdf2aa1ee93d697308d8" args="" -->typedef PION_HASH_MAP&lt; std::string,<br> std::string, boost::hash&lt;<br> std::string &gt; &gt;&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_file_module.html#2159dcd07ecffdf2aa1ee93d697308d8">MIMETypeMap</a></td></tr><tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">data type for map of file extensions to MIME types <br></td></tr><tr><td colspan="2"><br><h2>Protected Member Functions</h2></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_file_module.html#1ad8c01c7d0253b5da3068d574169d82">scanDirectory</a> (const boost::filesystem::path &amp;dir_path)</td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">std::pair&lt; CacheMap::iterator,<br> bool &gt;&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_file_module.html#5df44719239d16aedf792fe5c9a19e5a">addCacheEntry</a> (const std::string &amp;relative_path, const boost::filesystem::path &amp;file_path, const bool placeholder)</td></tr><tr><td colspan="2"><br><h2>Static Protected Member Functions</h2></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">static std::string&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_file_module.html#8bd10d069624bf87d81343120aebe723">findMIMEType</a> (const std::string &amp;file_name)</td></tr><tr><td colspan="2"><br><h2>Protected Attributes</h2></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="789b2863d2937993e7152aa02c55f0ac"></a><!-- doxytag: member="FileModule::m_logger" ref="789b2863d2937993e7152aa02c55f0ac" args="" --><a class="el" href="namespacepion.html#917bc483e4f692504156efb93c11b322">pion::PionLogger</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_file_module.html#789b2863d2937993e7152aa02c55f0ac">m_logger</a></td></tr><tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">primary logging interface used by this class <br></td></tr><tr><td colspan="2"><br><h2>Classes</h2></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">class &nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_file_module_1_1_directory_not_found_exception.html">DirectoryNotFoundException</a></td></tr><tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">exception thrown if the directory configured is not found  <a href="class_file_module_1_1_directory_not_found_exception.html#_details">More...</a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">struct &nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_file_module_1_1_disk_file.html">DiskFile</a></td></tr><tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">data type representing files on disk  <a href="struct_file_module_1_1_disk_file.html#_details">More...</a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">class &nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_file_module_1_1_file_not_found_exception.html">FileNotFoundException</a></td></tr><tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">exception thrown if the file configured is not found  <a href="class_file_module_1_1_file_not_found_exception.html#_details">More...</a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">class &nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_file_module_1_1_file_read_exception.html">FileReadException</a></td></tr><tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">exception thrown if we are unable to read a file from disk  <a href="class_file_module_1_1_file_read_exception.html#_details">More...</a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">class &nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_file_module_1_1_invalid_cache_exception.html">InvalidCacheException</a></td></tr><tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">exception thrown if the cache option is set to an invalid value  <a href="class_file_module_1_1_invalid_cache_exception.html#_details">More...</a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">class &nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_file_module_1_1_invalid_scan_exception.html">InvalidScanException</a></td></tr><tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">exception thrown if the cache option is set to an invalid value  <a href="class_file_module_1_1_invalid_scan_exception.html#_details">More...</a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">class &nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_file_module_1_1_not_a_directory_exception.html">NotADirectoryException</a></td></tr><tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">exception thrown if the directory configuration option is not a directory  <a href="class_file_module_1_1_not_a_directory_exception.html#_details">More...</a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">class &nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_file_module_1_1_not_a_file_exception.html">NotAFileException</a></td></tr><tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">exception thrown if the file configuration option is not a file  <a href="class_file_module_1_1_not_a_file_exception.html#_details">More...</a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">class &nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_file_module_1_1_undefined_response_exception.html">UndefinedResponseException</a></td></tr><tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">exception thrown if we do not know how to response (should never happen)  <a href="class_file_module_1_1_undefined_response_exception.html#_details">More...</a><br></td></tr></table><hr><h2>Member Function Documentation</h2><a class="anchor" name="e2bb1db0158386d16e5b6a9fb264f64e"></a><!-- doxytag: member="FileModule::setOption" ref="e2bb1db0158386d16e5b6a9fb264f64e" args="(const std::string &amp;name, const std::string &amp;value)" --><div class="memitem"><div class="memproto">      <table class="memname">        <tr>          <td class="memname">void FileModule::setOption           </td>          <td>(</td>          <td class="paramtype">const std::string &amp;&nbsp;</td>          <td class="paramname"> <em>name</em>, </td>        </tr>        <tr>          <td class="paramkey"></td>          <td></td>          <td class="paramtype">const std::string &amp;&nbsp;</td>          <td class="paramname"> <em>value</em></td><td>&nbsp;</td>        </tr>        <tr>          <td></td>          <td>)</td>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -