+
Point of view
All features
deferred class FILE_STREAM
Summary
Common parent class to all the file-related streams. Provides a common connection interface to the "real" files of the operating system.
Direct parents
Inherit list: STREAM
Known children
Inherit list: BINARY_FILE_READ, BINARY_FILE_WRITE, TEXT_FILE_READ, TEXT_FILE_READ_WRITE, TEXT_FILE_WRITE
Class invariant
Overview
Features
{ANY}
{}
{ANY}
{}
{STREAM_HANDLER}
{FILTER}
{ANY}
{}
{RECYCLING_POOL}
  • recycle
    Do whatever needs to be done to free resources or recycle other objects when recycling this one
{}
  • dispose
    Action to be executed just before garbage collection reclaims an object.
{}
path: STRING
writable attribute
{ANY}
Not Void when connected to the corresponding file on the disk.
is_connected: BOOLEAN
effective function
{ANY}
Is this file connected to some file of the operating system?
ensure
  • definition: Result = path /= Void
connect_to (new_path: ABSTRACT_STRING)
deferred procedure
{ANY}
Try to connect to an existing file of the operating system.
require ensure
set_path (new_path: ABSTRACT_STRING)
effective procedure
{}
ensure
  • path.same_as(new_path.out)
disconnect
deferred procedure
{ANY}
Try to disconnect the stream.
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.
require
descriptor: INTEGER_32
effective function
{ANY}
Some OS-dependent descriptor.
Mainly used by the sequencer library (see READY_CONDITION).
require
has_descriptor: BOOLEAN
effective function
{ANY}
True if that stream can be associated to some OS-meaningful descriptor.
require
can_disconnect: BOOLEAN
deferred function
{ANY}
True if the stream can be safely disconnected (without data loss, etc.)
require
url: URL
frozen
effective function
{ANY}
The URL to this stream as resource
ensure
  • not_void: Result /= Void
  • always_the_same: Result = url
url_memory: URL
writable attribute
{}
new_url: URL
deferred function
{}
ensure
  • Result /= Void
stream_pointer: POINTER
effective function
Some Back-end-dependent pointer (FILE* in C, InputStream or OutputStream in Java)
has_stream_pointer: BOOLEAN
effective function
True if that stream can be associated to some Back-end-meaningful stream pointer.
require
filtered_descriptor: INTEGER_32
deferred function
Find the descriptor of the terminal stream...
Filters do not have descriptors of their own
require
filtered_has_descriptor: BOOLEAN
deferred function
True if the underlying terminal stream has a descriptor
require
filtered_stream_pointer: POINTER
deferred function
Find the pointer of the terminal stream...
Filters do not have pointers of their own
require
filtered_has_stream_pointer: BOOLEAN
deferred function
True if the underlying terminal stream has a pointer
require
event_exception: EVENT_DESCRIPTOR
effective function
{ANY}
stream_exception: STREAM_EXCEPTION
writable attribute
{}
recycle
effective procedure
Do whatever needs to be done to free resources or recycle other objects when recycling this one
dispose
effective procedure
{}
Action to be executed just before garbage collection reclaims an object.
sequencer_descriptor (file: POINTER): INTEGER_32
{}