📄 swarm.simtools.infile.protocol.html
字号:
<HTML><HEAD><TITLE>InFile [Deprecated]</TITLE><METANAME="GENERATOR"CONTENT="Modular DocBook HTML Stylesheet Version 1.53"><LINKREL="HOME"TITLE="Documentation Set for Swarm 2.1.1"HREF="set.html"><LINKREL="UP"TITLE="Simtools Library"HREF="swarm.simtools.sgml.reference.html"><LINKREL="PREVIOUS"TITLE="AppendFile [Deprecated]"HREF="swarm.simtools.appendfile.protocol.html"><LINKREL="NEXT"TITLE="NSelect"HREF="swarm.simtools.nselect.protocol.html"></HEAD><BODYCLASS="REFENTRY"BGCOLOR="#FFFFFF"TEXT="#000000"LINK="#0000FF"VLINK="#840084"ALINK="#0000FF"><DIVCLASS="NAVHEADER"><TABLEWIDTH="100%"BORDER="0"CELLPADDING="0"CELLSPACING="0"><TR><THCOLSPAN="3"ALIGN="center">Documentation Set for Swarm 2.1.1</TH></TR><TR><TDWIDTH="10%"ALIGN="left"VALIGN="bottom"><AHREF="swarm.simtools.appendfile.protocol.html">Prev</A></TD><TDWIDTH="80%"ALIGN="center"VALIGN="bottom">Reference VI. Simtools Library</TD><TDWIDTH="10%"ALIGN="right"VALIGN="bottom"><AHREF="swarm.simtools.nselect.protocol.html">Next</A></TD></TR></TABLE><HRALIGN="LEFT"WIDTH="100%"></DIV><H1><ANAME="SWARM.SIMTOOLS.INFILE.PROTOCOL">InFile [Deprecated]</A></H1><DIVCLASS="REFNAMEDIV"><ANAME="AEN15739"></A><H2>Name</H2>InFile -- Class to perform file input.</DIV><DIVCLASS="REFSECT1"><ANAME="AEN15742"></A><H2>Description</H2><P><ICLASS="EMPHASIS">Deprecated: Warning: the error return behavior of these methods is fragile, only end of file is reported as an error. It is probably not wise to use use this inteface unless your text processing needs are very simple.</I></P><P> This class is (was) intended to simplify the input file-I/O in Swarm. It essentially deals with the detailed file opening and closing routines thus alleviating the need for C file I/O procedure calls.</P></DIV><DIVCLASS="REFSECT1"><ANAME="AEN15747"></A><H2>Protocols adopted by InFile</H2><P> <AHREF="swarm.objectbase.swarmobject.protocol.html">SwarmObject</A> <AHREF="swarm.defobj.creatable.protocol.html">CREATABLE</A></P></DIV><DIVCLASS="REFSECT1"><ANAME="AEN15752"></A><H2>Methods</H2><DIVCLASS="REFSECT2"><ANAME="AEN15754"></A><H3>Phase: Creating</H3><P></P><UL><LI><DIVCLASS="FUNCSYNOPSIS"><ANAME="SWARM.SIMTOOLS.INFILE.METHOD.PC.M36"></A><P></P>+ <BCLASS="FUNCPROTOTYPE">create:</B> (id <Zone>)<VARCLASS="PDPARAM">aZone</VAR> <BCLASS="FUNCPROTOTYPE">setName:</B> (const char *)<VARCLASS="PDPARAM">theName</VAR> <BR> This is the create method for InFiles, where theName is, of course the name of the file to open.<P></P></DIV></LI><LI><DIVCLASS="FUNCSYNOPSIS"><ANAME="SWARM.SIMTOOLS.INFILE.METHOD.PC.M49"></A><P></P>+ <BCLASS="FUNCPROTOTYPE">create:</B> (id <Zone>)<VARCLASS="PDPARAM">aZone</VAR> <BCLASS="FUNCPROTOTYPE">withName:</B> (const char *)<VARCLASS="PDPARAM">theName</VAR> <BR> for backward compatibility<P></P></DIV></LI></UL></DIV><DIVCLASS="REFSECT2"><ANAME="AEN15779"></A><H3>Phase: Using</H3><P></P><UL><LI><DIVCLASS="FUNCSYNOPSIS"><ANAME="SWARM.SIMTOOLS.INFILE.METHOD.PU.M531"></A><P></P>- (int)<BCLASS="FUNCPROTOTYPE">getWord:</B> (char *)<VARCLASS="PDPARAM">aWord</VAR> <BR> The getWord: method returns a string that does not contain spaces, tabs, and newlines.<P></P></DIV></LI><LI><DIVCLASS="FUNCSYNOPSIS"><ANAME="SWARM.SIMTOOLS.INFILE.METHOD.PU.M412"></A><P></P>- (int)<BCLASS="FUNCPROTOTYPE">getLine:</B> (char *)<VARCLASS="PDPARAM">aLine</VAR> <BR> The getLine: method loads the argument string with the characters up to, but not including a newline character.<P></P></DIV></LI><LI><DIVCLASS="FUNCSYNOPSIS"><ANAME="SWARM.SIMTOOLS.INFILE.METHOD.PU.M398"></A><P></P>- (int)<BCLASS="FUNCPROTOTYPE">getInt:</B> (int *)<VARCLASS="PDPARAM">anInt</VAR> <BR> The getInt: method takes a pointer of type Int and loads it with an instance of that type from the open file. In case of failure, the method returns 0.<P></P></DIV></LI><LI><DIVCLASS="FUNCSYNOPSIS"><ANAME="SWARM.SIMTOOLS.INFILE.METHOD.PU.M512"></A><P></P>- (int)<BCLASS="FUNCPROTOTYPE">getUnsigned:</B> (unsigned *)<VARCLASS="PDPARAM">anUnsigned</VAR> <BR> The getUnsigned: method takes a pointer of type unsigned and loads it with an instance of that type from the open file. In case of failure, the method returns 0.<P></P></DIV></LI><LI><DIVCLASS="FUNCSYNOPSIS"><ANAME="SWARM.SIMTOOLS.INFILE.METHOD.PU.M414"></A><P></P>- (int)<BCLASS="FUNCPROTOTYPE">getLong:</B> (long *)<VARCLASS="PDPARAM">aLong</VAR> <BR> The getLong: method takes a pointer of type long and loads it with an instance of that type from the open file. In case of failure, the method returns 0.<P></P></DIV></LI><LI><DIVCLASS="FUNCSYNOPSIS"><ANAME="SWARM.SIMTOOLS.INFILE.METHOD.PU.M513"></A><P></P>- (int)<BCLASS="FUNCPROTOTYPE">getUnsignedLong:</B> (unsigned long *)<VARCLASS="PDPARAM">anUnsLong</VAR> <BR> The getUnsignedLong: method takes a pointer of type unsigned long and loads it with an instance of that type from the open file. In case of failure, the method returns 0.<P></P></DIV></LI><LI><DIVCLASS="FUNCSYNOPSIS"><ANAME="SWARM.SIMTOOLS.INFILE.METHOD.PU.M369"></A><P></P>- (int)<BCLASS="FUNCPROTOTYPE">getDouble:</B> (double *)<VARCLASS="PDPARAM">aDouble</VAR> <BR> The getDouble: method takes a pointer of type double and loads it with an instance of that type from the open file. In case of failure, the method returns 0.<P></P></DIV></LI><LI><DIVCLASS="FUNCSYNOPSIS"><ANAME="SWARM.SIMTOOLS.INFILE.METHOD.PU.M385"></A><P></P>- (int)<BCLASS="FUNCPROTOTYPE">getFloat:</B> (float *)<VARCLASS="PDPARAM">aFloat</VAR> <BR> The getFloat: method takes a pointer of type float and loads it with an instance of that type from the open file. In case of failure, the method returns 0.<P></P></DIV></LI><LI><DIVCLASS="FUNCSYNOPSIS"><ANAME="SWARM.SIMTOOLS.INFILE.METHOD.PU.M333"></A><P></P>- (int)<BCLASS="FUNCPROTOTYPE">getChar:</B> (char *)<VARCLASS="PDPARAM">aChar</VAR> <BR> The getChar: method takes a pointer of type char and loads it with an instance of that type from the open file. In case of failure, the method returns 0.<P></P></DIV></LI><LI><DIVCLASS="FUNCSYNOPSIS"><ANAME="SWARM.SIMTOOLS.INFILE.METHOD.PU.M931"></A><P></P>- (int)<BCLASS="FUNCPROTOTYPE">unGetChar:</B> (char)<VARCLASS="PDPARAM">aChar</VAR> <BR> Returns a character for re-reading.<P></P></DIV></LI><LI><DIVCLASS="FUNCSYNOPSIS"><ANAME="SWARM.SIMTOOLS.INFILE.METHOD.PU.M917"></A><P></P>- (int)<BCLASS="FUNCPROTOTYPE">skipLine</B><BR> Skips a line.<P></P></DIV></LI><LI><DIVCLASS="FUNCSYNOPSIS"><ANAME="SWARM.SIMTOOLS.INFILE.METHOD.PU.M264"></A><P></P>- (void)<BCLASS="FUNCPROTOTYPE">drop</B><BR> The drop method must be called when the user wants to close the file. Only by dropping the InFile object will the file truly be closed.<P></P></DIV></LI></UL></DIV></DIV><DIVCLASS="NAVFOOTER"><HRALIGN="LEFT"WIDTH="100%"><TABLEWIDTH="100%"BORDER="0"CELLPADDING="0"CELLSPACING="0"><TR><TDWIDTH="33%"ALIGN="left"VALIGN="top"><AHREF="swarm.simtools.appendfile.protocol.html">Prev</A></TD><TDWIDTH="34%"ALIGN="center"VALIGN="top"><AHREF="set.html">Home</A></TD><TDWIDTH="33%"ALIGN="right"VALIGN="top"><AHREF="swarm.simtools.nselect.protocol.html">Next</A></TD></TR><TR><TDWIDTH="33%"ALIGN="left"VALIGN="top">AppendFile [Deprecated]</TD><TDWIDTH="34%"ALIGN="center"VALIGN="top"><AHREF="swarm.simtools.sgml.reference.html">Up</A></TD><TDWIDTH="33%"ALIGN="right"VALIGN="top">NSelect</TD></TR></TABLE></DIV></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -