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.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,b5cd7bf26d091c6f X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news1.google.com!news.glorb.com!feeder.erje.net!feeder.news-service.com!94.75.214.39.MISMATCH!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Reading the while standard input into a String Date: Mon, 6 Jun 2011 09:18:46 +0200 Organization: cbb software GmbH Message-ID: References: Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: FbOMkhMtVLVmu7IwBnt1tw.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: 40tude_Dialog/2.0.15.1 X-Notice: Filtered by postfilter v. 0.8.2 Xref: g2news2.google.com comp.lang.ada:20597 Date: 2011-06-06T09:18:46+02:00 List-Id: On Sun, 5 Jun 2011 16:20:39 +0000 (UTC), Natasha Kerensikova wrote: > However I still read > character by character You have to, because the definition of line end is language/OS/encoding dependent, so in order to detect line ends properly you need to scan characters one by one, maybe recoding them into the encoding used by the parser (e.g. UTF-8). It does not make much sense to read input by arbitrary size chunks. Read it line by line. If parser needs returns over the line margin (unlikely), then keep read lines cached. > into a temporary buffer, Read it into the destination buffer. Don't use Unbounded_String; that is a bad idea in almost all cases, this one included. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de