/[eiffelstudio]/FreeELKS/trunk/library/kernel/io_medium.e
ViewVC logotype

Contents of /FreeELKS/trunk/library/kernel/io_medium.e

Parent Directory Parent Directory | Revision Log Revision Log


Revision 91424 - (show annotations)
Tue Oct 26 18:39:32 2004 UTC (15 years, 2 months ago) by manus_eiffel
File size: 7087 byte(s)
Initial revision

1 indexing
2
3 description:
4 "Any medium that can perform input and/or output"
5 status: "See notice at end of class"
6 date: "$Date$"
7 revision: "$Revision$"
8
9 deferred class IO_MEDIUM
10
11 inherit
12 DISPOSABLE
13 export
14 {NONE} all
15 end
16
17 STRING_HANDLER
18
19 feature -- Access
20
21 name: STRING is
22 -- Medium name
23 deferred
24 end
25
26 retrieved: ANY is
27 -- Retrieved object structure
28 -- To access resulting object under correct type,
29 -- use assignment attempt.
30 -- Will raise an exception (code `Retrieve_exception')
31 -- if content is not a stored Eiffel structure.
32 require
33 is_readable: readable
34 support_storable: support_storable
35 deferred
36 ensure
37 Result_exists: Result /= Void
38 end
39
40 feature -- Element change
41
42 basic_store (object: ANY) is
43 -- Produce an external representation of the
44 -- entire object structure reachable from `object'.
45 -- Retrievable within current system only.
46 require
47 object_not_void: object /= Void
48 extendible: extendible
49 support_storable: support_storable
50 deferred
51 end
52
53 general_store (object: ANY) is
54 -- Produce an external representation of the
55 -- entire object structure reachable from `object'.
56 -- Retrievable from other systems for same platform
57 -- (machine architecture).
58 --| This feature may use a visible name of a class written
59 --| in the `visible' clause of the Ace file. This makes it
60 --| possible to overcome class name clashes.
61 require
62 object_not_void: object /= Void
63 extendible: extendible
64 support_storable: support_storable
65 deferred
66 end
67
68 independent_store (object: ANY) is
69 -- Produce an external representation of the
70 -- entire object structure reachable from `object'.
71 -- Retrievable from other systems for the same or other
72 -- platform (machine architecture).
73 require
74 object_not_void: object /= Void
75 extendible: extendible
76 support_storable: support_storable
77 deferred
78 end
79
80 feature -- Status report
81
82 handle: INTEGER is
83 -- Handle to medium
84 require
85 valid_handle: handle_available
86 deferred
87 end
88
89 handle_available: BOOLEAN is
90 -- Is the handle available after class has been
91 -- created?
92 deferred
93 end
94
95 is_plain_text: BOOLEAN is
96 -- Is file reserved for text (character sequences)?
97 do
98 end
99
100 last_character: CHARACTER
101 -- Last character read by `read_character'
102
103 last_string: STRING
104 -- Last string read
105
106 last_integer: INTEGER
107 -- Last integer read by `read_integer'
108
109 last_real: REAL
110 -- Last real read by `read_real'
111
112 last_double: DOUBLE
113 -- Last double read by `read_double'
114
115 exists: BOOLEAN is
116 -- Does medium exist?
117 deferred
118 end
119
120 is_open_read: BOOLEAN is
121 -- Is this medium opened for input
122 deferred
123 end
124
125 is_open_write: BOOLEAN is
126 -- Is this medium opened for output
127 deferred
128 end
129
130 is_readable: BOOLEAN is
131 -- Is medium readable?
132 require
133 handle_exists: exists
134 deferred
135 end
136
137 is_executable: BOOLEAN is
138 -- Is medium executable?
139 require
140 handle_exists: exists
141 deferred
142 end
143
144 is_writable: BOOLEAN is
145 -- Is medium writable?
146 require
147 handle_exists: exists
148 deferred
149 end
150
151 readable: BOOLEAN is
152 -- Is there a current item that may be read?
153 require
154 handle_exists: exists
155 deferred
156 end
157
158 extendible: BOOLEAN is
159 -- May new items be added?
160 deferred
161 end
162
163 is_closed: BOOLEAN is
164 -- Is the I/O medium open
165 deferred
166 end
167
168 support_storable: BOOLEAN is
169 -- Can medium be used to store an Eiffel object?
170 deferred
171 end
172
173 feature -- Status setting
174
175 close is
176 -- Close medium.
177 require
178 medium_is_open: not is_closed
179 deferred
180 end
181
182 feature -- Removal
183
184 dispose is
185 -- Ensure this medium is closed when garbage collected.
186 do
187 if not is_closed then
188 close
189 end
190 end
191
192 feature -- Output
193
194 put_new_line, new_line is
195 -- Write a new line character to medium
196 require
197 extendible: extendible
198 deferred
199 end
200
201 put_string, putstring (s: STRING) is
202 -- Write `s' to medium.
203 require
204 extendible: extendible
205 non_void: s /= Void
206 deferred
207 end
208
209 put_character, putchar (c: CHARACTER) is
210 -- Write `c' to medium.
211 require
212 extendible: extendible
213 deferred
214 end
215
216 put_real, putreal (r: REAL) is
217 -- Write `r' to medium.
218 require
219 extendible: extendible
220 deferred
221 end
222
223 put_integer, putint (i: INTEGER) is
224 -- Write `i' to medium.
225 require
226 extendible: extendible
227 deferred
228 end
229
230 put_boolean, putbool (b: BOOLEAN) is
231 -- Write `b' to medium.
232 require
233 extendible: extendible
234 deferred
235 end
236
237 put_double, putdouble (d: DOUBLE) is
238 -- Write `d' to medium.
239 require
240 extendible: extendible
241 deferred
242 end
243
244 feature -- Input
245
246 read_real, readreal is
247 -- Read a new real.
248 -- Make result available in `last_real'.
249 require
250 is_readable: readable
251 deferred
252 end
253
254 read_double, readdouble is
255 -- Read a new double.
256 -- Make result available in `last_double'.
257 require
258 is_readable: readable
259 deferred
260 end
261
262 read_character, readchar is
263 -- Read a new character.
264 -- Make result available in `last_character'.
265 require
266 is_readable: readable
267 deferred
268 end
269
270 read_integer, readint is
271 -- Read a new integer.
272 -- Make result available in `last_integer'.
273 require
274 is_readable: readable
275 deferred
276 end
277
278 read_stream, readstream (nb_char: INTEGER) is
279 -- Read a string of at most `nb_char' bound characters
280 -- or until end of medium is encountered.
281 -- Make result available in `last_string'.
282 require
283 is_readable: readable
284 deferred
285 end
286
287 read_line, readline is
288 -- Read characters until a new line or
289 -- end of medium.
290 -- Make result available in `last_string'.
291 require
292 is_readable: readable
293 deferred
294 end
295
296 feature -- Obsolete
297
298 lastchar: CHARACTER is
299 -- Last character read by `read_character'
300 do
301 Result := last_character
302 end
303
304 laststring: STRING is
305 -- Last string read
306 do
307 Result := last_string
308 end
309
310 lastint: INTEGER is
311 -- Last integer read by `read_integer'
312 do
313 Result := last_integer
314 end
315
316 lastreal: REAL is
317 -- Last real read by `read_real'
318 do
319 Result := last_real
320 end
321
322 lastdouble: DOUBLE is
323 -- Last double read by `read_double'
324 do
325 Result := last_double
326 end
327
328 indexing
329
330 library: "[
331 EiffelBase: Library of reusable components for Eiffel.
332 ]"
333
334 status: "[
335 Copyright 1986-2001 Interactive Software Engineering (ISE).
336 For ISE customers the original versions are an ISE product
337 covered by the ISE Eiffel license and support agreements.
338 ]"
339
340 license: "[
341 EiffelBase may now be used by anyone as FREE SOFTWARE to
342 develop any product, public-domain or commercial, without
343 payment to ISE, under the terms of the ISE Free Eiffel Library
344 License (IFELL) at http://eiffel.com/products/base/license.html.
345 ]"
346
347 source: "[
348 Interactive Software Engineering Inc.
349 ISE Building
350 360 Storke Road, Goleta, CA 93117 USA
351 Telephone 805-685-1006, Fax 805-685-6869
352 Electronic mail <info@eiffel.com>
353 Customer support http://support.eiffel.com
354 ]"
355
356 info: "[
357 For latest info see award-winning pages: http://eiffel.com
358 ]"
359
360 end -- class IO_MEDIUM
361
362

Properties

Name Value
svn:eol-style native
svn:keywords Author Date Id Revision

  ViewVC Help
Powered by ViewVC 1.1.23