You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

129 lines
15 KiB

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.7"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Webserv: includes/Route.hpp Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<td id="projectalign">
<div id="projectname">Webserv
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.7 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="dir_09e761304027c904456130627fd4dcf5.html">includes</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle"><div class="title">Route.hpp</div></div>
</div><!--header-->
<div class="contents">
<a href="Route_8hpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span><span class="preprocessor">#pragma once</span></div>
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno"> 2</span><span class="preprocessor">#include &quot;<a class="code" href="webserv_8hpp.html">webserv.hpp</a>&quot;</span></div>
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno"> 3</span> </div>
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno"><a class="line" href="classRoute.html"> 4</a></span><span class="keyword">class </span><a class="code hl_class" href="classRoute.html">Route</a> {</div>
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno"> 5</span><span class="keyword">protected</span>:</div>
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno"><a class="line" href="classRoute.html#a0265e667aad49b2e6e3ca040ba7c8e06"> 6</a></span> <a class="code hl_class" href="classServer.html">Server</a> *<a class="code hl_variable" href="classRoute.html#a0265e667aad49b2e6e3ca040ba7c8e06">_server</a>;</div>
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno"><a class="line" href="classRoute.html#a7e6bd355bcfd1c4110d300649291b58a"> 7</a></span> <span class="keywordtype">string</span> <a class="code hl_variable" href="classRoute.html#a7e6bd355bcfd1c4110d300649291b58a">_location</a>, <a class="code hl_variable" href="classRoute.html#a56499c8c2520297a62e2a117475e9e7c">_root</a>, <a class="code hl_variable" href="classRoute.html#ac3f11aed02ce019d0d556230b119d217">_ret</a>;</div>
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno"><a class="line" href="classRoute.html#a9b02eecb856d31da63cd1cd84600c43a"> 8</a></span> <span class="keywordtype">bool</span> <a class="code hl_variable" href="classRoute.html#a9b02eecb856d31da63cd1cd84600c43a">_autoindex</a>;</div>
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno"> 9</span> </div>
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno"> 10</span><span class="keyword">public</span>:</div>
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"><a class="line" href="classRoute.html#a3096f41064cf24c0c884d4c26f2fa07f"> 11</a></span> <a class="code hl_typedef" href="webserv_8hpp.html#aba96a6988a5bc02b5c8b908af07d0bbb">vec_string</a> <a class="code hl_variable" href="classRoute.html#a59d3fd535c995846b0d81b69d9b268f1">_indexs</a>, <a class="code hl_variable" href="classRoute.html#a3096f41064cf24c0c884d4c26f2fa07f">_allowed_methods</a>;</div>
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"><a class="line" href="classRoute.html#a1688ba652b72bb3a1a0055e7e9cd3e41"> 12</a></span> std::map&lt;string, string&gt; <a class="code hl_variable" href="classRoute.html#a1688ba652b72bb3a1a0055e7e9cd3e41">_cgi</a>;</div>
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"><a class="line" href="classRoute.html#a554deee37019d76b96a3411301b1d380"> 13</a></span> <span class="keywordtype">int</span> <a class="code hl_variable" href="classRoute.html#a554deee37019d76b96a3411301b1d380">_client_max_body_size</a>;</div>
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"> 14</span> </div>
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"> 15</span> <a class="code hl_class" href="classRoute.html">Route</a>(<a class="code hl_class" href="classServer.html">Server</a> *server, <span class="keywordtype">string</span> location, <a class="code hl_class" href="classJSONNode.html">JSONNode</a> *datas);</div>
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span> <a class="code hl_function" href="classRoute.html#a6c8cb0aaef581d3c14fff8ad99b3894f">~Route</a>(<span class="keywordtype">void</span>);</div>
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span> <span class="keywordtype">string</span> <a class="code hl_function" href="classRoute.html#a888d6e2bc84b59421e9909e075a6e8bb">getLocation</a>(<span class="keywordtype">void</span>);</div>
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"> 18</span> <span class="keywordtype">string</span> <a class="code hl_function" href="classRoute.html#afd1fe00a85e85ac4964f618f8f2d7bdf">getRoot</a>(<span class="keywordtype">void</span>);</div>
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span> <span class="keywordtype">string</span> <a class="code hl_function" href="classRoute.html#af9b27a012c16f0105b7c5caf25e033ef">getReturn</a>(<span class="keywordtype">void</span>);</div>
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"><a class="line" href="classRoute.html#af25f589b6b764829c3c98fcd952bf8ae"> 20</a></span> <a class="code hl_class" href="classServer.html">Server</a> *<a class="code hl_function" href="classRoute.html#af25f589b6b764829c3c98fcd952bf8ae">getServer</a>(<span class="keywordtype">void</span>);</div>
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span> <span class="keywordtype">string</span> <a class="code hl_function" href="classRoute.html#aa71b39273ba7bc2f683f40a6573ff810">getIndex</a>(<span class="keywordtype">string</span> uri, <span class="keywordtype">string</span> path);</div>
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span> <span class="keywordtype">string</span> <a class="code hl_function" href="classRoute.html#a5826254afb1e57c980c4b671bea8370a">correctUri</a>(<span class="keywordtype">string</span> uri);</div>
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"> 23</span>};</div>
<div class="ttc" id="aclassJSONNode_html"><div class="ttname"><a href="classJSONNode.html">JSONNode</a></div><div class="ttdef"><b>Definition:</b> <a href="Nodes_8hpp_source.html#l00004">Nodes.hpp:4</a></div></div>
<div class="ttc" id="aclassRoute_html"><div class="ttname"><a href="classRoute.html">Route</a></div><div class="ttdef"><b>Definition:</b> <a href="Route_8hpp_source.html#l00004">Route.hpp:4</a></div></div>
<div class="ttc" id="aclassRoute_html_a0265e667aad49b2e6e3ca040ba7c8e06"><div class="ttname"><a href="classRoute.html#a0265e667aad49b2e6e3ca040ba7c8e06">Route::_server</a></div><div class="ttdeci">Server * _server</div><div class="ttdef"><b>Definition:</b> <a href="Route_8hpp_source.html#l00006">Route.hpp:6</a></div></div>
<div class="ttc" id="aclassRoute_html_a1688ba652b72bb3a1a0055e7e9cd3e41"><div class="ttname"><a href="classRoute.html#a1688ba652b72bb3a1a0055e7e9cd3e41">Route::_cgi</a></div><div class="ttdeci">std::map&lt; string, string &gt; _cgi</div><div class="ttdef"><b>Definition:</b> <a href="Route_8hpp_source.html#l00012">Route.hpp:12</a></div></div>
<div class="ttc" id="aclassRoute_html_a3096f41064cf24c0c884d4c26f2fa07f"><div class="ttname"><a href="classRoute.html#a3096f41064cf24c0c884d4c26f2fa07f">Route::_allowed_methods</a></div><div class="ttdeci">vec_string _allowed_methods</div><div class="ttdef"><b>Definition:</b> <a href="Route_8hpp_source.html#l00011">Route.hpp:11</a></div></div>
<div class="ttc" id="aclassRoute_html_a554deee37019d76b96a3411301b1d380"><div class="ttname"><a href="classRoute.html#a554deee37019d76b96a3411301b1d380">Route::_client_max_body_size</a></div><div class="ttdeci">int _client_max_body_size</div><div class="ttdef"><b>Definition:</b> <a href="Route_8hpp_source.html#l00013">Route.hpp:13</a></div></div>
<div class="ttc" id="aclassRoute_html_a56499c8c2520297a62e2a117475e9e7c"><div class="ttname"><a href="classRoute.html#a56499c8c2520297a62e2a117475e9e7c">Route::_root</a></div><div class="ttdeci">string _root</div><div class="ttdef"><b>Definition:</b> <a href="Route_8hpp_source.html#l00007">Route.hpp:7</a></div></div>
<div class="ttc" id="aclassRoute_html_a5826254afb1e57c980c4b671bea8370a"><div class="ttname"><a href="classRoute.html#a5826254afb1e57c980c4b671bea8370a">Route::correctUri</a></div><div class="ttdeci">string correctUri(string uri)</div><div class="ttdoc">Find the local path corresponding to the uri asked by te client.</div><div class="ttdef"><b>Definition:</b> <a href="Route_8cpp_source.html#l00115">Route.cpp:115</a></div></div>
<div class="ttc" id="aclassRoute_html_a59d3fd535c995846b0d81b69d9b268f1"><div class="ttname"><a href="classRoute.html#a59d3fd535c995846b0d81b69d9b268f1">Route::_indexs</a></div><div class="ttdeci">vec_string _indexs</div><div class="ttdef"><b>Definition:</b> <a href="Route_8hpp_source.html#l00011">Route.hpp:11</a></div></div>
<div class="ttc" id="aclassRoute_html_a6c8cb0aaef581d3c14fff8ad99b3894f"><div class="ttname"><a href="classRoute.html#a6c8cb0aaef581d3c14fff8ad99b3894f">Route::~Route</a></div><div class="ttdeci">~Route(void)</div><div class="ttdoc">Destructor.</div><div class="ttdef"><b>Definition:</b> <a href="Route_8cpp_source.html#l00051">Route.cpp:51</a></div></div>
<div class="ttc" id="aclassRoute_html_a7e6bd355bcfd1c4110d300649291b58a"><div class="ttname"><a href="classRoute.html#a7e6bd355bcfd1c4110d300649291b58a">Route::_location</a></div><div class="ttdeci">string _location</div><div class="ttdef"><b>Definition:</b> <a href="Route_8hpp_source.html#l00007">Route.hpp:7</a></div></div>
<div class="ttc" id="aclassRoute_html_a888d6e2bc84b59421e9909e075a6e8bb"><div class="ttname"><a href="classRoute.html#a888d6e2bc84b59421e9909e075a6e8bb">Route::getLocation</a></div><div class="ttdeci">string getLocation(void)</div><div class="ttdef"><b>Definition:</b> <a href="Route_8cpp_source.html#l00054">Route.cpp:54</a></div></div>
<div class="ttc" id="aclassRoute_html_a9b02eecb856d31da63cd1cd84600c43a"><div class="ttname"><a href="classRoute.html#a9b02eecb856d31da63cd1cd84600c43a">Route::_autoindex</a></div><div class="ttdeci">bool _autoindex</div><div class="ttdef"><b>Definition:</b> <a href="Route_8hpp_source.html#l00008">Route.hpp:8</a></div></div>
<div class="ttc" id="aclassRoute_html_aa71b39273ba7bc2f683f40a6573ff810"><div class="ttname"><a href="classRoute.html#aa71b39273ba7bc2f683f40a6573ff810">Route::getIndex</a></div><div class="ttdeci">string getIndex(string uri, string path)</div><div class="ttdoc">Search for an index while generating autoindex.</div><div class="ttdef"><b>Definition:</b> <a href="Route_8cpp_source.html#l00066">Route.cpp:66</a></div></div>
<div class="ttc" id="aclassRoute_html_ac3f11aed02ce019d0d556230b119d217"><div class="ttname"><a href="classRoute.html#ac3f11aed02ce019d0d556230b119d217">Route::_ret</a></div><div class="ttdeci">string _ret</div><div class="ttdef"><b>Definition:</b> <a href="Route_8hpp_source.html#l00007">Route.hpp:7</a></div></div>
<div class="ttc" id="aclassRoute_html_af25f589b6b764829c3c98fcd952bf8ae"><div class="ttname"><a href="classRoute.html#af25f589b6b764829c3c98fcd952bf8ae">Route::getServer</a></div><div class="ttdeci">Server * getServer(void)</div></div>
<div class="ttc" id="aclassRoute_html_af9b27a012c16f0105b7c5caf25e033ef"><div class="ttname"><a href="classRoute.html#af9b27a012c16f0105b7c5caf25e033ef">Route::getReturn</a></div><div class="ttdeci">string getReturn(void)</div><div class="ttdef"><b>Definition:</b> <a href="Route_8cpp_source.html#l00056">Route.cpp:56</a></div></div>
<div class="ttc" id="aclassRoute_html_afd1fe00a85e85ac4964f618f8f2d7bdf"><div class="ttname"><a href="classRoute.html#afd1fe00a85e85ac4964f618f8f2d7bdf">Route::getRoot</a></div><div class="ttdeci">string getRoot(void)</div><div class="ttdef"><b>Definition:</b> <a href="Route_8cpp_source.html#l00055">Route.cpp:55</a></div></div>
<div class="ttc" id="aclassServer_html"><div class="ttname"><a href="classServer.html">Server</a></div><div class="ttdef"><b>Definition:</b> <a href="Server_8hpp_source.html#l00004">Server.hpp:4</a></div></div>
<div class="ttc" id="awebserv_8hpp_html"><div class="ttname"><a href="webserv_8hpp.html">webserv.hpp</a></div></div>
<div class="ttc" id="awebserv_8hpp_html_aba96a6988a5bc02b5c8b908af07d0bbb"><div class="ttname"><a href="webserv_8hpp.html#aba96a6988a5bc02b5c8b908af07d0bbb">vec_string</a></div><div class="ttdeci">std::vector&lt; string &gt; vec_string</div><div class="ttdef"><b>Definition:</b> <a href="webserv_8hpp_source.html#l00050">webserv.hpp:50</a></div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.7
</small></address>
</body>
</html>