![]() |
The Simons
|
#include <TextInput.h>
Inheritance diagram for TextInput:
TextInput is a kind of Input stream for reading data encoded in plain text format. It contrasts with ByteInput, the stream for reading data encoded in binary format. Text data is read by skipping any leading whitespace and decoding each type of value from its textual representation, placing the result in a variable. Any mismatch in the expected data format will raise an exception. All the simple types Boolean, Character, Natural, Integer and Decimal may be read. String objects and raw Character[] arrays may be read, preserving internal white space, up to a specified delimiter, which is the newline by default.
Public Member Functions | |
TextInput () | |
Construct a standard TextInput stream. | |
virtual | ~TextInput () |
Release an unused TextInput stream. | |
TextInput (StringID) | |
Construct a TextInput file stream. | |
virtual ObjectID | clone () const |
Clone a copy of this TextInput. | |
virtual InputID | get (Boolean &) |
Read in a Boolean value. | |
virtual InputID | get (Character &) |
Read in a Character value. | |
virtual InputID | get (Natural &) |
Read in a Natural value. | |
virtual InputID | get (Integer &) |
Read in an Integer value. | |
virtual InputID | get (Decimal &) |
Read in a Decimal value. | |
virtual InputID | get (StringID &, Character= '\n') |
Read in a String, up to a delimiter Character. | |
virtual InputID | get (Character[], Natural, Character= '\n') |
Read in a Character array, up to a delimiter Character. | |
virtual InputID | skip (Character= '\n') |
Skip input up to and including a delimiter Character. | |
Protected Member Functions | |
TextInput (const TextInput &) | |
Copy another TextInput stream. |
|
Copy another TextInput stream. Required by C++ to ensure that copying a TextInput faithfully copies an Input. Constructs a shallow copy of the other TextInput.
|
|
Construct a standard TextInput stream. Constructs a TextInput stream onto the standard input (the keyboard source). By default, the pathname is null and the filesystem is closed.
|
|
Release an unused TextInput stream. Performs all closing actions to disconnect from the underlying filesystem. |
|
Construct a TextInput file stream. Constructs a TextInput stream onto the named file.
|
|
Clone a copy of this TextInput. This is a shallow copy, which shares the file pathname, if any, but does not initialise any filesystem. Reimplemented from Object. |
|
Read in a Character array, up to a delimiter Character. The Character array must be exactly of the specified length. Attempts to read a sequence of Character values into the array argument, until length-1 values have been read or the delimiter Character is encountered. Leaves the delimiter on the Input stream. Sets the last Character to the terminating null byte. This method is abstract in Input.
Reimplemented from Input. |
|
Read in a String, up to a delimiter Character. Attempts to read a sequence of Character values into the String argument, until the delimiter Character is encountered. Leaves the delimiter on the Input stream. May throw a ReadFailure exception if reading fails.
Reimplemented from Input. |
|
Read in a Decimal value. Attempts to read the next value from this Input stream, skipping leading white space. The argument refers to a variable in which the value will be stored. May throw a ReadFailure exception if reading fails.
Reimplemented from Input. |
|
Read in an Integer value. Attempts to read the next value from this Input stream, skipping leading white space. The argument refers to a variable in which the value will be stored. May throw a ReadFailure exception if reading fails.
Reimplemented from Input. |
|
Read in a Natural value. Attempts to read the next value from this Input stream, skipping leading white space. The argument refers to a variable in which the value will be stored. May throw a ReadFailure exception if reading fails.
Reimplemented from Input. |
|
Read in a Character value. Attempts to read the next value from this Input stream, skipping leading white space. The argument refers to a variable in which the value will be stored. May throw a ReadFailure exception if reading fails.
Reimplemented from Input. |
|
Read in a Boolean value. Attempts to read the next value from this Input stream, skipping leading white space. The argument refers to a variable in which the value will be stored. May throw a ReadFailure exception if reading fails.
Reimplemented from Input. |
|
Skip input up to and including a delimiter Character. Skips all input up to and including the delimiter Character. Complements methods that read data up to, but not including, a delimiter.
Reimplemented from Input. |