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 3 of 10 Topic 5628 of 5931
Post > Topic >>

Re: Text_IO from a stream

by gautier_niouzes@[EMAIL PROTECTED] Mar 31, 2008 at 09:05 AM

Dmitry A. Kazakov:

> You can always wrap a File_Type in your own stream object.

Do you mean something like:

 type Text_Stream_Type is new Ada.Streams.Root_Stream_Type with record
   virtual_file : Ada.Text_IO.File_Type;
 end record;

?
At the end of the day, what I'd really like is
  function File(stream: access Ada.Streams.Root_Stream_Type 'Class)
return Ada.Text_IO.File_Type;
so that I can do read ASCII data from any stream:
  f:= File(my_stream);
  -- f is as if open in In_File mode
  Get_Line(f, a_string, length);
  Get(f, an_integer); -- not binary, but 123_456
  Get(f, a_float);    -- not binary, but -123.456e78

I guess it would be difficult... But maybe I'm wrong ?
Gautier
 




 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 Wed Oct 15 22:26:30 CDT 2008.