GNU
|
Liberty Eiffel
|
Automated Tests
|
Wiki
|
Savannah project
|
Debian packages
|
Documentation
>
libraries
>
BASE64_OUTPUT_STREAM
+
Point of view
All features
ANY
RECYCLING_POOL
STREAM_HANDLER
FILTER
ABSTRACT_STRING
FILTER_OUTPUT_STREAM
STREAM
All features
class BASE64_OUTPUT_STREAM
Summary
top
A Base64 encoder. The underlying stream gets encoded in Base64 via this filter.
Direct parents
Inherit list:
FILTER_OUTPUT_STREAM
Class invariant
top
stream /= Void implies stream.filter = Current
Overview
top
Creation features
Features
{
ANY
}
disconnect
Disconnect from the underlying stream.
{}
local_can_disconnect
:
BOOLEAN
True if this stream can be safely disconnected (without data loss, etc.)
{
FILTER_OUTPUT_STREAM
}
filtered_put_character
(c:
CHARACTER
)
filtered_flush
{}
state
:
INTEGER_32
previous_character
:
CHARACTER
{}
alphabet
:
STRING
t2b
(code:
INTEGER_32
):
CHARACTER
{
ANY
}
can_put_character
(c:
CHARACTER
):
BOOLEAN
{
STREAM
}
do_detach
Used by the underlying stream to require not to be filtered anymore
{}
stream
:
OUTPUT_STREAM
The underlying stream (i.e. the filtered one)
{
ANY
}
put_character
(c:
CHARACTER
)
flush
Flushes the pipe.
detach
Shake off the filter.
{
FILTER
}
filter
:
FILTER_OUTPUT_STREAM
The filter that uses this stream as backend
{
ANY
}
event_can_write
:
EVENT_DESCRIPTOR
{}
can_write
:
CAN_WRITE_DATA_TO_STREAM
new_url
:
URL
as_output_stream
:
OUTPUT_STREAM
{
ANY
}
is_connected
:
BOOLEAN
True if the stream is connected.
descriptor
:
INTEGER_32
Some OS-dependent descriptor.
has_descriptor
:
BOOLEAN
True if that stream can be associated to some OS-meaningful descriptor.
can_disconnect
:
BOOLEAN
True if the stream can be safely disconnected (without data loss, etc.)
url
:
URL
The
URL
to this stream as resource
{}
url_memory
:
URL
{
STREAM_HANDLER
}
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.
{
FILTER
}
filtered_descriptor
:
INTEGER_32
Find the descriptor of the terminal stream...
filtered_has_descriptor
:
BOOLEAN
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
True if the underlying terminal stream has a pointer
{
ANY
}
event_exception
:
EVENT_DESCRIPTOR
{}
stream_exception
:
STREAM_EXCEPTION
{
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.
{}
sequencer_descriptor
(file:
POINTER
):
INTEGER_32
{
ANY
}
is_filtered
:
BOOLEAN
{
ABSTRACT_STRING
}
put_natively_stored_string
(s:
NATIVELY_STORED_STRING
)
put_abstract_string
(s:
ABSTRACT_STRING
)
{
ANY
}
put_string
(s:
ABSTRACT_STRING
)
Output
s
to current output device.
put_unicode_string
(unicode_string:
UNICODE_STRING
)
Output the UTF-8 encoding of the
unicode_string
.
put_line
(s:
ABSTRACT_STRING
)
Output the string followed by a
'%N'
.
To write a number:
{
ANY
}
put_integer
(i:
INTEGER_64
)
Output
i
to current output device.
put_integer_format
(i:
INTEGER_64
, s:
INTEGER_32
)
Output
i
to current output device using at most
s
character.
put_natural_8
(n:
NATURAL_8
)
Output
n
to current output device.
put_natural_8_format
(n:
NATURAL_8
, s:
INTEGER_32
)
Output
n
to current output device using at most
s
character.
put_natural_16
(n:
NATURAL_16
)
Output
n
to current output device.
put_natural_16_format
(n:
NATURAL_16
, s:
INTEGER_32
)
Output
n
to current output device using at most
s
character.
put_natural_32
(n:
NATURAL_32
)
Output
n
to current output device.
put_natural_32_format
(n:
NATURAL_32
, s:
INTEGER_32
)
Output
n
to current output device using at most
s
character.
put_natural_64
(n:
NATURAL_64
)
Output
n
to current output device.
put_natural_64_format
(n:
NATURAL_64
, s:
INTEGER_32
)
Output
n
to current output device using at most
s
character.
put_real
(r:
REAL_64
)
Output
r
to current output device.
put_real_format
(r:
REAL_64
, f:
INTEGER_32
)
Output
r
with only
f
digit for the fractional part.
put_real_scientific
(r:
REAL_64
, f:
INTEGER_32
)
Output
r
using the scientific notation with only
f
digit for the fractional part.
put_number
(number:
NUMBER
)
Output the
number
.
Other features:
{
ANY
}
put_boolean
(b:
BOOLEAN
)
Output
b
to current output device according to the Eiffel format.
put_pointer
(p:
POINTER
)
Output a viewable version of
p
.
put_new_line
Output a newline character.
put_spaces
(nb:
INTEGER_32
)
Output
nb
spaces character.
append_file
(file_name:
STRING
)
{}
tmp_file_read
:
TEXT_FILE_READ
tmp_string
:
STRING
{}
io_putc
(byte:
CHARACTER
, stream:
POINTER
)
io_fwrite
(buf:
NATIVE_ARRAY
[
CHARACTER
], size:
INTEGER_32
, stream:
POINTER
):
INTEGER_32
io_flush
(stream:
POINTER
)
{
FILTER
}
set_filter
(a_filter:
FILTER
)
Used by the filter itself to get attached
{
ANY
}
connect_to
(a_stream:
FILTERABLE
)
Connect the filter to some underlying stream.
disconnect
effective procedure
{
ANY
}
top
Disconnect from the underlying stream.
require
is_connected
can_disconnect
is_connected
can_disconnect
is_connected
can_disconnect
ensure
not is_connected
stream = Void
not is_filtered
local_can_disconnect
:
BOOLEAN
is True
constant attribute
{}
top
True if this stream can be safely disconnected (without data loss, etc.)
without taking into account the state of the underlying stream.
filtered_put_character
(c:
CHARACTER
)
effective procedure
{
FILTER_OUTPUT_STREAM
}
top
require
is_connected
can_put_character(c)
filtered_flush
effective procedure
{
FILTER_OUTPUT_STREAM
}
top
require
is_connected
state
:
INTEGER_32
writable attribute
{}
top
previous_character
:
CHARACTER
writable attribute
{}
top
alphabet
:
STRING
is "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
constant attribute
{}
top
t2b
(code:
INTEGER_32
):
CHARACTER
effective function
{}
top
require
code >= 0 and then code < 64
ensure
alphabet
.has(Result)
can_put_character
(c:
CHARACTER
):
BOOLEAN
effective function
{
ANY
}
top
do_detach
effective procedure
{
STREAM
}
top
Used by the underlying stream to require not to be filtered anymore
ensure
stream = Void
stream
:
OUTPUT_STREAM
writable attribute
{}
top
The underlying stream (i.e. the filtered one)
put_character
(c:
CHARACTER
)
effective procedure
{
ANY
}
top
require
is_connected
not is_filtered and then can_put_character(c)
flush
effective procedure
{
ANY
}
top
Flushes the pipe.
If
is_filtered
, calls the filter's
flush
instead.
require
is_connected
detach
effective procedure
{
ANY
}
top
Shake off the filter.
ensure
not is_filtered
filter
:
FILTER_OUTPUT_STREAM
writable attribute
{
FILTER
}
top
The filter that uses this stream as backend
event_can_write
:
EVENT_DESCRIPTOR
effective function
{
ANY
}
top
can_write
:
CAN_WRITE_DATA_TO_STREAM
writable attribute
{}
top
new_url
:
URL
effective function
{}
top
ensure
Result /= Void
as_output_stream
:
OUTPUT_STREAM
effective function
{}
top
ensure
yes_indeed_it_is_the_same_object:
Result.
to_pointer
= to_pointer
is_connected
:
BOOLEAN
deferred function
{
ANY
}
top
True if the stream is connected.
Only in that case can data be transferred via this stream.
descriptor
:
INTEGER_32
effective function
{
ANY
}
top
Some OS-dependent descriptor.
Mainly used by the sequencer library (see READY_CONDITION).
require
is_connected
has_descriptor
has_descriptor
:
BOOLEAN
effective function
{
ANY
}
top
True if that stream can be associated to some OS-meaningful descriptor.
require
is_connected
can_disconnect
:
BOOLEAN
deferred function
{
ANY
}
top
True if the stream can be safely disconnected (without data loss, etc.)
require
is_connected
url
:
URL
frozen
effective function
{
ANY
}
top
The
URL
to this stream as resource
ensure
not_void:
Result /= Void
always_the_same:
Result =
url
url_memory
:
URL
writable attribute
{}
top
stream_pointer
:
POINTER
effective function
{
STREAM_HANDLER
}
top
Some Back-end-dependent pointer (
FILE
* in C, InputStream or OutputStream in Java)
require
is_connected
has_stream_pointer
has_stream_pointer
:
BOOLEAN
effective function
{
STREAM_HANDLER
}
top
True if that stream can be associated to some Back-end-meaningful stream pointer.
require
is_connected
filtered_descriptor
:
INTEGER_32
deferred function
{
FILTER
}
top
Find the descriptor of the terminal stream...
Filters do not have descriptors of their own
require
is_connected
filtered_has_descriptor
filtered_has_descriptor
:
BOOLEAN
deferred function
{
FILTER
}
top
True if the underlying terminal stream has a descriptor
require
is_connected
filtered_stream_pointer
:
POINTER
deferred function
{
FILTER
}
top
Find the pointer of the terminal stream...
Filters do not have pointers of their own
require
is_connected
filtered_has_stream_pointer
filtered_has_stream_pointer
:
BOOLEAN
deferred function
{
FILTER
}
top
True if the underlying terminal stream has a pointer
require
is_connected
event_exception
:
EVENT_DESCRIPTOR
effective function
{
ANY
}
top
stream_exception
:
STREAM_EXCEPTION
writable attribute
{}
top
recycle
effective procedure
{
RECYCLING_POOL
}
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.
sequencer_descriptor
(file:
POINTER
):
INTEGER_32
{}
top
is_filtered
:
BOOLEAN
deferred function
{
ANY
}
top
put_natively_stored_string
(s:
NATIVELY_STORED_STRING
)
effective procedure
{
ABSTRACT_STRING
}
top
require
s /= Void
put_abstract_string
(s:
ABSTRACT_STRING
)
effective procedure
{
ABSTRACT_STRING
}
top
require
s /= Void
put_string
(s:
ABSTRACT_STRING
)
effective procedure
{
ANY
}
top
Output
s
to current output device.
require
is_connected
not
is_filtered
s /= Void
put_unicode_string
(unicode_string:
UNICODE_STRING
)
effective procedure
{
ANY
}
top
Output the UTF-8 encoding of the
unicode_string
.
require
is_connected
not
is_filtered
unicode_string /= Void
put_line
(s:
ABSTRACT_STRING
)
effective procedure
{
ANY
}
top
Output the string followed by a
'%N'
.
%
put_integer
(i:
INTEGER_64
)
frozen
effective procedure
{
ANY
}
top
Output
i
to current output device.
require
is_connected
not
is_filtered
put_integer_format
(i:
INTEGER_64
, s:
INTEGER_32
)
frozen
effective procedure
{
ANY
}
top
Output
i
to current output device using at most
s
character.
require
is_connected
not
is_filtered
put_natural_8
(n:
NATURAL_8
)
frozen
effective procedure
{
ANY
}
top
Output
n
to current output device.
require
is_connected
not
is_filtered
put_natural_8_format
(n:
NATURAL_8
, s:
INTEGER_32
)
frozen
effective procedure
{
ANY
}
top
Output
n
to current output device using at most
s
character.
require
is_connected
not
is_filtered
put_natural_16
(n:
NATURAL_16
)
frozen
effective procedure
{
ANY
}
top
Output
n
to current output device.
require
is_connected
not
is_filtered
put_natural_16_format
(n:
NATURAL_16
, s:
INTEGER_32
)
frozen
effective procedure
{
ANY
}
top
Output
n
to current output device using at most
s
character.
require
is_connected
not
is_filtered
put_natural_32
(n:
NATURAL_32
)
frozen
effective procedure
{
ANY
}
top
Output
n
to current output device.
require
is_connected
not
is_filtered
put_natural_32_format
(n:
NATURAL_32
, s:
INTEGER_32
)
frozen
effective procedure
{
ANY
}
top
Output
n
to current output device using at most
s
character.
require
is_connected
not
is_filtered
put_natural_64
(n:
NATURAL_64
)
frozen
effective procedure
{
ANY
}
top
Output
n
to current output device.
require
is_connected
not
is_filtered
put_natural_64_format
(n:
NATURAL_64
, s:
INTEGER_32
)
frozen
effective procedure
{
ANY
}
top
Output
n
to current output device using at most
s
character.
require
is_connected
not
is_filtered
put_real
(r:
REAL_64
)
effective procedure
{
ANY
}
top
Output
r
to current output device.
require
is_connected
not
is_filtered
put_real_format
(r:
REAL_64
, f:
INTEGER_32
)
effective procedure
{
ANY
}
top
Output
r
with only
f
digit for the fractional part.
Examples:
put_real(3.519,2) print
"3.51"
.
require
is_connected
not
is_filtered
f >= 0
put_real_scientific
(r:
REAL_64
, f:
INTEGER_32
)
effective procedure
{
ANY
}
top
Output
r
using the scientific notation with only
f
digit for the fractional part.
Examples:
put_real_scientific(3.519,2) print
"3.16e+00"
.
require
is_connected
not
is_filtered
f >= 0
put_number
(number:
NUMBER
)
effective procedure
{
ANY
}
top
Output the
number
.
require
is_connected
not
is_filtered
number /= Void
put_boolean
(b:
BOOLEAN
)
effective procedure
{
ANY
}
top
Output
b
to current output device according to the Eiffel format.
require
is_connected
not
is_filtered
put_pointer
(p:
POINTER
)
effective procedure
{
ANY
}
top
Output a viewable version of
p
.
require
is_connected
not
is_filtered
put_new_line
effective procedure
{
ANY
}
top
Output a newline character.
require
is_connected
not
is_filtered
put_spaces
(nb:
INTEGER_32
)
effective procedure
{
ANY
}
top
Output
nb
spaces character.
require
is_connected
not
is_filtered
nb >= 0
append_file
(file_name:
STRING
)
effective procedure
{
ANY
}
top
require
is_connected
not
is_filtered
(create {
FILE_TOOLS
}).is_readable(file_name)
tmp_file_read
:
TEXT_FILE_READ
once function
{}
top
tmp_string
:
STRING
once function
{}
top
io_putc
(byte:
CHARACTER
, stream:
POINTER
)
{}
top
io_fwrite
(buf:
NATIVE_ARRAY
[
CHARACTER
], size:
INTEGER_32
, stream:
POINTER
):
INTEGER_32
{}
top
io_flush
(stream:
POINTER
)
{}
top
set_filter
(a_filter:
FILTER
)
effective procedure
{
FILTER
}
top
Used by the filter itself to get attached
require
a_filter /= Void
ensure
filter
= a_filter
connect_to
(a_stream:
FILTERABLE
)
effective procedure
{
ANY
}
top
Connect the filter to some underlying stream.
require
not
is_connected
a_stream.is_connected
not a_stream.is_filtered
ensure
is_connected