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.
 
 
 
 

140 lines
18 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/Token.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">Token.hpp</div></div>
</div><!--header-->
<div class="contents">
<a href="Token_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="Token_8hpp.html#ac6f62333aafcf3546f487ccd7caa9928"> 4</a></span><span class="keyword">enum</span> <a class="code hl_enumeration" href="Token_8hpp.html#ac6f62333aafcf3546f487ccd7caa9928">TOKEN</a> {</div>
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno"><a class="line" href="Token_8hpp.html#ac6f62333aafcf3546f487ccd7caa9928a50e6b569a6062129ae6db26de31ed634"> 5</a></span> <a class="code hl_enumvalue" href="Token_8hpp.html#ac6f62333aafcf3546f487ccd7caa9928a50e6b569a6062129ae6db26de31ed634">CURLY_OPEN</a>,</div>
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno"><a class="line" href="Token_8hpp.html#ac6f62333aafcf3546f487ccd7caa9928ab7b2767f4af70f630238c234b74372e3"> 6</a></span> <a class="code hl_enumvalue" href="Token_8hpp.html#ac6f62333aafcf3546f487ccd7caa9928ab7b2767f4af70f630238c234b74372e3">CURLY_CLOSE</a>,</div>
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno"><a class="line" href="Token_8hpp.html#ac6f62333aafcf3546f487ccd7caa9928a29cf94637337909c3813bb50d6e9b3ee"> 7</a></span> <a class="code hl_enumvalue" href="Token_8hpp.html#ac6f62333aafcf3546f487ccd7caa9928a29cf94637337909c3813bb50d6e9b3ee">COLON</a>,</div>
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno"><a class="line" href="Token_8hpp.html#ac6f62333aafcf3546f487ccd7caa9928aee847e634a4297b274316de8a8ca9921"> 8</a></span> <a class="code hl_enumvalue" href="Token_8hpp.html#ac6f62333aafcf3546f487ccd7caa9928aee847e634a4297b274316de8a8ca9921">STRING</a>,</div>
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno"><a class="line" href="Token_8hpp.html#ac6f62333aafcf3546f487ccd7caa9928a12a90dfe20486bbe3e075afcd19ef2d0"> 9</a></span> <a class="code hl_enumvalue" href="Token_8hpp.html#ac6f62333aafcf3546f487ccd7caa9928a12a90dfe20486bbe3e075afcd19ef2d0">NUMBER</a>,</div>
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno"><a class="line" href="Token_8hpp.html#ac6f62333aafcf3546f487ccd7caa9928a69bc977cb9fc1fb8e85c2f5898a72ac7"> 10</a></span> <a class="code hl_enumvalue" href="Token_8hpp.html#ac6f62333aafcf3546f487ccd7caa9928a69bc977cb9fc1fb8e85c2f5898a72ac7">ARRAY_OPEN</a>,</div>
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"><a class="line" href="Token_8hpp.html#ac6f62333aafcf3546f487ccd7caa9928a8d7d97ea3ba9c9e041c1c79aa0d41786"> 11</a></span> <a class="code hl_enumvalue" href="Token_8hpp.html#ac6f62333aafcf3546f487ccd7caa9928a8d7d97ea3ba9c9e041c1c79aa0d41786">ARRAY_CLOSE</a>,</div>
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"><a class="line" href="Token_8hpp.html#ac6f62333aafcf3546f487ccd7caa9928af81277bcd86412fe04bb68718ea09392"> 12</a></span> <a class="code hl_enumvalue" href="Token_8hpp.html#ac6f62333aafcf3546f487ccd7caa9928af81277bcd86412fe04bb68718ea09392">COMMA</a>,</div>
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"><a class="line" href="Token_8hpp.html#ac6f62333aafcf3546f487ccd7caa9928a8a583f16e8d237a423c8c1d9087a4c72"> 13</a></span> <a class="code hl_enumvalue" href="Token_8hpp.html#ac6f62333aafcf3546f487ccd7caa9928a8a583f16e8d237a423c8c1d9087a4c72">BOOLEAN</a>,</div>
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"> 14</span> <a class="code hl_enumvalue" href="Token_8hpp.html#ac6f62333aafcf3546f487ccd7caa9928a74cf8825b522b9721ea02973803d76b4">NULL_TYPE</a></div>
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"><a class="line" href="Token_8hpp.html#ac6f62333aafcf3546f487ccd7caa9928a74cf8825b522b9721ea02973803d76b4"> 15</a></span>};</div>
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span> </div>
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"><a class="line" href="structToken__s.html"> 17</a></span><span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code hl_struct" href="structToken__s.html">Token_s</a> {</div>
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"><a class="line" href="structToken__s.html#a587f8b8850febdfcda82cbf8333940a4"> 18</a></span> <span class="keywordtype">string</span> <a class="code hl_variable" href="structToken__s.html#a587f8b8850febdfcda82cbf8333940a4">value</a>;</div>
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"><a class="line" href="structToken__s.html#aaa3b698f6684c40c5b07dbbcd5dc99de"> 19</a></span> <a class="code hl_enumeration" href="Token_8hpp.html#ac6f62333aafcf3546f487ccd7caa9928">TOKEN</a> <a class="code hl_variable" href="structToken__s.html#aaa3b698f6684c40c5b07dbbcd5dc99de">type</a>;</div>
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"><a class="line" href="Token_8hpp.html#a72a5c4804fbceb590019d751a6842f1f"> 20</a></span>} <a class="code hl_typedef" href="Token_8hpp.html#a72a5c4804fbceb590019d751a6842f1f">Token</a>;</div>
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span> </div>
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"><a class="line" href="classTokenizer.html"> 22</a></span><span class="keyword">class </span><a class="code hl_class" href="classTokenizer.html">Tokenizer</a> {</div>
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"><a class="line" href="classTokenizer.html#a71af0789a6f3a27aa4c335f4167822f2"> 23</a></span> std::fstream <a class="code hl_variable" href="classTokenizer.html#a71af0789a6f3a27aa4c335f4167822f2">file</a>;</div>
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno"><a class="line" href="classTokenizer.html#a59a134c63a57a6a6173fa2e12c49b5fd"> 24</a></span> <span class="keywordtype">size_t</span> <a class="code hl_variable" href="classTokenizer.html#a59a134c63a57a6a6173fa2e12c49b5fd">prevPos</a>;</div>
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"> 25</span> </div>
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno"> 26</span> <span class="keyword">public</span>:</div>
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno"> 27</span> <a class="code hl_class" href="classTokenizer.html">Tokenizer</a>(<span class="keywordtype">string</span> fileName);</div>
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"> 28</span> <span class="keywordtype">bool</span> <a class="code hl_function" href="classTokenizer.html#ace80ed64add3ef2d0ee9f659a182d935">hasMoreTokens</a>();</div>
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno"> 29</span> <span class="keywordtype">char</span> <a class="code hl_function" href="classTokenizer.html#a879cee0d079f48f300cb44ddfe3fb2c5">getWithoutWhiteSpace</a>();</div>
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno"> 30</span> <span class="keywordtype">void</span> <a class="code hl_function" href="classTokenizer.html#a49db8c86447ad2cb543b5b1ea877f34d">rollBackToken</a>();</div>
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno"> 31</span> <a class="code hl_struct" href="structToken__s.html">Token</a> <a class="code hl_function" href="classTokenizer.html#ad1c7c0a8f85fe189acefe26b857b7375">getToken</a>();</div>
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno"> 32</span>};</div>
<div class="ttc" id="aToken_8hpp_html_a72a5c4804fbceb590019d751a6842f1f"><div class="ttname"><a href="Token_8hpp.html#a72a5c4804fbceb590019d751a6842f1f">Token</a></div><div class="ttdeci">struct Token_s Token</div></div>
<div class="ttc" id="aToken_8hpp_html_ac6f62333aafcf3546f487ccd7caa9928"><div class="ttname"><a href="Token_8hpp.html#ac6f62333aafcf3546f487ccd7caa9928">TOKEN</a></div><div class="ttdeci">TOKEN</div><div class="ttdef"><b>Definition:</b> <a href="Token_8hpp_source.html#l00004">Token.hpp:4</a></div></div>
<div class="ttc" id="aToken_8hpp_html_ac6f62333aafcf3546f487ccd7caa9928a12a90dfe20486bbe3e075afcd19ef2d0"><div class="ttname"><a href="Token_8hpp.html#ac6f62333aafcf3546f487ccd7caa9928a12a90dfe20486bbe3e075afcd19ef2d0">NUMBER</a></div><div class="ttdeci">@ NUMBER</div><div class="ttdef"><b>Definition:</b> <a href="Token_8hpp_source.html#l00009">Token.hpp:9</a></div></div>
<div class="ttc" id="aToken_8hpp_html_ac6f62333aafcf3546f487ccd7caa9928a29cf94637337909c3813bb50d6e9b3ee"><div class="ttname"><a href="Token_8hpp.html#ac6f62333aafcf3546f487ccd7caa9928a29cf94637337909c3813bb50d6e9b3ee">COLON</a></div><div class="ttdeci">@ COLON</div><div class="ttdef"><b>Definition:</b> <a href="Token_8hpp_source.html#l00007">Token.hpp:7</a></div></div>
<div class="ttc" id="aToken_8hpp_html_ac6f62333aafcf3546f487ccd7caa9928a50e6b569a6062129ae6db26de31ed634"><div class="ttname"><a href="Token_8hpp.html#ac6f62333aafcf3546f487ccd7caa9928a50e6b569a6062129ae6db26de31ed634">CURLY_OPEN</a></div><div class="ttdeci">@ CURLY_OPEN</div><div class="ttdef"><b>Definition:</b> <a href="Token_8hpp_source.html#l00005">Token.hpp:5</a></div></div>
<div class="ttc" id="aToken_8hpp_html_ac6f62333aafcf3546f487ccd7caa9928a69bc977cb9fc1fb8e85c2f5898a72ac7"><div class="ttname"><a href="Token_8hpp.html#ac6f62333aafcf3546f487ccd7caa9928a69bc977cb9fc1fb8e85c2f5898a72ac7">ARRAY_OPEN</a></div><div class="ttdeci">@ ARRAY_OPEN</div><div class="ttdef"><b>Definition:</b> <a href="Token_8hpp_source.html#l00010">Token.hpp:10</a></div></div>
<div class="ttc" id="aToken_8hpp_html_ac6f62333aafcf3546f487ccd7caa9928a74cf8825b522b9721ea02973803d76b4"><div class="ttname"><a href="Token_8hpp.html#ac6f62333aafcf3546f487ccd7caa9928a74cf8825b522b9721ea02973803d76b4">NULL_TYPE</a></div><div class="ttdeci">@ NULL_TYPE</div><div class="ttdef"><b>Definition:</b> <a href="Token_8hpp_source.html#l00015">Token.hpp:14</a></div></div>
<div class="ttc" id="aToken_8hpp_html_ac6f62333aafcf3546f487ccd7caa9928a8a583f16e8d237a423c8c1d9087a4c72"><div class="ttname"><a href="Token_8hpp.html#ac6f62333aafcf3546f487ccd7caa9928a8a583f16e8d237a423c8c1d9087a4c72">BOOLEAN</a></div><div class="ttdeci">@ BOOLEAN</div><div class="ttdef"><b>Definition:</b> <a href="Token_8hpp_source.html#l00013">Token.hpp:13</a></div></div>
<div class="ttc" id="aToken_8hpp_html_ac6f62333aafcf3546f487ccd7caa9928a8d7d97ea3ba9c9e041c1c79aa0d41786"><div class="ttname"><a href="Token_8hpp.html#ac6f62333aafcf3546f487ccd7caa9928a8d7d97ea3ba9c9e041c1c79aa0d41786">ARRAY_CLOSE</a></div><div class="ttdeci">@ ARRAY_CLOSE</div><div class="ttdef"><b>Definition:</b> <a href="Token_8hpp_source.html#l00011">Token.hpp:11</a></div></div>
<div class="ttc" id="aToken_8hpp_html_ac6f62333aafcf3546f487ccd7caa9928ab7b2767f4af70f630238c234b74372e3"><div class="ttname"><a href="Token_8hpp.html#ac6f62333aafcf3546f487ccd7caa9928ab7b2767f4af70f630238c234b74372e3">CURLY_CLOSE</a></div><div class="ttdeci">@ CURLY_CLOSE</div><div class="ttdef"><b>Definition:</b> <a href="Token_8hpp_source.html#l00006">Token.hpp:6</a></div></div>
<div class="ttc" id="aToken_8hpp_html_ac6f62333aafcf3546f487ccd7caa9928aee847e634a4297b274316de8a8ca9921"><div class="ttname"><a href="Token_8hpp.html#ac6f62333aafcf3546f487ccd7caa9928aee847e634a4297b274316de8a8ca9921">STRING</a></div><div class="ttdeci">@ STRING</div><div class="ttdef"><b>Definition:</b> <a href="Token_8hpp_source.html#l00008">Token.hpp:8</a></div></div>
<div class="ttc" id="aToken_8hpp_html_ac6f62333aafcf3546f487ccd7caa9928af81277bcd86412fe04bb68718ea09392"><div class="ttname"><a href="Token_8hpp.html#ac6f62333aafcf3546f487ccd7caa9928af81277bcd86412fe04bb68718ea09392">COMMA</a></div><div class="ttdeci">@ COMMA</div><div class="ttdef"><b>Definition:</b> <a href="Token_8hpp_source.html#l00012">Token.hpp:12</a></div></div>
<div class="ttc" id="aclassTokenizer_html"><div class="ttname"><a href="classTokenizer.html">Tokenizer</a></div><div class="ttdef"><b>Definition:</b> <a href="Token_8hpp_source.html#l00022">Token.hpp:22</a></div></div>
<div class="ttc" id="aclassTokenizer_html_a49db8c86447ad2cb543b5b1ea877f34d"><div class="ttname"><a href="classTokenizer.html#a49db8c86447ad2cb543b5b1ea877f34d">Tokenizer::rollBackToken</a></div><div class="ttdeci">void rollBackToken()</div><div class="ttdef"><b>Definition:</b> <a href="Token_8cpp_source.html#l00026">Token.cpp:26</a></div></div>
<div class="ttc" id="aclassTokenizer_html_a59a134c63a57a6a6173fa2e12c49b5fd"><div class="ttname"><a href="classTokenizer.html#a59a134c63a57a6a6173fa2e12c49b5fd">Tokenizer::prevPos</a></div><div class="ttdeci">size_t prevPos</div><div class="ttdef"><b>Definition:</b> <a href="Token_8hpp_source.html#l00024">Token.hpp:24</a></div></div>
<div class="ttc" id="aclassTokenizer_html_a71af0789a6f3a27aa4c335f4167822f2"><div class="ttname"><a href="classTokenizer.html#a71af0789a6f3a27aa4c335f4167822f2">Tokenizer::file</a></div><div class="ttdeci">std::fstream file</div><div class="ttdef"><b>Definition:</b> <a href="Token_8hpp_source.html#l00023">Token.hpp:23</a></div></div>
<div class="ttc" id="aclassTokenizer_html_a879cee0d079f48f300cb44ddfe3fb2c5"><div class="ttname"><a href="classTokenizer.html#a879cee0d079f48f300cb44ddfe3fb2c5">Tokenizer::getWithoutWhiteSpace</a></div><div class="ttdeci">char getWithoutWhiteSpace()</div><div class="ttdef"><b>Definition:</b> <a href="Token_8cpp_source.html#l00011">Token.cpp:11</a></div></div>
<div class="ttc" id="aclassTokenizer_html_ace80ed64add3ef2d0ee9f659a182d935"><div class="ttname"><a href="classTokenizer.html#ace80ed64add3ef2d0ee9f659a182d935">Tokenizer::hasMoreTokens</a></div><div class="ttdeci">bool hasMoreTokens()</div><div class="ttdef"><b>Definition:</b> <a href="Token_8cpp_source.html#l00009">Token.cpp:9</a></div></div>
<div class="ttc" id="aclassTokenizer_html_ad1c7c0a8f85fe189acefe26b857b7375"><div class="ttname"><a href="classTokenizer.html#ad1c7c0a8f85fe189acefe26b857b7375">Tokenizer::getToken</a></div><div class="ttdeci">Token getToken()</div><div class="ttdef"><b>Definition:</b> <a href="Token_8cpp_source.html#l00031">Token.cpp:31</a></div></div>
<div class="ttc" id="astructToken__s_html"><div class="ttname"><a href="structToken__s.html">Token_s</a></div><div class="ttdef"><b>Definition:</b> <a href="Token_8hpp_source.html#l00017">Token.hpp:17</a></div></div>
<div class="ttc" id="astructToken__s_html_a587f8b8850febdfcda82cbf8333940a4"><div class="ttname"><a href="structToken__s.html#a587f8b8850febdfcda82cbf8333940a4">Token_s::value</a></div><div class="ttdeci">string value</div><div class="ttdef"><b>Definition:</b> <a href="Token_8hpp_source.html#l00018">Token.hpp:18</a></div></div>
<div class="ttc" id="astructToken__s_html_aaa3b698f6684c40c5b07dbbcd5dc99de"><div class="ttname"><a href="structToken__s.html#aaa3b698f6684c40c5b07dbbcd5dc99de">Token_s::type</a></div><div class="ttdeci">TOKEN type</div><div class="ttdef"><b>Definition:</b> <a href="Token_8hpp_source.html#l00019">Token.hpp:19</a></div></div>
<div class="ttc" id="awebserv_8hpp_html"><div class="ttname"><a href="webserv_8hpp.html">webserv.hpp</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>