Re: I/O streaming with custom data transport
- From: Robert A Duff <bobduff@xxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 22 Nov 2006 08:50:07 -0500
Maciej Sobczak <no.spam@xxxxxxxxxxx> writes:
procedure Write_Hello(Stream : in out Stream_Access) is
begin
String'Write(Stream, "Hello");
end Write_Hello;
I don't understand this. Ada streams are streams of Stream_Elements
(usually bytes), and the 'Read/'Write attributes encode things in
some way that is not necessarily human-readable. For example,
I think the above outputs the bounds of the string in some
binary form.
But the original question was about streams of characters,
intended to be human-readable. Right?
So how do Ada's streams help, here?
It seems to me what you want is an abstract Character_Output_Stream
type, with a primitive (or class-wide?) operation that puts a Character
to the stream. Then you can make derived types for sending to a file,
to an in-memory buffer, etc.
- Bob
.
- Follow-Ups:
- Re: I/O streaming with custom data transport
- From: Maciej Sobczak
- Re: I/O streaming with custom data transport
- References:
- I/O streaming with custom data transport
- From: Maciej Sobczak
- Re: I/O streaming with custom data transport
- From: Alex R. Mosteo
- Re: I/O streaming with custom data transport
- From: Maciej Sobczak
- I/O streaming with custom data transport
- Prev by Date: Re: I/O streaming with custom data transport
- Next by Date: Re: I/O streaming with custom data transport
- Previous by thread: Re: I/O streaming with custom data transport
- Next by thread: Re: I/O streaming with custom data transport
- Index(es):
Relevant Pages
|