Re: I/O streaming with custom data transport



Alex R. Mosteo wrote:

About traps, more complex streams may require special care: for example,
imagine your characters are multi-byte and you receive an incomplete
character code in the write function.

Sure.

But what about buffering the input/output. Is this already done (where?) or is this something I have to take care of?

Another issue - what about the text formatting? The standard Put(...) procedures are quite powerful, is there any way to reuse them (or at least their logic) with custom streams?

Just a nitpick: in your example, instead of allocating a new stream I would
simply get an access to a stack-allocated one:

declare
S2 : aliased My_Stream;
begin
Write_Hello (S2'Access);
end;

Yes, thanks.

--
Maciej Sobczak : http://www.msobczak.com/
Programming : http://www.msobczak.com/prog/
.