📄 classforthio.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"><title>ForthIo Class Reference</title><link href="doxygen.css" rel="stylesheet" type="text/css"></head><body><!-- Generated by Doxygen 1.4.1 --><div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="hierarchy.html">Class Hierarchy</a> | <a class="qindex" href="annotated.html">Class List</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="functions.html">Class Members</a> | <a class="qindex" href="globals.html">File Members</a></div><h1>ForthIo Class Reference<br><small>[<a class="el" href="group__forth.html">Forth - Forth virtual machine</a>]</small></h1><code>#include <<a class="el" href="forth_8h-source.html">forth.h</a>></code><p><a href="classForthIo-members.html">List of all members.</a><hr><a name="_details"></a><h2>Detailed Description</h2>Abstract interfrace class for forth character i/o. <p>The forth VM uses this object to request character input and output. Here is an example implementation of this class using the C standard library... <div class="fragment"><pre class="fragment"><span class="preprocessor"> #include <conio.h></span> <span class="keyword">class </span>StdForthIo : <span class="keyword">public</span> <a class="code" href="classForthIo.html">ForthIo</a> { <span class="keyword">public</span>: <span class="keyword">inline</span> StdForthIo() { NewLine[0]=2; NewLine[1]=13; NewLine[2]=10; } <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classForthIo.html#a0">ConsoleOut</a>(CHAR* text,UCELL textLength) { <span class="keywordflow">while</span>(textLength--) putch(*text++); } <span class="keyword">virtual</span> <a class="code" href="group__forth.html#ga0">CELL</a> <a class="code" href="classForthIo.html#a1">ConsoleIn</a>() { <span class="keywordflow">return</span> getch(); } };</pre></div> <p><p>Definition at line <a class="el" href="forth_8h-source.html#l00083">83</a> of file <a class="el" href="forth_8h-source.html">forth.h</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">virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="classForthIo.html#a0">ConsoleOut</a> (const <a class="el" href="group__forth.html#ga2">CHAR</a> *text, <a class="el" href="group__forth.html#ga1">UCELL</a> textLength)=0</td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">virtual <a class="el" href="group__forth.html#ga0">CELL</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classForthIo.html#a1">ConsoleIn</a> ()=0</td></tr><tr><td colspan="2"><br><h2>Public Attributes</h2></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="group__forth.html#ga2">CHAR</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classForthIo.html#o0">NewLine</a> [4]</td></tr></table><hr><h2>Member Function Documentation</h2><a class="anchor" name="a0" doxytag="ForthIo::ConsoleOut"></a><p><table class="mdTable" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top">virtual void ForthIo::ConsoleOut </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">const <a class="el" href="group__forth.html#ga2">CHAR</a> * </td> <td class="mdname" nowrap> <em>text</em>, </td> </tr> <tr> <td class="md" nowrap align="right"></td> <td class="md"></td> <td class="md" nowrap><a class="el" href="group__forth.html#ga1">UCELL</a> </td> <td class="mdname" nowrap> <em>textLength</em></td> </tr> <tr> <td class="md"></td> <td class="md">) </td> <td class="md" colspan="2"><code> [pure virtual]</code></td> </tr> </table> </td> </tr></table><table cellspacing="5" cellpadding="0" border="0"> <tr> <td> </td> <td><p>Display a text string on the console. This is called by the forth words <code>TYPE</code> and <code>EMIT</code>. <dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>text</em> </td><td>Pointer to string. </td></tr> <tr><td valign="top"></td><td valign="top"><em>textLength</em> </td><td>Number of characters in string.</td></tr> </table></dl> </td> </tr></table><a class="anchor" name="a1" doxytag="ForthIo::ConsoleIn"></a><p><table class="mdTable" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top">virtual <a class="el" href="group__forth.html#ga0">CELL</a> ForthIo::ConsoleIn </td> <td class="md" valign="top">( </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap><code> [pure virtual]</code></td> </tr> </table> </td> </tr></table><table cellspacing="5" cellpadding="0" border="0"> <tr> <td> </td> <td><p>Get a single character from the console input. This is called by the forth word <code>KEY</code>. <dl compact><dt><b>Returns:</b></dt><dd>The character.</dd></dl> </td> </tr></table><hr><h2>Member Data Documentation</h2><a class="anchor" name="o0" doxytag="ForthIo::NewLine"></a><p><table class="mdTable" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"><a class="el" href="group__forth.html#ga2">CHAR</a> <a class="el" href="classForthIo.html#o0">ForthIo::NewLine</a>[4] </td> </tr> </table> </td> </tr></table><table cellspacing="5" cellpadding="0" border="0"> <tr> <td> </td> <td><p>A counted string representing the system's line terminating sequence. This is used by the forth word <code>CR</code> and the first character in this string is also used as the input termination character by <code>ACECPT</code>.<p><code>NewLine[0]</code> is the character count, <code>NewLine[1]</code> and subsequent are the characters of the line terminating sequence; unused characters may be left uninitialised. E.g. the following sequence initialises the string with a carriage-return line-feed sequence: <div class="fragment"><pre class="fragment"> <a class="code" href="classForthIo.html#o0">NewLine</a>[0]=2; <a class="code" href="classForthIo.html#o0">NewLine</a>[1]=13; <a class="code" href="classForthIo.html#o0">NewLine</a>[2]=10;</pre></div><p>Definition at line <a class="el" href="forth_8h-source.html#l00114">114</a> of file <a class="el" href="forth_8h-source.html">forth.h</a>. </td> </tr></table><hr>The documentation for this class was generated from the following file:<ul><li>forth/<a class="el" href="forth_8h-source.html">forth.h</a></ul><HR><ADDRESS STYLE="align: right;"><SMALL>Generated by <A HREF="http://www.doxygen.org/index.html"><IMG SRC="doxygen.png" ALT="doxygen" ALIGN="middle" BORDER="0"></A> 1.4.1</SMALL></ADDRESS></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -