This class is 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.
+ create:aZonewithName: (const char *)theName This is the create method for InFiles, where theName is, of course the name of the file to open.
Phase: Using
- (int)getWord: (char *)aWord The getWord: method returns a string that does not contain spaces, tabs, and newlines.
- (int)getLine: (char *)aLine The getLine: method loads the argument string with the characters up to, but not including a newline character.
- (int)getInt: (int *)anInt 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.
- (int)getUnsigned: (unsigned *)anUnsigned 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.
- (int)getLong: (long *)aLong 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.
- (int)getUnsignedLong: (unsigned long *)anUnsLong 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.
- (int)getDouble: (double *)aDouble 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.
- (int)getFloat: (float *)aFloat 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.
- (int)getChar: (char *)aChar 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.
- (int)unGetChar: (char)aChar Returns a character for re-reading.
- (int)skipLine Skips a line.
- (void)drop 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.