class STD_INPUT
Summary
Overview
creation features
features
  • redirect_from (file_name: STRING)
    Redirect standard input to come from file_name instead of the default standard input.
  • restore_default_input
    Restore standard input to come from the default standard input.
  • recycle
    Do whatever needs to be done to free resources or recycle other objects when recycling this one
Skipping separators:
To read one number at a time:
To read one line or one word at a time:
  • last_string: STRING
    Access to the unique common buffer to get for example the result computed by read_line, read_word, newline, etc.
  • read_line
    Read a complete line ended by '%N' or end_of_input.%
  • read_available (limit: INTEGER_32)
    Read as many characters as possible, as long as the stream does not block and up to the given limit.
  • read_word
    Read a word using is_separator of class CHARACTER.
  • newline
    Consume input until newline ('%N') is found.
  • reach_and_skip (keyword: STRING)
    Try to skip enough characters in order to reach the keyword which is skipped too.
Other features:
is_connected: BOOLEAN
attribute
True if the stream is connected.
end_of_input: BOOLEAN
attribute
end_of_input means the previous attempt in character reading failed because the end has been reached.
disconnect
Try to disconnect the stream.
make
can_unread_character: BOOLEAN
filtered_read_character
filtered_unread_character
filtered_last_character: CHARACTER
attribute
filtered_read_line_in (str: STRING)
attribute
end_reached: BOOLEAN
attribute
buffer_position: INTEGER_32
attribute
buffer_size: INTEGER_32
attribute
capacity: INTEGER_32
attribute
unread_character_flag: BOOLEAN
attribute
fill_buffer
filtered_descriptor: INTEGER_32
Find the descriptor of the terminal stream...
filtered_has_descriptor: BOOLEAN
attribute
True if the underlying terminal stream has a descriptor
filtered_stream_pointer: POINTER
Find the pointer of the terminal stream...
filtered_has_stream_pointer: BOOLEAN
attribute
True if the underlying terminal stream has a pointer
redirect_from (file_name: STRING)
Redirect standard input to come from file_name instead of the default standard input.
restore_default_input
Restore standard input to come from the default standard input.
flush
Discard any characters remaining in the input buffer
read_stdin (buf: NATIVE_ARRAY[CHARACTER], size: INTEGER_32): INTEGER_32
return size read or 0 if end of input (-1 on error => exception ?)
stdin: POINTER
can_read_character: BOOLEAN
attribute
Note that this state is usually temporary.
can_read_line: BOOLEAN
attribute
valid_last_character: BOOLEAN
attribute
can_disconnect: BOOLEAN
attribute
True if the stream can be safely disconnected (without data loss, etc.)
read_character
If read_character fail, end_of_input is set.
read_line_in (buffer: STRING)
Same job as read_line but storage is directly done in buffer.
read_available_in (buffer: STRING, limit: INTEGER_32)
Same job as read_available but storage is directly done in buffer.
unread_character
last_character: CHARACTER
detach
Shake off the filter.
filtered_read_available_in (buffer: STRING, limit: INTEGER_32)
attribute
The filter that uses this stream as backend
event_can_read: EVENT_DESCRIPTOR
attribute
descriptor: INTEGER_32
Some OS-dependent descriptor.
has_descriptor: BOOLEAN
True if that stream can be associated to some OS-meaningful descriptor.
stream_pointer: POINTER
Some Back-end-dependent pointer (FILE* in C, InputStream or OutputStream in Java)
has_stream_pointer: BOOLEAN
True if that stream can be associated to some Back-end-meaningful stream pointer.
recycle
Do whatever needs to be done to free resources or recycle other objects when recycling this one
sequencer_descriptor (file: POINTER): INTEGER_32
is_filtered: BOOLEAN
deferred
skip_separators
Skip all separators (see is_separator of class CHARACTER) and make the first non-separator available in last_character.
skip_separators_using (separators: STRING)
Same job as skip_separators using the separators set.
skip_remainder_of_line
Skip all the remainder of the line including the end of line delimiter itself.
read_integer
Read an integer according to the Eiffel syntax.
last_integer: INTEGER_32
attribute
Last integer read using read_integer.
valid_last_integer: BOOLEAN
attribute
Was the last call to read_integer successful ?
last_real: REAL_64
attribute
Last real read with read_real.
valid_last_real: BOOLEAN
attribute
Was the last call to read_real successful ?
read_real
Read a REAL and make the result available in last_real.
last_string: STRING
once
Access to the unique common buffer to get for example the result computed by read_line, read_word, newline, etc.
read_line
Read a complete line ended by '%N' or end_of_input.%
read_available (limit: INTEGER_32)
Read as many characters as possible, as long as the stream does not block and up to the given limit.
read_word
Read a word using is_separator of class CHARACTER.
newline
Consume input until newline ('%N') is found.
reach_and_skip (keyword: STRING)
Try to skip enough characters in order to reach the keyword which is skipped too.
read_word_using (separators: STRING)
Same job as read_word using separators.
read_tail_in (str: STRING)
Read all remaining character of the stream in str.
io_getc (stream: POINTER): INTEGER_32
io_fread (buf: NATIVE_ARRAY[CHARACTER], size: INTEGER_32, stream: POINTER): INTEGER_32
return size read or 0 if end of input (-1 on error => exception ?)
set_filter (a_filter: FILTER)
Used by the filter itself to get attached
redirection_succeeded: BOOLEAN
attribute
Did the last call to redirect succeed?
restore_default
Cancel redirection
redirect (file_descriptor: INTEGER_32)
Redirect to/from file_descriptor
save_default_descriptor
Always call this before calling dup2(..., filtered_descriptor)
default_descriptor: INTEGER_32
attribute
A descriptor that referes to the same file as stdin initially does.
dup (descriptor_: INTEGER_32): INTEGER_32
Return a new descriptor that refers to the same file as descriptor_.
dup2 (descriptor_1: INTEGER_32, descriptor_2: INTEGER_32)
Make descriptor_2 point to the same file as descriptor_1.
open_descriptor_for_read (file_name: POINTER): INTEGER_32
Open file_name for reading, returning a descriptor to it.
open_descriptor_for_create (file_name: POINTER): INTEGER_32
Open file_name for writing, returning a descriptor to it.
open_descriptor_for_append (file_name: POINTER): INTEGER_32
Open file_name for writing, returning a descriptor to it.
open_descriptor_succeeded (descriptor_: INTEGER_32): BOOLEAN
Did open returning descriptor_ succeed ?
close_descriptor (descriptor_: INTEGER_32)
Close descriptor_, freeing it for later use.