Eiffel Media API
Overview Cluster Class Classes Index      Previous Next      Top Features

kernel.io

Class KL_PROXY_CHARACTER_OUTPUT_STREAM


Direct ancestors

KI_CHARACTER_OUTPUT_STREAM

Known direct descendants

UT_BASE64_ENCODING_OUTPUT_STREAM

Creation

Features

Invariants

indexing

description

Proxy character output streams

remark

append, put_integer and put_boolean are NOT redefined, %
%as they are defined entirely in terms of put_character %
%and put_string - template pattern. This is most probably %
%what descendants will want.

library

Gobo Eiffel Kernel Library

copyright

Copyright (c) 2005, Colin Adams and others

license

Eiffel Forum License v2 (see forum.txt)

date

$Date: 2005/07/13 17:05:06 $

revision

$Revision: 1.3 $

class

KL_PROXY_CHARACTER_OUTPUT_STREAM

inherit

KI_CHARACTER_OUTPUT_STREAM

create

make (a_stream: like base_stream)

-- Create a new proxy output stream.

require
a_stream_not_void: a_stream /= Void
ensure
base_stream_set: base_stream = a_stream

feature -- Access

base_stream: KI_CHARACTER_OUTPUT_STREAM

-- Underlying stream

name: STRING

-- Name of output stream

-- (From KI_OUTPUT_STREAM)

ensure
name_not_void: Result /= Void

feature -- Status report

is_closable: BOOLEAN

-- Can current output stream be closed?

-- (From KI_OUTPUT_STREAM)

ensure
is_open: Result implies is_open_write
is_open_write: BOOLEAN

-- Can characters be written to output stream?

-- (From KI_OUTPUT_STREAM)

feature -- Basic operations

close

-- Try to close output stream if it is closable. Set
-- is_open_write to false if operation was successful.

-- (From KI_OUTPUT_STREAM)

require
is_closable: is_closable
flush

-- Flush buffered data to disk.

-- (From KI_CHARACTER_OUTPUT_STREAM)

require
is_open_write: is_open_write

feature -- Output

append (an_input_stream: KI_INPUT_STREAM [CHARACTER])

-- Read items of an_input_stream until the end
-- of input is reached, and write these items to
-- current output stream.

-- (From KI_OUTPUT_STREAM)

require
is_open_write: is_open_write
an_input_stream_not_void: an_input_stream /= Void
an_input_stream_open_read: an_input_stream.is_open_read
ensure
end_of_input: an_input_stream.end_of_input
put_boolean (b: BOOLEAN)

-- Write "True" to output stream if
-- b is true, "False" otherwise.

-- (From KI_CHARACTER_OUTPUT_STREAM)

require
is_open_write: is_open_write
put_character (c: CHARACTER)

-- Write c to output stream.

-- (From KI_OUTPUT_STREAM)

require
is_open_write: is_open_write
put_integer (i: INTEGER)

-- Write decimal representation
-- of i to output stream.
-- Regexp: 0|(-?[1-9][0-9]*)

-- (From KI_CHARACTER_OUTPUT_STREAM)

require
is_open_write: is_open_write
put_string (a_string: STRING)

-- Write a_string to output stream.

-- (From KI_CHARACTER_OUTPUT_STREAM)

require
is_open_write: is_open_write
a_string_not_void: a_string /= Void
put_substring (a_string: STRING; s, e: INTEGER)

-- Write substring of a_string between indexes
-- s and e to output stream.

-- (From KI_CHARACTER_OUTPUT_STREAM)

require
is_open_write: is_open_write
a_string_not_void: a_string /= Void
s_large_enough: s >= 1
e_small_enough: e <= a_string.count
valid_interval: s <= e + 1

invariant

base_stream_not_void: base_stream /= Void

-- From ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end