265 lines
13 KiB
HTML
265 lines
13 KiB
HTML
<!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">
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
|
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
|
<meta name="generator" content="Doxygen 1.8.17"/>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
|
<title>My Project: core::Command Class Reference</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 style="height: 56px;">
|
|
<td id="projectalign" style="padding-left: 0.5em;">
|
|
<div id="projectname">My Project
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<!-- end header part -->
|
|
<!-- Generated by Doxygen 1.8.17 -->
|
|
<script type="text/javascript">
|
|
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
|
|
var searchBox = new SearchBox("searchBox", "search",false,'Search');
|
|
/* @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:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
|
|
$(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">
|
|
<iframe src="javascript:void(0)" frameborder="0"
|
|
name="MSearchResults" id="MSearchResults">
|
|
</iframe>
|
|
</div>
|
|
|
|
<div id="nav-path" class="navpath">
|
|
<ul>
|
|
<li class="navelem"><b>core</b></li><li class="navelem"><a class="el" href="classcore_1_1Command.html">Command</a></li> </ul>
|
|
</div>
|
|
</div><!-- top -->
|
|
<div class="header">
|
|
<div class="summary">
|
|
<a href="#pub-methods">Public Member Functions</a> |
|
|
<a href="classcore_1_1Command-members.html">List of all members</a> </div>
|
|
<div class="headertitle">
|
|
<div class="title">core::Command Class Reference</div> </div>
|
|
</div><!--header-->
|
|
<div class="contents">
|
|
|
|
<p><code>#include <<a class="el" href="Command_8h_source.html">Command.h</a>></code></p>
|
|
<div class="dynheader">
|
|
Inheritance diagram for core::Command:</div>
|
|
<div class="dyncontent">
|
|
<div class="center"><img src="classcore_1_1Command__inherit__graph.png" border="0" usemap="#core_1_1Command_inherit__map" alt="Inheritance graph"/></div>
|
|
<map name="core_1_1Command_inherit__map" id="core_1_1Command_inherit__map">
|
|
<area shape="rect" title=" " alt="" coords="226,5,351,32"/>
|
|
<area shape="rect" href="classcore_1_1CommandList.html" title=" " alt="" coords="5,80,153,107"/>
|
|
<area shape="rect" href="classcore_1_1EPoll.html" title=" " alt="" coords="178,80,269,107"/>
|
|
<area shape="rect" href="classcore_1_1TCPServer.html" title=" " alt="" coords="293,80,418,107"/>
|
|
<area shape="rect" href="classcore_1_1UDPServerSocket.html" title=" " alt="" coords="442,80,613,107"/>
|
|
<area shape="rect" href="classcore_1_1ConsoleServer.html" title=" " alt="" coords="198,155,350,181"/>
|
|
<area shape="rect" href="classcore_1_1TLSServer.html" title=" " alt="" coords="374,155,497,181"/>
|
|
</map>
|
|
<center><span class="legend">[<a href="graph_legend.html">legend</a>]</span></center></div>
|
|
<table class="memberdecls">
|
|
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
|
|
Public Member Functions</h2></td></tr>
|
|
<tr class="memitem:a3bec2a324e71b72f1525a28b2bb028fe"><td class="memItemLeft" align="right" valign="top">virtual bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classcore_1_1Command.html#a3bec2a324e71b72f1525a28b2bb028fe">check</a> (coreutils::ZString &request)</td></tr>
|
|
<tr class="separator:a3bec2a324e71b72f1525a28b2bb028fe"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a95176f2532c38ee14e3fee40ee28b1bd"><td class="memItemLeft" align="right" valign="top">virtual int </td><td class="memItemRight" valign="bottom"><a class="el" href="classcore_1_1Command.html#a95176f2532c38ee14e3fee40ee28b1bd">processCommand</a> (coreutils::ZString &request, <a class="el" href="classcore_1_1TCPSession.html">TCPSession</a> &session)</td></tr>
|
|
<tr class="separator:a95176f2532c38ee14e3fee40ee28b1bd"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:ab6352ce5650e70a5c76c3d6e4eefd292"><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="classcore_1_1Command.html#ab6352ce5650e70a5c76c3d6e4eefd292">output</a> (std::stringstream &out)</td></tr>
|
|
<tr class="separator:ab6352ce5650e70a5c76c3d6e4eefd292"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:ad8b0321c64838f4d5c8f93461b97cfef"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classcore_1_1Command.html#ad8b0321c64838f4d5c8f93461b97cfef">setName</a> (std::string name)</td></tr>
|
|
<tr class="separator:ad8b0321c64838f4d5c8f93461b97cfef"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:aa63cf88493b2a1b775b5b93b07e79324"><td class="memItemLeft" align="right" valign="top"><a id="aa63cf88493b2a1b775b5b93b07e79324"></a>
|
|
std::string </td><td class="memItemRight" valign="bottom"><b>getName</b> ()</td></tr>
|
|
<tr class="separator:aa63cf88493b2a1b775b5b93b07e79324"><td class="memSeparator" colspan="2"> </td></tr>
|
|
</table>
|
|
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
|
|
<div class="textblock"><p><a class="el" href="classcore_1_1Command.html">Command</a></p>
|
|
<p>Use the <a class="el" href="classcore_1_1Command.html">Command</a> object in combination with a <a class="el" href="classcore_1_1CommandList.html">CommandList</a> object to maintain a list of functions that can be invoked as a result of processing a request. </p>
|
|
</div><h2 class="groupheader">Member Function Documentation</h2>
|
|
<a id="a3bec2a324e71b72f1525a28b2bb028fe"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a3bec2a324e71b72f1525a28b2bb028fe">◆ </a></span>check()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="mlabels">
|
|
<tr>
|
|
<td class="mlabels-left">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">bool core::Command::check </td>
|
|
<td>(</td>
|
|
<td class="paramtype">coreutils::ZString & </td>
|
|
<td class="paramname"><em>request</em></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
<td class="mlabels-right">
|
|
<span class="mlabels"><span class="mlabel">virtual</span></span> </td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
<p>Implement check method to provide a special check rule upon the request to see if the command should be processed.</p>
|
|
<p>The default rule is to verify that the first token in the request string matches the name given on the registration of the command to the <a class="el" href="classcore_1_1CommandList.html">CommandList</a>. This can be overridden by implementing the <a class="el" href="classcore_1_1Command.html#a3bec2a324e71b72f1525a28b2bb028fe">check()</a> method to perform the test and return the condition of the command.</p>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramname">request</td><td>The request passed to the parser to check the rule. </td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
<dl class="section return"><dt>Returns</dt><dd>Return true to execute the command. Returning false will cause no action on this command. </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="ab6352ce5650e70a5c76c3d6e4eefd292"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#ab6352ce5650e70a5c76c3d6e4eefd292">◆ </a></span>output()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="mlabels">
|
|
<tr>
|
|
<td class="mlabels-left">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void core::Command::output </td>
|
|
<td>(</td>
|
|
<td class="paramtype">std::stringstream & </td>
|
|
<td class="paramname"><em>out</em></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
<td class="mlabels-right">
|
|
<span class="mlabels"><span class="mlabel">virtual</span></span> </td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
<p>Specify the output that will occur to the specified session.</p>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramname">session</td><td>The session that will receive the output. </td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
|
|
<p>Reimplemented in <a class="el" href="classcore_1_1TCPServer.html#a49e3ead1bf4e7830685780e73c4db5db">core::TCPServer</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a95176f2532c38ee14e3fee40ee28b1bd"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a95176f2532c38ee14e3fee40ee28b1bd">◆ </a></span>processCommand()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="mlabels">
|
|
<tr>
|
|
<td class="mlabels-left">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">int core::Command::processCommand </td>
|
|
<td>(</td>
|
|
<td class="paramtype">coreutils::ZString & </td>
|
|
<td class="paramname"><em>request</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype"><a class="el" href="classcore_1_1TCPSession.html">TCPSession</a> & </td>
|
|
<td class="paramname"><em>session</em> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
<td class="mlabels-right">
|
|
<span class="mlabels"><span class="mlabel">virtual</span></span> </td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
<p>This method is used to implement the functionality of the requested command. This pure virtual function must be implemented in your inheriting object.</p>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramname">request</td><td>The request that was entered by the user to invoke this command. </td></tr>
|
|
<tr><td class="paramname">session</td><td>Specify the requesting session so that the execution of the command process can return its output to the session. </td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
<dl class="section return"><dt>Returns</dt><dd>Returns 0 if execution of the command was successful. Otherwise returns a non-zero value indicating an error condition. </dd></dl>
|
|
|
|
<p>Reimplemented in <a class="el" href="classcore_1_1TCPServer.html#a6b7a7e1ac4132942fcaf418ed41c1437">core::TCPServer</a>, <a class="el" href="classcore_1_1EPoll.html#a22b5f1545aff3162040844be043abcce">core::EPoll</a>, and <a class="el" href="classcore_1_1CommandList.html#a1819e1cb377b5d8e5e00b4777e2b4aba">core::CommandList</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="ad8b0321c64838f4d5c8f93461b97cfef"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#ad8b0321c64838f4d5c8f93461b97cfef">◆ </a></span>setName()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void core::Command::setName </td>
|
|
<td>(</td>
|
|
<td class="paramtype">std::string </td>
|
|
<td class="paramname"><em>name</em></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
<p>Set the name of this command used in default rule checking during request parsing. NOTE: You do not need to call this under normal conditions as adding a <a class="el" href="classcore_1_1Command.html">Command</a> to a <a class="el" href="classcore_1_1CommandList.html">CommandList</a> using the add() method contains a parameter to pass the name of the <a class="el" href="classcore_1_1Command.html">Command</a>.</p>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramname">name</td><td>Specify the name of this command for default parsing. </td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
|
|
</div>
|
|
</div>
|
|
<hr/>The documentation for this class was generated from the following files:<ul>
|
|
<li><a class="el" href="Command_8h_source.html">Command.h</a></li>
|
|
<li>Command.cpp</li>
|
|
</ul>
|
|
</div><!-- contents -->
|
|
<!-- start footer part -->
|
|
<hr class="footer"/><address class="footer"><small>
|
|
Generated by  <a href="http://www.doxygen.org/index.html">
|
|
<img class="footer" src="doxygen.png" alt="doxygen"/>
|
|
</a> 1.8.17
|
|
</small></address>
|
|
</body>
|
|
</html>
|