GNU
|
Liberty Eiffel
|
Automated Tests
|
Wiki
|
Savannah project
|
Debian packages
|
Documentation
>
libraries
>
STREAM_PROTOCOL
+
Point of view
TYPED_INTERNALS
ANY
INTERNALS_HANDLER
TYPED_INTERNALS
RECYCLING_POOL
URL_VALIDITY
URL
All features
class STREAM_PROTOCOL
Summary
top
A protocol used for internal purposes: implementation of
STREAM
.url
Direct parents
Inherit list:
PROTOCOL
Class invariant
top
stream
/= Void
instream
/= Void implies
instream
=
stream
outstream
/= Void implies
outstream
=
stream
error /= Void implies not is_connected
Overview
top
Creation features
make
(a_stream:
STREAM
)
Exported features
name
:
FIXED_STRING
is_connected
:
BOOLEAN
error
:
STRING
valid_uri
(a_uri:
STRING
):
BOOLEAN
connect_to
(url:
URL
, read:
BOOLEAN
, write:
BOOLEAN
)
disconnect
input
:
INPUT_STREAM
output
:
OUTPUT_STREAM
locator
(a_uri:
STRING
):
RESOURCE_LOCATOR
PROTOCOL
is a factory of
RESOURCE_LOCATOR
recycle_locator
(a_locator:
RESOURCE_LOCATOR
)
make
(a_stream:
STREAM
)
stream
:
STREAM
instream
:
INPUT_STREAM
outstream
:
OUTPUT_STREAM
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.
name
:
FIXED_STRING
effective function
top
is_connected
:
BOOLEAN
effective function
top
error
:
STRING
effective function
top
valid_uri
(a_uri:
STRING
):
BOOLEAN
effective function
top
connect_to
(url:
URL
, read:
BOOLEAN
, write:
BOOLEAN
)
effective procedure
top
require
(
True
) or else (
url.uri /= Void
not is_connected
read or write
)
disconnect
effective procedure
top
require
is_connected
ensure
not is_connected
input
:
INPUT_STREAM
effective function
top
require
is_connected
output
:
OUTPUT_STREAM
effective function
top
require
is_connected
locator
(a_uri:
STRING
):
RESOURCE_LOCATOR
effective function
top
PROTOCOL
is a factory of
RESOURCE_LOCATOR
require
valid_uri(a_uri)
ensure
Result.uri.is_equal(a_uri)
recycle_locator
(a_locator:
RESOURCE_LOCATOR
)
effective procedure
top
require
a_locator /= Void
make
(a_stream:
STREAM
)
effective procedure
top
require
a_stream /= Void
stream
:
STREAM
writable attribute
top
instream
:
INPUT_STREAM
writable attribute
top
outstream
:
OUTPUT_STREAM
writable attribute
top
recycle
effective procedure
top
Do whatever needs to be done to free resources or recycle other objects when recycling this one
dispose
effective procedure
top
Action to be executed just before garbage collection reclaims an object.