Table of Contents
Previous Chapter
- indexing
- description: "Files viewed as persistent sequences of characters"
- class interface
- creation
- -- Create file object with fn as file name.
- string_exists: fn /= Void;
- string_not_empty: not fn.empty
- file_named: name.is_equal (fn);
- file_closed: is_closed
- make_create_read_write (fn: STRING)
- -- Create file object with fn as file name
- -- and open file for both reading and writing;
- -- create it if it does not exist.
- string_exists: fn /= Void;
- string_not_empty: not fn.empty
- exists: exists;
- open_read: is_open_read;
- open_write: is_open_write
- make_open_append (fn: STRING)
- -- Create file object with fn as file name
- -- and open file in append--only mode.
- string_exists: fn /= Void;
- string_not_empty: not fn.empty
- exists: exists;
- open_append: is_open_append
- make_open_read (fn: STRING)
- -- Create file object with fn as file name
- -- and open file in read mode.
- string_exists: fn /= Void;
- string_not_empty: not fn.empty
- exists: exists;
- open_read: is_open_read
- make_open_read_write (fn: STRING)
- -- Create file object with fn as file name
- -- and open file for both reading and writing.
- string_exists: fn /= Void;
- string_not_empty: not fn.empty
- exists: exists;
- open_read: is_open_read;
- open_write: is_open_write
- make_open_write (fn: STRING)
- -- Create file object with fn as file name
- -- and open file for writing;
- -- create it if it does not exist.
- string_exists: fn /= Void;
- string_not_empty: not fn.empty
- exists: exists;
- open_write: is_open_write
- feature -- Access
- -- File name
- feature -- Measurement
- -- Size in bytes (0 if no associated physical file)
- feature -- Status report
- -- Is structure empty?
- -- Has an EOF been detected?
- opened: not is_closed
- -- Does physical file exist?
- -- Is file closed?
- -- Is file open for reading?
- -- Is file open for writing?
- -- Is file reserved for text (character sequences)?
- -- Is file readable?
- handle_exists: exists
- -- Is file writable?
- handle_exists: exists
- last_character: CHARACTER
- -- Last character read by read_character
- -- Last double read by read_double
- -- Last integer read by read_integer
- -- Last real read by read_real
- -- Last string read by read_line,
-- read_stream, or read_word
- feature -- Status setting
- -- Close file.
- medium_is_open: not is_closed
- is_closed: is_closed
- -- Open file in read--only mode.
- is_closed: is_closed
- exists: exists;
- open_read: is_open_read
- -- Open file in read and write--at-end mode;
- -- create it if it does not exist.
- is_closed: is_closed
- exists: exists;
- open_read: is_open_read;
- open_append: is_open_append
- -- Open file in read and write mode.
- is_closed: is_closed
- exists: exists;
- open_read: is_open_read;
- open_write: is_open_write
- -- Open file in write--only mode;
- -- create it if it does not exist.
- exists: exists;
- open_write: is_open_write
- feature -- Cursor movement
- -- Move to next input line.
- readable: is_readable
- feature -- Element change
- change_name (new_name: STRING)
- -- Change file name to new_name
- not_new_name_void: new_name /= Void;
- file_exists: exists
- name_changed: name.is_equal (new_name)
- feature -- Removal
- -- Remove link with physical file; delete physical
- -- file if no more link.
- exists: exists
- -- Ensure this medium is closed when garbage-collected.
- feature -- Input
- -- Read a new character.
- -- Make result available in last_character.
- readable: is_readable
- -- Read the ASCII representation of a new double
- -- from file. Make result available in last_double.
- readable: is_readable
- -- Read the ASCII representation of a new integer
- -- from file. Make result available in last_integer.
- readable: is_readable
- -- Read a string until new line or end of file.
- -- Make result available in laststring.
- -- New line will be consumed but not part of last_string.
- readable: is_readable
- -- Read the ASCII representation of a new real
- -- from file. Make result available in last_real.
- readable: is_readable
- read_stream (nb_char: INTEGER)
- -- Read a string of at most nb_char bound characters
- -- or until end of file.
- -- Make result available in last_string.
- readable: is_readable
- -- Read a new word from standard input.
- -- Make result available in last_string.
- feature -- Output
- -- Write ASCII value of b at current position.
- extendible: extendible
- put_character (c: CHARACTER)
- -- Write c at current position.
- extendible: extendible
- -- Write ASCII value of d at current position.
- extendible: extendible
- -- Write ASCII value of i at current position.
- extendible: extendible
- -- Write ASCII value of r at current position.
- extendible: extendible
- -- Write s at current position.
- extendible: extendible
- invariant
- name_exists: name /= Void;
- name_not_empty: not name.empty;
- writable_if_extendible: extendible implies is_writable
- end
Table of Contents
Next Chapter
|