end_of_input means the previous attempt in character reading failed because the end has been
reached.
So last_character is not valid and you are not allowed to do any read attempt
anymore.
Notes:
Just after a successful connect, end_of_input is always False because you did not yet read
anything).
Once the end of input has been reached, this is definitive in that no more characters will ever
be provided (but of course you can still come back if can_unread_character; end_of_input
will be changed if you unread_character). In that, it is different from can_read_character
which is only a temporary state.
Please refer to the Liberty Eiffel FAQ or tutorial/io examples.
Note that it *does not* ensure that the stream will effectively be
disconnected (some terminal streams, for instance, are always connected) but the feature can be
used to "shake off" filters.
Usually it is called until either it becomes True or
the stream is disconnected:
from
until
stream.can_read_character or else not stream.is_connected
loop
-- some "still waiting..." code, maybe a sandglass?
end
if stream.is_connected then
stream.read_character
end
Skip all separators (see is_separator of class CHARACTER) and make the first non-separator
available in last_character.
This non-separator character is pushed back into the stream (see
unread_character) to be available one more time (the next read_character will consider this
non-separator). When end_of_input occurs, this process is automatically stopped.
Make result available in last_integer. Heading
separators are automatically skipped using is_separator of class CHARACTER. Trailing separators
are not skipped.
Read a complete line ended by '%N' or end_of_input.%
% Make the result available in last_string
common buffer. The end of line character (usually '%N') is not added in the last_string buffer.
Read tutorial or io cluster documentation to learn the read_line usage pattern.
Read a word using is_separator of class CHARACTER.
The result is available in the last_string
common buffer. Heading separators are automatically skipped. Trailing separators are not skipped
(last_character is left on the first one). If end_of_input is encountered, Result can be the
empty string.
This exception occurs when Void is passed as the expression
to inspect ("inspect on STRING only).
This exception also occurs when the inspected value selects no branch (when the keyword "else"
not used, one "when" branch _must_ be selected). Some value which is not one of the inspect
constants, if there is no Else_part
_