Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Ada > Re: Text_IO fro...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 5 of 10 Topic 5628 of 5800
Post > Topic >>

Re: Text_IO from a stream

by Gautier <gautier@[EMAIL PROTECTED] > Mar 31, 2008 at 09:17 PM

Dmitry A. Kazakov:
> But a stream has no defined formatting and is unrelated to ASCII.

Still, you can read the stream through Character'Read(s,c).

 > Then the idea of parsing stream looks problematic. If you have in the
stream a
> sequence "  +  -", what Get should do after discovering '-'?

Exactly the same behaviour as when parsing an ill-formatted text.
Reading a text file (or supposedly so) indirectly via a stream and
Stream_IO 
would have the same result that via Ada.Text_IO.

> Anyway, it is quite simple to do. You can do
> 
>    type Formatted_Stream (Source : access Root_Stream_Type'Class) is
>       tagged limited private;
>    function Get (Stream : access Formatted_Stream) return Integer;
>    ...
> 
> The implementation of Formatted_Stream will use Source for all its I/O.
So
> you could hang it on any existing stream.

Fine, seems I need to rewrite a Text_IO for streams. I hoped for a
ready-made 
solution...
Well, I think I'll switch to a binary format...
______________________________________________________________
Gautier         -- http://www.mysunrise.ch/users/gdm/index.htm
Ada programming -- http://www.mysunrise.ch/users/gdm/gsoft.htm

NB: For a direct answer, e-mail address on the Web site!
 




 10 Posts in Topic:
Text_IO from a stream
gautier_niouzes@[EMAIL PR  2008-03-31 08:27:21 
Re: Text_IO from a stream
"Dmitry A. Kazakov&q  2008-03-31 17:49:00 
Re: Text_IO from a stream
gautier_niouzes@[EMAIL PR  2008-03-31 09:05:35 
Re: Text_IO from a stream
"Dmitry A. Kazakov&q  2008-03-31 18:33:23 
Re: Text_IO from a stream
Gautier <gautier@[EMAI  2008-03-31 21:17:10 
Re: Text_IO from a stream
"Dmitry A. Kazakov&q  2008-03-31 21:47:37 
Re: Text_IO from a stream
Gautier <gautier@[EMAI  2008-03-31 22:54:35 
Re: Text_IO from a stream
"Dmitry A. Kazakov&q  2008-04-01 09:49:59 
Re: Text_IO from a stream
Simon Wright <simon.j.  2008-04-01 21:49:41 
Re: Text_IO from a stream
"Dmitry A. Kazakov&q  2008-04-02 09:36:53 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sun Jul 6 19:13:01 CDT 2008.