#include <IsOs.h>
Inheritance diagram for Is_base::

Public Methods | |
| Is_base (Format_type format=ASCII) | |
| virtual | ~Is_base () |
| virtual bool | ok () const |
| void | setFormat (Format_type format=ASCII) |
| void | resetFormat () |
| Format_type | getFormat () |
| virtual bool | get (char *word) |
| virtual bool | get (String &word) |
| virtual bool | get (float &a) |
| virtual bool | get (double &a) |
| virtual bool | get (int &i) |
| virtual bool | get (long int &i) |
| virtual bool | get (char &c) |
| virtual bool | get (char *data, int item_size, int nitems) |
| real | getReal () |
| int | getInt () |
| virtual void | putback (char c) |
| virtual bool | eof () |
| virtual void | return2start () |
| virtual long int | getPosition () |
| virtual void | setPosition (long int filepos) |
| virtual void | ignore (char end) |
| virtual void | getline (String &word, char end) |
| virtual void | getline (char *s, int length, char end) |
| void | getline (char end) |
| const char* | getBuffer () |
| virtual void | eat (const char *chars) |
| void | getCommand (String &value, char eqmark='=', char endmark='') |
Protected Attributes | |
| Format_type | format |
| Format_type | last_format |
| bool | command_warnings |
| char | buffer [buffer_length] |
NAME: Is_base - base class for generalized input, used by class Is
DESCRIPTION:
The class is handled by class "Is" (see class "Is" for the purpose of generalized input). Class "Is_base" serves as base class for various input sources such as istream, ifstream and strings. The class defines a general interface for input handling. Note that "Is_base" is always used through an "Is" instance.
|
|
The constructor takes a format argument, indicating whether the input source has binary or ascii format. The default value is "ASCII". No further initialization is necessary. The format state can be reset using the member function "setFormat". Again, recall that a programmer never uses "Is_base", its construction and initialization is always performed by class "Is". |
|
|
|
|
|
eats all characters appearing in the string argument. In comparison with "ignore", "eat" eats the characters only if they are equal to one of the characters in the argument string, while "ignore" eats any character up to the one given as argument. For example, "eat" can eat all white spaces, tabs and newlines, whereas "ignore" can eat everything up to and including the first character, e.g., white space. Reimplemented in Is_istream, Is_String, and Is_xdr. |
|
|
returns true if EOF is reached, false otherwise. Reimplemented in Is_istream, Is_String, and Is_xdr. |
|
|
See documentation of one of the overloaded functions. Reimplemented in Is_istream, Is_ifstream, Is_String, and Is_xdr. |
|
|
See documentation of one of the overloaded functions. Reimplemented in Is_istream, Is_ifstream, Is_String, and Is_xdr. |
|
|
See documentation of one of the overloaded functions. Reimplemented in Is_istream, Is_ifstream, Is_String, and Is_xdr. |
|
|
See documentation of one of the overloaded functions. Reimplemented in Is_istream, Is_ifstream, Is_String, and Is_xdr. |
|
|
See documentation of one of the overloaded functions. Reimplemented in Is_istream, Is_ifstream, Is_String, and Is_xdr. |
|
|
See documentation of one of the overloaded functions. Reimplemented in Is_istream, Is_ifstream, Is_String, and Is_xdr. |
|
|
See documentation of one of the overloaded functions. Reimplemented in Is_istream, Is_ifstream, Is_String, and Is_xdr. |
|
|
gets a "char*" (string), "String", "float", "double", "int" or "char" from the input source. There are several overloaded versions. Reimplemented in Is_istream, Is_ifstream, Is_String, and Is_xdr. |
|
|
returns a pointer to the internal character buffer "buffer" in "Is_base". May be used in conjunction with "getline". |
|
|
function for convenient reading of a command and its value, e.g. some-command = some-value. |
|
|
returns the format type. The return value is an "enum" "Format_type". |
|
|
See documentation of one of the overloaded functions. |
|
|
returns the position in a random access file. Reimplemented in Is_istream, Is_String, and Is_xdr. |
|
|
See documentation of one of the overloaded functions. |
|
|
See documentation of one of the overloaded functions. Reimplemented in Is_istream, Is_String, and Is_xdr. |
|
|
See documentation of one of the overloaded functions. Reimplemented in Is_istream, Is_String, and Is_xdr. |
|
|
gets a sequence of characters from the input source. Same as "ignore", but the characters are accessable in terms of a return "String" or (for an overloaded version) in terms of an internal "Is_base" character array named "buffer". For a programmer, the "getline(String&,char)" function is the version of "getline" that is most convenient. However, if one reads a long file and calls this version of "getline", recall that a "String" is allocated for every line. Use of the fixed-size internal buffer is more efficient. Reimplemented in Is_istream, Is_String, and Is_xdr. |
|
|
eat all characters up to and including the one given as argument. Reimplemented in Is_istream, Is_String, and Is_xdr. |
|
|
Reimplemented in Is_istream, Is_ifstream, Is_String, and Is_xdr. |
|
|
puts the character back to the input source. "get" and "putback" enables a sort of "peek" functionality (cf. class "istream"). Reimplemented in Is_istream, Is_String, and Is_xdr. |
|
|
resets the format type to the value prior to last call to "setFormat". Note that the effect of the following code segment:
os.setFormat(ASCII);
someFunc(os);
os.resetFormtat();
void someFunc(Os os)
{
os.setFormat(BINARY)
...
os.resetFormat();
}
Here, "os" will be in "BINARY" mode after the call to "someFunc", regardless of its value before the first call to "setFormat(ASCII)". |
|
|
sets the input source in the start position. This functionality is only possible with a string source or a random access file source. Reimplemented in Is_istream, Is_String, and Is_xdr. |
|
|
sets the format type to "ASCII" or "BINARY". |
|
|
sets the position in a random access file. Reimplemented in Is_istream, Is_String, and Is_xdr. |
|
|
|
|
|
|
|
|
|
|
|
|