INDEX CLUSTER FEATURES SHORT FRAMES NO FRAMES

indexing

title: "To support simple I/O facilities"
project: "Visual Eiffel Library"
revision: "$Revision: 1.1 $"
copyright: "Copyright (C) 1996-2005 Object Tools Group"
license: "http://visual-eiffel.com/license"
cluster: pool
class BASIC_IO
feature -- Status report

last_string: STRING

last_int: INTEGER

last_real: REAL

last_double: DOUBLE

last_bool: BOOLEAN

last_char: CHARACTER
feature -- Status report (STD_FILES compatibility)

last_character: CHARACTER
-- Last character read by 'read_character'

last_integer: INTEGER
-- Last integer read by 'read_integer'
feature -- Input

get_string, read_line
-- Read a string from the standard
-- input and assign it to 'last_string'.
-- NOTE: Every call will allocate a
-- new string

get_newline, to_next_line
-- Consume input until newline is found,
-- then consume newline character

get_int, read_integer
-- Read an integer from the standard
-- input and assign it to 'last_int'
ensure
integer_input:

get_real, read_real
-- Read a real from the standard
-- input and assign it to 'last_real'
ensure
real_input:

get_double, read_double
-- Read a double from the standard
-- input and assign it to 'last_double'
ensure
double_input:

get_bool, read_boolean
-- Read a boolean from the standard
-- input and assign it to 'last_bool'
ensure
boolean_input:

get_char, read_character
-- Read a character from the standard
-- input and assign it to 'last_char'.
-- NOTE: Empty input is interpreted as '%N'
feature -- Output

put_string (s: STRING)
-- Output 's' to current output device
require
non_void_string: s /= void

put_int, put_integer (i: INTEGER)
-- Output 'i' to current output device

put_real (r: REAL)
-- Output 'r' to current output device

put_double (d: DOUBLE)
-- Output 'd' to current output device

put_bool, put_boolean (b: BOOLEAN)
-- Output 'b' to current output device.
-- NOTE: Prints 'True' or 'False'

put_char, put_character (c: CHARACTER)
-- Output 'c' to current output device

put_newline, put_new_line
-- Output newline character

flush
-- Flush buffered data (if any).
feature -- Access

attach_output_file (fhandle: FILE)
require
non_void_file: fhandle /= void
is_open_write: fhandle.is_open_write

attach_input_file (fhandle: FILE)
require
non_void_file: fhandle /= void
is_open_read: fhandle.is_open_read

set_standard_output
-- Use the standard output device from now on

set_file_output

set_error_output
-- Use the error output device from now on

set_standard_input

set_file_input
-- Use the user input device from now on

set_echo_off

set_echo_on
end -- class BASIC_IO

INDEX CLUSTER FEATURES SHORT FRAMES NO FRAMES