From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,6c383a046f41e91 X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!postnews.google.com!c65g2000hsa.googlegroups.com!not-for-mail From: gautier_niouzes@hotmail.com Newsgroups: comp.lang.ada Subject: Re: Text_IO from a stream Date: Mon, 31 Mar 2008 09:05:35 -0700 (PDT) Organization: http://groups.google.com Message-ID: <0c9ab8b7-a666-4fd2-a876-dca818ad5461@c65g2000hsa.googlegroups.com> References: <0465edf8-7272-43c8-82fd-fcae7cf0ef11@y21g2000hsf.googlegroups.com> <1y2oi69ev939v.1xugoel9fadnb$.dlg@40tude.net> NNTP-Posting-Host: 206.122.158.4 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: posting.google.com 1206979535 14297 127.0.0.1 (31 Mar 2008 16:05:35 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Mon, 31 Mar 2008 16:05:35 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: c65g2000hsa.googlegroups.com; posting-host=206.122.158.4; posting-account=gRqrnQkAAAAC_02ynnhqGk1VRQlve6ZG User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727; .NET CLR 1.1.4322; InfoPath.1; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022),gzip(gfe),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:20679 Date: 2008-03-31T09:05:35-07:00 List-Id: 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