Natools

Check-in [aaf366bd15]
Login
Overview
Comment:smaz_implementations-base_64_tools: remove unneeded funct. Symbol_Count
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: aaf366bd15d1d54e5639276a5f009c8c3ed6ca31
User & Date: nat on 2017-03-03 20:02:16
Other Links: manifest | tags
Context
2017-04-10
21:30
s_expressions-parsers: add a memory-backed parser check-in: 1b11361e94 user: nat tags: trunk
2017-03-03
20:02
smaz_implementations-base_64_tools: remove unneeded funct. Symbol_Count check-in: aaf366bd15 user: nat tags: trunk
2017-03-02
20:56
smaz_tests: add a test for base-4096 input with non-base-64 characters check-in: 605bfd603c user: nat tags: trunk
Changes

Modified src/natools-smaz_implementations-base_64_tools.adb from [b2d369c239] to [75be3ed6e0].

247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
      end loop;

      Digit := Value (Input (Offset));
      Finished := False;
      Offset := Offset + 1;
   end Next_Digit_Or_End;


   function Symbol_Count (Input : Ada.Streams.Stream_Element_Array)
     return Ada.Streams.Stream_Element_Count
   is
      Result : Ada.Streams.Stream_Element_Count := 0;
   begin
      for S of Input loop
         if S in Base_64_Symbol then
            Result := Result + 1;
         end if;
      end loop;

      return Result;
   end Symbol_Count;

end Natools.Smaz_Implementations.Base_64_Tools;







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<

247
248
249
250
251
252
253















254
      end loop;

      Digit := Value (Input (Offset));
      Finished := False;
      Offset := Offset + 1;
   end Next_Digit_Or_End;
















end Natools.Smaz_Implementations.Base_64_Tools;

Modified src/natools-smaz_implementations-base_64_tools.ads from [4dab4c3f88] to [37975bde85].

84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
      --  Paddingless encoded length

   function Value_Length (Input_Length : in Ada.Streams.Stream_Element_Count)
     return Natural
     is (Natural (Input_Length) - (Natural (Input_Length) + 3) / 4);
      --  Original length of an encoded array

   function Symbol_Count (Input : Ada.Streams.Stream_Element_Array)
     return Ada.Streams.Stream_Element_Count;
      --  Return the number of valid symbols in Input


   procedure Encode
     (Input : in String;
      Output : in out Ada.Streams.Stream_Element_Array;
      Offset : in out Ada.Streams.Stream_Element_Offset);
      --  Paddingless raw encoding of Input data








<
<
<
<







84
85
86
87
88
89
90




91
92
93
94
95
96
97
      --  Paddingless encoded length

   function Value_Length (Input_Length : in Ada.Streams.Stream_Element_Count)
     return Natural
     is (Natural (Input_Length) - (Natural (Input_Length) + 3) / 4);
      --  Original length of an encoded array






   procedure Encode
     (Input : in String;
      Output : in out Ada.Streams.Stream_Element_Array;
      Offset : in out Ada.Streams.Stream_Element_Offset);
      --  Paddingless raw encoding of Input data