comp.lang.ada
 help / color / mirror / Atom feed
From: "Jeffrey R. Carter" <spam.jrcarter.not@spam.not.acm.org>
Subject: Re: Text IO for files not using the standard line termination for the OS
Date: Sun, 18 Nov 2018 10:26:29 +0100
Date: 2018-11-18T10:26:29+01:00	[thread overview]
Message-ID: <psrb85$l5p$1@dont-email.me> (raw)
In-Reply-To: <93200914-ef2d-4cb1-8b45-76819db2a8e0@googlegroups.com>

On 11/18/18 4:44 AM, Shark8 wrote:
> 
> I think you have to do it character-by-character in this case.
> There's a library called PragmaARC (IIRC) that has Text_IO packages for non-native text, you might want to take a look there.

These are the PragmAda Reusable Components. Package PragmARC.Text_IO handles 
files with 3 kinds of line terminators:

    type EOL_ID is (DOS_Windows_EOL, Mac_EOL, Unix_EOL);
    -- Used to specify what line terminator to use on output
    -- DOS_Windows_EOL = CR-LF
    -- Mac_EOL         = CR
    -- Unix_EOL        = LF

For reading, it automatically handles EOLs of all 3 kinds, which may be mixed in 
the same file (though I've never encountered this). For output, when the files 
is created/opened, the desired EOL kind is specified.

The PragmARCs are at

https://github.com/jrcarter/PragmARC

HTH

-- 
Jeff Carter
"Ditto, you provincial putz?"
Blazing Saddles
86


  reply	other threads:[~2018-11-18  9:26 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-18  2:01 Text IO for files not using the standard line termination for the OS jdgressett
2018-11-18  3:44 ` Shark8
2018-11-18  9:26   ` Jeffrey R. Carter [this message]
2018-11-18 23:41     ` jdgressett
2018-11-18  4:40 ` Keith Thompson
2018-11-18 10:10   ` Simon Wright
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox