door_8cpp.html 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
  5. <meta http-equiv="X-UA-Compatible" content="IE=9"/>
  6. <meta name="generator" content="Doxygen 1.8.17"/>
  7. <meta name="viewport" content="width=device-width, initial-scale=1"/>
  8. <title>Bugz Door Project: door.cpp File Reference</title>
  9. <link href="tabs.css" rel="stylesheet" type="text/css"/>
  10. <script type="text/javascript" src="jquery.js"></script>
  11. <script type="text/javascript" src="dynsections.js"></script>
  12. <link href="search/search.css" rel="stylesheet" type="text/css"/>
  13. <script type="text/javascript" src="search/searchdata.js"></script>
  14. <script type="text/javascript" src="search/search.js"></script>
  15. <link href="doxygen.css" rel="stylesheet" type="text/css" />
  16. </head>
  17. <body>
  18. <div id="top"><!-- do not remove this div, it is closed by doxygen! -->
  19. <div id="titlearea">
  20. <table cellspacing="0" cellpadding="0">
  21. <tbody>
  22. <tr style="height: 56px;">
  23. <td id="projectalign" style="padding-left: 0.5em;">
  24. <div id="projectname">Bugz Door Project
  25. </div>
  26. </td>
  27. </tr>
  28. </tbody>
  29. </table>
  30. </div>
  31. <!-- end header part -->
  32. <!-- Generated by Doxygen 1.8.17 -->
  33. <script type="text/javascript">
  34. /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
  35. var searchBox = new SearchBox("searchBox", "search",false,'Search');
  36. /* @license-end */
  37. </script>
  38. <script type="text/javascript" src="menudata.js"></script>
  39. <script type="text/javascript" src="menu.js"></script>
  40. <script type="text/javascript">
  41. /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
  42. $(function() {
  43. initMenu('',true,false,'search.php','Search');
  44. $(document).ready(function() { init_search(); });
  45. });
  46. /* @license-end */</script>
  47. <div id="main-nav"></div>
  48. <!-- window showing the filter options -->
  49. <div id="MSearchSelectWindow"
  50. onmouseover="return searchBox.OnSearchSelectShow()"
  51. onmouseout="return searchBox.OnSearchSelectHide()"
  52. onkeydown="return searchBox.OnSearchSelectKey(event)">
  53. </div>
  54. <!-- iframe showing the search results (closed by default) -->
  55. <div id="MSearchResultsWindow">
  56. <iframe src="javascript:void(0)" frameborder="0"
  57. name="MSearchResults" id="MSearchResults">
  58. </iframe>
  59. </div>
  60. </div><!-- top -->
  61. <div class="header">
  62. <div class="summary">
  63. <a href="#nested-classes">Classes</a> &#124;
  64. <a href="#namespaces">Namespaces</a> &#124;
  65. <a href="#func-members">Functions</a> &#124;
  66. <a href="#var-members">Variables</a> </div>
  67. <div class="headertitle">
  68. <div class="title">door.cpp File Reference</div> </div>
  69. </div><!--header-->
  70. <div class="contents">
  71. <p>Door.
  72. <a href="#details">More...</a></p>
  73. <div class="textblock"><code>#include &quot;door.h&quot;</code><br />
  74. <code>#include &lt;algorithm&gt;</code><br />
  75. <code>#include &lt;chrono&gt;</code><br />
  76. <code>#include &lt;ctype.h&gt;</code><br />
  77. <code>#include &lt;string.h&gt;</code><br />
  78. <code>#include &lt;string&gt;</code><br />
  79. <code>#include &lt;thread&gt;</code><br />
  80. <code>#include &lt;libgen.h&gt;</code><br />
  81. <code>#include &lt;ctime&gt;</code><br />
  82. <code>#include &lt;iomanip&gt;</code><br />
  83. <code>#include &lt;signal.h&gt;</code><br />
  84. <code>#include &lt;unistd.h&gt;</code><br />
  85. <code>#include &lt;iconv.h&gt;</code><br />
  86. <code>#include &lt;iostream&gt;</code><br />
  87. <code>#include &lt;pwd.h&gt;</code><br />
  88. </div><div class="textblock"><div class="dynheader">
  89. Include dependency graph for door.cpp:</div>
  90. <div class="dyncontent">
  91. <div class="center"><img src="door_8cpp__incl.png" border="0" usemap="#door_8cpp" alt=""/></div>
  92. <map name="door_8cpp" id="door_8cpp">
  93. <area shape="rect" title="Door." alt="" coords="1328,5,1405,32"/>
  94. <area shape="rect" href="door_8h_source.html" title=" " alt="" coords="657,80,719,107"/>
  95. <area shape="rect" title=" " alt="" coords="5,155,64,181"/>
  96. <area shape="rect" title=" " alt="" coords="1061,155,1141,181"/>
  97. <area shape="rect" title=" " alt="" coords="1165,155,1240,181"/>
  98. <area shape="rect" title=" " alt="" coords="1036,80,1121,107"/>
  99. <area shape="rect" title=" " alt="" coords="1145,80,1212,107"/>
  100. <area shape="rect" title=" " alt="" coords="1237,80,1307,107"/>
  101. <area shape="rect" title=" " alt="" coords="1331,80,1402,107"/>
  102. <area shape="rect" title=" " alt="" coords="1427,80,1485,107"/>
  103. <area shape="rect" title=" " alt="" coords="1509,80,1573,107"/>
  104. <area shape="rect" title=" " alt="" coords="1597,80,1672,107"/>
  105. <area shape="rect" title=" " alt="" coords="1696,80,1771,107"/>
  106. <area shape="rect" title=" " alt="" coords="1795,80,1869,107"/>
  107. <area shape="rect" title=" " alt="" coords="1893,80,1961,107"/>
  108. <area shape="rect" title=" " alt="" coords="1985,80,2047,107"/>
  109. <area shape="rect" title=" " alt="" coords="197,155,296,181"/>
  110. <area shape="rect" title=" " alt="" coords="320,155,387,181"/>
  111. <area shape="rect" title=" " alt="" coords="411,155,485,181"/>
  112. <area shape="rect" title=" " alt="" coords="509,155,595,181"/>
  113. <area shape="rect" title=" " alt="" coords="620,155,681,181"/>
  114. <area shape="rect" title=" " alt="" coords="705,155,748,181"/>
  115. <area shape="rect" title=" " alt="" coords="772,155,849,181"/>
  116. <area shape="rect" title=" " alt="" coords="874,155,950,181"/>
  117. <area shape="rect" title=" " alt="" coords="974,155,1037,181"/>
  118. <area shape="rect" title=" " alt="" coords="89,155,173,181"/>
  119. </map>
  120. </div>
  121. </div><table class="memberdecls">
  122. <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
  123. Classes</h2></td></tr>
  124. <tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classdoor_1_1IConv.html">door::IConv</a></td></tr>
  125. <tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Converts from one encoding to another. Uses iconv (international conversion) API. <a href="classdoor_1_1IConv.html#details">More...</a><br /></td></tr>
  126. <tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
  127. </table><table class="memberdecls">
  128. <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="namespaces"></a>
  129. Namespaces</h2></td></tr>
  130. <tr class="memitem:namespacedoor"><td class="memItemLeft" align="right" valign="top"> &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacedoor.html">door</a></td></tr>
  131. <tr class="memdesc:namespacedoor"><td class="mdescLeft">&#160;</td><td class="mdescRight">The BBS door project. This is an attempt at writing a C++ BBS door toolkit. <br /></td></tr>
  132. <tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
  133. </table><table class="memberdecls">
  134. <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
  135. Functions</h2></td></tr>
  136. <tr class="memitem:afa94e91868d469077e4d3b400dedfd6c"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacedoor.html#afa94e91868d469077e4d3b400dedfd6c">door::to_lower</a> (std::string &amp;text)</td></tr>
  137. <tr class="memdesc:afa94e91868d469077e4d3b400dedfd6c"><td class="mdescLeft">&#160;</td><td class="mdescRight">convert string to lowercase <a href="namespacedoor.html#afa94e91868d469077e4d3b400dedfd6c">More...</a><br /></td></tr>
  138. <tr class="separator:afa94e91868d469077e4d3b400dedfd6c"><td class="memSeparator" colspan="2">&#160;</td></tr>
  139. <tr class="memitem:acba445fc4d33e1b0c1ff2b648cc2899d"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacedoor.html#acba445fc4d33e1b0c1ff2b648cc2899d">door::replace</a> (std::string &amp;str, const std::string &amp;from, const std::string &amp;to)</td></tr>
  140. <tr class="memdesc:acba445fc4d33e1b0c1ff2b648cc2899d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Replaces one string with another once. <a href="namespacedoor.html#acba445fc4d33e1b0c1ff2b648cc2899d">More...</a><br /></td></tr>
  141. <tr class="separator:acba445fc4d33e1b0c1ff2b648cc2899d"><td class="memSeparator" colspan="2">&#160;</td></tr>
  142. <tr class="memitem:a5cc0209e9203231d1bdb1e6b7f0876c3"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacedoor.html#a5cc0209e9203231d1bdb1e6b7f0876c3">door::replace</a> (std::string &amp;str, const char *from, const char *to)</td></tr>
  143. <tr class="memdesc:a5cc0209e9203231d1bdb1e6b7f0876c3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Replace all instances of from with to. <a href="namespacedoor.html#a5cc0209e9203231d1bdb1e6b7f0876c3">More...</a><br /></td></tr>
  144. <tr class="separator:a5cc0209e9203231d1bdb1e6b7f0876c3"><td class="memSeparator" colspan="2">&#160;</td></tr>
  145. <tr class="memitem:a4fc2f3f7f1b3908cb71bd1d275594fe9"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacedoor.html#a4fc2f3f7f1b3908cb71bd1d275594fe9">door::sig_handler</a> (int signal)</td></tr>
  146. <tr class="memdesc:a4fc2f3f7f1b3908cb71bd1d275594fe9"><td class="mdescLeft">&#160;</td><td class="mdescRight">Signal handler for detecting hangup/broken pipe. <a href="namespacedoor.html#a4fc2f3f7f1b3908cb71bd1d275594fe9">More...</a><br /></td></tr>
  147. <tr class="separator:a4fc2f3f7f1b3908cb71bd1d275594fe9"><td class="memSeparator" colspan="2">&#160;</td></tr>
  148. <tr class="memitem:a5efa4fb96eacd6b90e5cbb0bd985f3fc"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacedoor.html#a5efa4fb96eacd6b90e5cbb0bd985f3fc">door::cp437toUnicode</a> (std::string input, std::string &amp;out)</td></tr>
  149. <tr class="memdesc:a5efa4fb96eacd6b90e5cbb0bd985f3fc"><td class="mdescLeft">&#160;</td><td class="mdescRight">Convert from CP437 to unicode. <a href="namespacedoor.html#a5efa4fb96eacd6b90e5cbb0bd985f3fc">More...</a><br /></td></tr>
  150. <tr class="separator:a5efa4fb96eacd6b90e5cbb0bd985f3fc"><td class="memSeparator" colspan="2">&#160;</td></tr>
  151. <tr class="memitem:a7e94df0d0af14da619835aa90cfa8f2a"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacedoor.html#a7e94df0d0af14da619835aa90cfa8f2a">door::cp437toUnicode</a> (const char *input, std::string &amp;out)</td></tr>
  152. <tr class="memdesc:a7e94df0d0af14da619835aa90cfa8f2a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Convert from CP437 to unicode. <a href="namespacedoor.html#a7e94df0d0af14da619835aa90cfa8f2a">More...</a><br /></td></tr>
  153. <tr class="separator:a7e94df0d0af14da619835aa90cfa8f2a"><td class="memSeparator" colspan="2">&#160;</td></tr>
  154. <tr class="memitem:ad5d6277de5e8274cec970a4633d713b1"><td class="memItemLeft" align="right" valign="top">std::ostream &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacedoor.html#ad5d6277de5e8274cec970a4633d713b1">door::operator&lt;&lt;</a> (std::ostream &amp;os, const Clrscr &amp;clr)</td></tr>
  155. <tr class="separator:ad5d6277de5e8274cec970a4633d713b1"><td class="memSeparator" colspan="2">&#160;</td></tr>
  156. <tr class="memitem:aa6b909ef984a2aabc5b9a570884dff94"><td class="memItemLeft" align="right" valign="top">std::ostream &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacedoor.html#aa6b909ef984a2aabc5b9a570884dff94">door::operator&lt;&lt;</a> (std::ostream &amp;os, const NewLine &amp;nl)</td></tr>
  157. <tr class="separator:aa6b909ef984a2aabc5b9a570884dff94"><td class="memSeparator" colspan="2">&#160;</td></tr>
  158. <tr class="memitem:aae6ca4805185baa51dcc661a69fa801b"><td class="memItemLeft" align="right" valign="top">std::ostream &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacedoor.html#aae6ca4805185baa51dcc661a69fa801b">door::operator&lt;&lt;</a> (std::ostream &amp;os, const Goto &amp;g)</td></tr>
  159. <tr class="separator:aae6ca4805185baa51dcc661a69fa801b"><td class="memSeparator" colspan="2">&#160;</td></tr>
  160. </table><table class="memberdecls">
  161. <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="var-members"></a>
  162. Variables</h2></td></tr>
  163. <tr class="memitem:a64600b79b9b73f4705859ce4efb1a2fd"><td class="memItemLeft" align="right" valign="top">std::list&lt; char &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacedoor.html#a64600b79b9b73f4705859ce4efb1a2fd">door::pushback</a></td></tr>
  164. <tr class="memdesc:a64600b79b9b73f4705859ce4efb1a2fd"><td class="mdescLeft">&#160;</td><td class="mdescRight">pushback buffer for keys. <a href="namespacedoor.html#a64600b79b9b73f4705859ce4efb1a2fd">More...</a><br /></td></tr>
  165. <tr class="separator:a64600b79b9b73f4705859ce4efb1a2fd"><td class="memSeparator" colspan="2">&#160;</td></tr>
  166. <tr class="memitem:a1626abff63f7a1b9dc696969c860283b"><td class="memItemLeft" align="right" valign="top"><a id="a1626abff63f7a1b9dc696969c860283b"></a>
  167. bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacedoor.html#a1626abff63f7a1b9dc696969c860283b">door::unicode</a> = false</td></tr>
  168. <tr class="memdesc:a1626abff63f7a1b9dc696969c860283b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Was unicode detected? <br /></td></tr>
  169. <tr class="separator:a1626abff63f7a1b9dc696969c860283b"><td class="memSeparator" colspan="2">&#160;</td></tr>
  170. <tr class="memitem:aeade8b521c7f95755fdb166727c2b87c"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacedoor.html#aeade8b521c7f95755fdb166727c2b87c">door::full_cp437</a> = false</td></tr>
  171. <tr class="memdesc:aeade8b521c7f95755fdb166727c2b87c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Was full CP437 detected? <a href="namespacedoor.html#aeade8b521c7f95755fdb166727c2b87c">More...</a><br /></td></tr>
  172. <tr class="separator:aeade8b521c7f95755fdb166727c2b87c"><td class="memSeparator" colspan="2">&#160;</td></tr>
  173. <tr class="memitem:ac39a1dfdb8dec210d28133625f860bc1"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacedoor.html#ac39a1dfdb8dec210d28133625f860bc1">door::debug_capture</a> = false</td></tr>
  174. <tr class="memdesc:ac39a1dfdb8dec210d28133625f860bc1"><td class="mdescLeft">&#160;</td><td class="mdescRight">Capture the output for debugging. <a href="namespacedoor.html#ac39a1dfdb8dec210d28133625f860bc1">More...</a><br /></td></tr>
  175. <tr class="separator:ac39a1dfdb8dec210d28133625f860bc1"><td class="memSeparator" colspan="2">&#160;</td></tr>
  176. <tr class="memitem:ac70193caf66e4b9aed1529593727a6eb"><td class="memItemLeft" align="right" valign="top">Clrscr&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacedoor.html#ac70193caf66e4b9aed1529593727a6eb">door::cls</a></td></tr>
  177. <tr class="separator:ac70193caf66e4b9aed1529593727a6eb"><td class="memSeparator" colspan="2">&#160;</td></tr>
  178. <tr class="memitem:a36352ded72aee66b10e1bda6d3d8efb8"><td class="memItemLeft" align="right" valign="top">NewLine&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacedoor.html#a36352ded72aee66b10e1bda6d3d8efb8">door::nl</a></td></tr>
  179. <tr class="separator:a36352ded72aee66b10e1bda6d3d8efb8"><td class="memSeparator" colspan="2">&#160;</td></tr>
  180. <tr class="memitem:aa6a7c86274470fd22e45676ba6eebb36"><td class="memItemLeft" align="right" valign="top"><a id="aa6a7c86274470fd22e45676ba6eebb36"></a>
  181. const char&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacedoor.html#aa6a7c86274470fd22e45676ba6eebb36">door::SaveCursor</a> [] = &quot;\x1b[s&quot;</td></tr>
  182. <tr class="memdesc:aa6a7c86274470fd22e45676ba6eebb36"><td class="mdescLeft">&#160;</td><td class="mdescRight">ANSI Save Cursor position command. <br /></td></tr>
  183. <tr class="separator:aa6a7c86274470fd22e45676ba6eebb36"><td class="memSeparator" colspan="2">&#160;</td></tr>
  184. <tr class="memitem:a1ae3caab423b38b35e887d79b5ac1811"><td class="memItemLeft" align="right" valign="top"><a id="a1ae3caab423b38b35e887d79b5ac1811"></a>
  185. const char&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacedoor.html#a1ae3caab423b38b35e887d79b5ac1811">door::RestoreCursor</a> [] = &quot;\x1b[u&quot;</td></tr>
  186. <tr class="memdesc:a1ae3caab423b38b35e887d79b5ac1811"><td class="mdescLeft">&#160;</td><td class="mdescRight">ANSI Restore Cursor position command. <br /></td></tr>
  187. <tr class="separator:a1ae3caab423b38b35e887d79b5ac1811"><td class="memSeparator" colspan="2">&#160;</td></tr>
  188. <tr class="memitem:a3274dff22ddb19a3e429a703ee6f3e57"><td class="memItemLeft" align="right" valign="top">renderFunction&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacedoor.html#a3274dff22ddb19a3e429a703ee6f3e57">door::rBlueYellow</a></td></tr>
  189. <tr class="memdesc:a3274dff22ddb19a3e429a703ee6f3e57"><td class="mdescLeft">&#160;</td><td class="mdescRight">BlueYellow <a class="el" href="classdoor_1_1Render.html" title="Rendering a string with ANSIColor.">Render</a> example function. <a href="namespacedoor.html#a3274dff22ddb19a3e429a703ee6f3e57">More...</a><br /></td></tr>
  190. <tr class="separator:a3274dff22ddb19a3e429a703ee6f3e57"><td class="memSeparator" colspan="2">&#160;</td></tr>
  191. </table>
  192. <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
  193. <div class="textblock"><p>Door. </p>
  194. </div></div><!-- contents -->
  195. <!-- start footer part -->
  196. <hr class="footer"/><address class="footer"><small>
  197. Generated by &#160;<a href="http://www.doxygen.org/index.html">
  198. <img class="footer" src="doxygen.png" alt="doxygen"/>
  199. </a> 1.8.17
  200. </small></address>
  201. </body>
  202. </html>