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=0.1 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM,FREEMAIL_REPLY autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,1105222d4a2742f8 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!postnews.google.com!h13g2000yqk.googlegroups.com!not-for-mail From: mockturtle Newsgroups: comp.lang.ada Subject: Re: Ada equivalent of c++ strstream Date: Sat, 12 Sep 2009 04:27:05 -0700 (PDT) Organization: http://groups.google.com Message-ID: <45566bbf-13fd-43c9-85df-b031f3dfe6f3@h13g2000yqk.googlegroups.com> References: <7f203a86-e052-46b8-912f-03900b8025c4@r39g2000yqm.googlegroups.com> NNTP-Posting-Host: 93.37.250.99 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: posting.google.com 1252754826 20797 127.0.0.1 (12 Sep 2009 11:27:06 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Sat, 12 Sep 2009 11:27:06 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: h13g2000yqk.googlegroups.com; posting-host=93.37.250.99; posting-account=9fwclgkAAAD6oQ5usUYhee1l39geVY99 User-Agent: G2/1.0 X-HTTP-UserAgent: Opera/9.64 (X11; Linux i686; U; en) Presto/2.1.1,gzip(gfe),gzip(gfe) Xref: g2news2.google.com comp.lang.ada:8304 Date: 2009-09-12T04:27:05-07:00 List-Id: RasikaSrinivasan@gmail.com ha scritto: > is there such a package that allows get/put from/to strings? thanks > for any pointers, srini Yes, Text_IO itself... To be more precise, the generic packages (e.g., Integer_IO, Modular_IO, ...) contained in Text_IO. This means that you will need to specialize them before use. Check Appendix A.10 of the beloved RM (Reference Manual) for more informations. Example: --- File test.adb ------ with Text_Io; procedure Test is -- Specialize Text_Io.Integer_Io package Int_Io is new Text_Io.Integer_Io(Integer); Buffer : String(1..5) := (others => 'x'); begin Int_Io.Put(Buffer, 42); Text_Io.Put_Line("[" & Buffer & "]"); -- will print [ 42] end Test;