comp.lang.ada
 help / color / mirror / Atom feed
From: Robert A Duff <bobduff@shell01.TheWorld.com>
Subject: Re: I/O streaming with custom data transport
Date: Wed, 22 Nov 2006 08:50:07 -0500
Date: 2006-11-22T08:50:07-05:00	[thread overview]
Message-ID: <wccvel7egkw.fsf@shell01.TheWorld.com> (raw)
In-Reply-To: ek14i8$k0g$1@cernne03.cern.ch

Maciej Sobczak <no.spam@no.spam.com> 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



  parent reply	other threads:[~2006-11-22 13:50 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-21 15:11 I/O streaming with custom data transport Maciej Sobczak
2006-11-21 15:28 ` gautier_niouzes
2006-11-21 17:51 ` Alex R. Mosteo
2006-11-22  9:16   ` Maciej Sobczak
2006-11-22 10:01     ` Alex R. Mosteo
2006-11-22 10:39       ` Maciej Sobczak
2006-11-22 16:06         ` Dmitry A. Kazakov
2006-11-22 16:30         ` Alex R. Mosteo
2006-11-23  5:48         ` Simon Wright
2006-11-22 13:50     ` Robert A Duff [this message]
2006-11-22 14:37       ` Maciej Sobczak
2006-11-22 16:11         ` Georg Bauhaus
2006-11-21 19:02 ` Dmitry A. Kazakov
2006-11-22  9:21   ` Maciej Sobczak
2006-11-22 10:31     ` Dmitry A. Kazakov
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox