comp.lang.ada
 help / color / mirror / Atom feed
From: Jacob Sparre Andersen <sparre@nbi.dk>
Subject: Re: Base64-Encoding
Date: Mon, 15 Oct 2007 17:14:25 +0200
Date: 2007-10-15T17:14:25+02:00	[thread overview]
Message-ID: <yge3awch0ku.fsf@hugsarin.dmusyd.edu> (raw)
In-Reply-To: 20071015165435.0eef160d@cube.tz.axivion.com

Stefan Bellon wrote:
> On Mon, 15 Oct, Jacob Sparre Andersen wrote:

>>    Padded_Data : String (1 .. Padded_Length) := Data & (others =>
>> ASCII.NUL);
>> 
>> would work fine.
>
> This results in:
>
>    error: "others" choice not allowed here

I can't figure out why, but here's something which does work:

      Padded_Data : String (1 .. Padded_Length) := 
                      Data & (Data'Length + 1 .. Padded_Length => ASCII.NUL);

> I hoped for this as well, but it looks like the attribute Bit_Order is
> only defined for record types. This is what 13.5.3 says and indeed GNAT
> refuses to accept a 'Bit_Order on Six_Bits or the array thereof.

Doesn't that simply mean that you have to make "Base64_Data" an array
of Base64_Block, where Base64_Block is declared like this:

   type Base64_Block is
      record
         A, B, C, D : Six_Bits;
      end record;

This way you will be allowed bit ordering on the Base64_Block, which
hopefully will solve your problem.

Greetings,

Jacob
-- 
Adlai Stevenson said it all when, at an event during the
1956 Presidential campaign, a woman shouted, "You have the
vote of every thinking person!" Stevenson shouted back,
"That's not enough, madam, we need a majority!"



  reply	other threads:[~2007-10-15 15:14 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-15 14:12 Base64-Encoding Stefan Bellon
2007-10-15 14:46 ` Base64-Encoding Jacob Sparre Andersen
2007-10-15 14:54   ` Base64-Encoding Stefan Bellon
2007-10-15 15:14     ` Jacob Sparre Andersen [this message]
2007-10-15 15:37       ` Base64-Encoding Robert A Duff
2007-10-15 15:40     ` Base64-Encoding Jean-Pierre Rosen
2007-10-15 16:39       ` Base64-Encoding Stefan Bellon
2007-10-16 10:42         ` Base64-Encoding Stephen Leake
2007-10-17 14:07           ` Base64-Encoding Stefan Bellon
2007-10-17 15:09             ` Base64-Encoding Adam Beneschan
2007-10-17 18:15               ` Base64-Encoding Larry Kilgallen
2007-10-15 18:24 ` Base64-Encoding Adam Beneschan
2007-10-19  2:43 ` Base64-Encoding anon
2007-10-19  4:33   ` Base64-Encoding anon
2007-10-19  7:35     ` Base64-Encoding Jean-Pierre Rosen
2007-10-19  6:59   ` Base64-Encoding Stefan Bellon
2007-10-19 19:40     ` Base64-Encoding anon
replies disabled

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