• R/O
  • SSH

Ada95FL: 提交

Ada 95 foundation library


Commit MetaInfo

修订版76b51d045233d59c99fba2d306480118d9cedfa7 (tree)
时间2019-10-25 17:16:16
作者Sergey Dukov <dukov54@live...>
CommiterSergey Dukov

Log Message

#32763 Ввод подтипов для встроенных типов

更改概述

差异

diff -r 8ef564fbbc00 -r 76b51d045233 Unbounded/Ada_Magic_Forward.Character_32s.ads
--- a/Unbounded/Ada_Magic_Forward.Character_32s.ads Tue Oct 15 07:08:58 2019 +0400
+++ b/Unbounded/Ada_Magic_Forward.Character_32s.ads Fri Oct 25 12:16:16 2019 +0400
@@ -55,6 +55,12 @@
5555
5656 Null_String_32 : String_32(2 .. 1);
5757
58+ subtype Character_8 is Character;
59+ subtype String_8 is String;
60+
61+ subtype Character_16 is Wide_Character;
62+ subtype String_16 is Wide_String;
63+
5864 type Byte_Type is new System.Storage_Elements.Storage_Element;
5965 type Byte_Access is access all Byte_Type;
6066
diff -r 8ef564fbbc00 -r 76b51d045233 Unbounded/Ada_Magic_Forward.Strings.ads
--- a/Unbounded/Ada_Magic_Forward.Strings.ads Tue Oct 15 07:08:58 2019 +0400
+++ b/Unbounded/Ada_Magic_Forward.Strings.ads Fri Oct 25 12:16:16 2019 +0400
@@ -24,8 +24,8 @@
2424 package Ada_Magic_Forward.Strings is
2525
2626 BOM32 : constant := 16#0000FEFF#;
27- Space : constant Character := ' ';
28- Wide_Space : constant Wide_Character := ' ';
27+ Space : constant Character_8 := ' ';
28+ Wide_Space : constant Character_16 := ' ';
2929 Character_32_Space : constant Character_32 := Character_32'Val (32);
3030
3131 -- The following declaration is for Ada 2005 (AI-285)
diff -r 8ef564fbbc00 -r 76b51d045233 Unbounded/unbounded_array.adb
--- a/Unbounded/unbounded_array.adb Tue Oct 15 07:08:58 2019 +0400
+++ b/Unbounded/unbounded_array.adb Fri Oct 25 12:16:16 2019 +0400
@@ -243,7 +243,7 @@
243243 end To_Unbounded_Array;
244244
245245 function To_Unbounded_Array
246- (Source : String) return Unbounded_Array_Type
246+ (Source : String_8) return Unbounded_Array_Type
247247 is
248248 subtype Bounded_Array is Array_Of_Byte_Type
249249 (1 .. Natural(Source'Last - Source'First + 1));
@@ -331,10 +331,10 @@
331331 end Free;
332332
333333 function To_String(Source : Unbounded_Array_Type)
334- return String
334+ return String_8
335335 is
336336 RB : Referenced_Buffer_Access := Source.Reference;
337- subtype Bounded_String is String(1 .. RB.Last);
337+ subtype Bounded_String is String_8(1 .. RB.Last);
338338 package TP is new ATOAC(Bounded_String);
339339 Output_Ptr : TP.Object_Pointer :=
340340 TP.To_Pointer(RB.Data(1)'Address);
@@ -440,7 +440,7 @@
440440
441441 procedure Append
442442 (Source : in out Unbounded_Array_Type;
443- New_Item : String)
443+ New_Item : String_8)
444444 is
445445 subtype Bounded_Array is Array_Of_Byte_Type(1 .. New_Item'Length);
446446 package TP is new ATOAC(Bounded_Array);
@@ -483,7 +483,7 @@
483483
484484 procedure Append
485485 (Source : in out Unbounded_Array_Type;
486- New_Item : Character)
486+ New_Item : Character_8)
487487 is
488488 begin
489489 Append(Source, Byte_Type(Character'Pos(New_Item)));
@@ -678,7 +678,7 @@
678678
679679 function "&"
680680 (Left : Unbounded_Array_Type;
681- Right : String) return Unbounded_Array_Type
681+ Right : String_8) return Unbounded_Array_Type
682682 is
683683 subtype Bounded_Array is Array_Of_Byte_Type(1 .. Right'Length);
684684 package TP is new ATOAC(Bounded_Array);
@@ -722,7 +722,7 @@
722722 end "&";
723723
724724 function "&"
725- (Left : String;
725+ (Left : String_8;
726726 Right : Unbounded_Array_Type) return Unbounded_Array_Type
727727 is
728728 subtype Bounded_Array is Array_Of_Byte_Type(1 .. Left'Length);
@@ -758,10 +758,10 @@
758758
759759 function "&"
760760 (Left : Unbounded_Array_Type;
761- Right : Character) return Unbounded_Array_Type
761+ Right : Character_8) return Unbounded_Array_Type
762762 is
763763 begin
764- return Left & Byte_Type(Character'Pos(Right));
764+ return Left & Byte_Type(Character_8'Pos(Right));
765765 end "&";
766766
767767 function "&"
@@ -788,11 +788,11 @@
788788 end "&";
789789
790790 function "&"
791- (Left : Character;
791+ (Left : Character_8;
792792 Right : Unbounded_Array_Type) return Unbounded_Array_Type
793793 is
794794 begin
795- return Byte_Type(Character'Pos(Left)) & Right;
795+ return Byte_Type(Character_8'Pos(Left)) & Right;
796796 end "&";
797797
798798 function Element
@@ -811,10 +811,10 @@
811811 procedure Replace_Element
812812 (Source : in out Unbounded_Array_Type;
813813 Index : Positive;
814- By : Character)
814+ By : Character_8)
815815 is
816816 begin
817- Replace_Element(Source, Index, Byte_Type(Character'Pos(By)));
817+ Replace_Element(Source, Index, Byte_Type(Character_8'Pos(By)));
818818 end Replace_Element;
819819
820820 function Slice
@@ -835,10 +835,10 @@
835835 function Slice
836836 (Source : Unbounded_Array_Type;
837837 Low : Positive;
838- High : Natural) return String
838+ High : Natural) return String_8
839839 is
840840 Output_Array : Array_Of_Byte_Type := Slice(Source, Low, High);
841- subtype Bounded_String is String(Output_Array'Range);
841+ subtype Bounded_String is String_8(Output_Array'Range);
842842 package TP is new ATOAC(Bounded_String);
843843 Output_Ptr : TP.Object_Pointer :=
844844 TP.To_Pointer(Output_Array(1)'Address);
@@ -1053,7 +1053,7 @@
10531053 (Source : Unbounded_Array_Type;
10541054 Low : Positive;
10551055 High : Natural;
1056- By : String) return Unbounded_Array_Type
1056+ By : String_8) return Unbounded_Array_Type
10571057 is
10581058 subtype Bounded_Array is Array_Of_Byte_Type(1 .. By'Length);
10591059 package TP is new ATOAC(Bounded_Array);
@@ -1067,7 +1067,7 @@
10671067 (Source : in out Unbounded_Array_Type;
10681068 Low : Positive;
10691069 High : Natural;
1070- By : String)
1070+ By : String_8)
10711071 is
10721072 subtype Bounded_Array is Array_Of_Byte_Type(1 .. By'Length);
10731073 package TP is new ATOAC(Bounded_Array);
@@ -1080,7 +1080,7 @@
10801080 function Insert
10811081 (Source : Unbounded_Array_Type;
10821082 Before : Positive;
1083- New_Item : String) return Unbounded_Array_Type
1083+ New_Item : String_8) return Unbounded_Array_Type
10841084 is
10851085 subtype Bounded_Array is Array_Of_Byte_Type(1 .. New_Item'Length);
10861086 package TP is new ATOAC(Bounded_Array);
@@ -1093,7 +1093,7 @@
10931093 procedure Insert
10941094 (Source : in out Unbounded_Array_Type;
10951095 Before : Positive;
1096- New_Item : String)
1096+ New_Item : String_8)
10971097 is
10981098 subtype Bounded_Array is Array_Of_Byte_Type(1 .. New_Item'Length);
10991099 package TP is new ATOAC(Bounded_Array);
@@ -1147,7 +1147,7 @@
11471147 function Overwrite
11481148 (Source : Unbounded_Array_Type;
11491149 Position : Positive;
1150- New_Item : String) return Unbounded_Array_Type
1150+ New_Item : String_8) return Unbounded_Array_Type
11511151 is
11521152 subtype Bounded_Array is Array_Of_Byte_Type(1 .. New_Item'Length);
11531153 package TP is new ATOAC(Bounded_Array);
@@ -1206,7 +1206,7 @@
12061206 procedure Overwrite
12071207 (Source : in out Unbounded_Array_Type;
12081208 Position : Positive;
1209- New_Item : String)
1209+ New_Item : String_8)
12101210 is
12111211 subtype Bounded_Array is Array_Of_Byte_Type(1 .. New_Item'Length);
12121212 package TP is new ATOAC(Bounded_Array);
@@ -1238,10 +1238,10 @@
12381238
12391239 function "*"
12401240 (Left : Natural;
1241- Right : Character) return Unbounded_Array_Type
1241+ Right : Character_8) return Unbounded_Array_Type
12421242 is
12431243 begin
1244- return Left * Byte_Type(Character'Pos(Right));
1244+ return Left * Byte_Type(Character_8'Pos(Right));
12451245 end "*";
12461246
12471247 function "*"
@@ -1270,7 +1270,7 @@
12701270
12711271 function "*"
12721272 (Left : Natural;
1273- Right : String) return Unbounded_Array_Type
1273+ Right : String_8) return Unbounded_Array_Type
12741274 is
12751275 subtype Bounded_Array is Array_Of_Byte_Type(1 .. Right'Length);
12761276 package TP is new ATOAC(Bounded_Array);
@@ -1656,7 +1656,7 @@
16561656 end From_Utf8_To_Utf32;
16571657
16581658 procedure From_Utf8_To_Utf32 (Utf32S : in out Unbounded_Array_Type;
1659- Utf8S : String;
1659+ Utf8S : String_8;
16601660 BOM : Boolean := False)
16611661 is
16621662 subtype Bounded_Array is Array_Of_Byte_Type(1 .. Utf8S'Length);
diff -r 8ef564fbbc00 -r 76b51d045233 Unbounded/unbounded_array.ads
--- a/Unbounded/unbounded_array.ads Tue Oct 15 07:08:58 2019 +0400
+++ b/Unbounded/unbounded_array.ads Fri Oct 25 12:16:16 2019 +0400
@@ -52,7 +52,7 @@
5252 (Length : Natural) return Unbounded_Array_Type;
5353
5454 function To_Unbounded_Array
55- (Source : String) return Unbounded_Array_Type;
55+ (Source : String_8) return Unbounded_Array_Type;
5656
5757 function To_Unbounded_Array
5858 (Source : String_32; BOM : Boolean := False)
@@ -75,7 +75,7 @@
7575 pragma Inline(Get_Array_Address);
7676
7777 function To_String(Source : Unbounded_Array_Type)
78- return String;
78+ return String_8;
7979 pragma Inline(To_String);
8080
8181 function To_String_32(Source : Unbounded_Array_Type;
@@ -96,7 +96,7 @@
9696
9797 procedure Append
9898 (Source : in out Unbounded_Array_Type;
99- New_Item : String);
99+ New_Item : String_8);
100100
101101 procedure Append
102102 (Source : in out Unbounded_Array_Type;
@@ -104,7 +104,7 @@
104104
105105 procedure Append
106106 (Source : in out Unbounded_Array_Type;
107- New_Item : Character);
107+ New_Item : Character_8);
108108
109109 procedure Append
110110 (Source : in out Unbounded_Array_Type;
@@ -124,7 +124,7 @@
124124
125125 function "&"
126126 (Left : Unbounded_Array_Type;
127- Right : String) return Unbounded_Array_Type;
127+ Right : String_8) return Unbounded_Array_Type;
128128
129129 function "&"
130130 (Left : Unbounded_Array_Type;
@@ -135,7 +135,7 @@
135135 Right : Unbounded_Array_Type) return Unbounded_Array_Type;
136136
137137 function "&"
138- (Left : String;
138+ (Left : String_8;
139139 Right : Unbounded_Array_Type) return Unbounded_Array_Type;
140140
141141 function "&"
@@ -148,14 +148,14 @@
148148
149149 function "&"
150150 (Left : Unbounded_Array_Type;
151- Right : Character) return Unbounded_Array_Type;
151+ Right : Character_8) return Unbounded_Array_Type;
152152
153153 function "&"
154154 (Left : Unbounded_Array_Type;
155155 Right : Character_32) return Unbounded_Array_Type;
156156
157157 function "&"
158- (Left : Character;
158+ (Left : Character_8;
159159 Right : Unbounded_Array_Type) return Unbounded_Array_Type;
160160
161161 function "&"
@@ -178,7 +178,7 @@
178178 procedure Replace_Element
179179 (Source : in out Unbounded_Array_Type;
180180 Index : Positive;
181- By : Character);
181+ By : Character_8);
182182
183183 procedure Replace_Element
184184 (Source : in out Unbounded_Array_Type;
@@ -193,7 +193,7 @@
193193 function Slice
194194 (Source : Unbounded_Array_Type;
195195 Low : Positive;
196- High : Natural) return String;
196+ High : Natural) return String_8;
197197
198198 function Slice
199199 (Source : Unbounded_Array_Type;
@@ -236,7 +236,7 @@
236236 function Insert
237237 (Source : Unbounded_Array_Type;
238238 Before : Positive;
239- New_Item : String) return Unbounded_Array_Type;
239+ New_Item : String_8) return Unbounded_Array_Type;
240240
241241 function Insert
242242 (Source : Unbounded_Array_Type;
@@ -251,7 +251,7 @@
251251 procedure Insert
252252 (Source : in out Unbounded_Array_Type;
253253 Before : Positive;
254- New_Item : String);
254+ New_Item : String_8);
255255
256256 procedure Insert
257257 (Source : in out Unbounded_Array_Type;
@@ -268,7 +268,7 @@
268268 (Source : Unbounded_Array_Type;
269269 Low : Positive;
270270 High : Natural;
271- By : String) return Unbounded_Array_Type;
271+ By : String_8) return Unbounded_Array_Type;
272272
273273 function Replace_Slice
274274 (Source : Unbounded_Array_Type;
@@ -286,7 +286,7 @@
286286 (Source : in out Unbounded_Array_Type;
287287 Low : Positive;
288288 High : Natural;
289- By : String);
289+ By : String_8);
290290
291291 procedure Replace_Slice
292292 (Source : in out Unbounded_Array_Type;
@@ -302,7 +302,7 @@
302302 function Overwrite
303303 (Source : Unbounded_Array_Type;
304304 Position : Positive;
305- New_Item : String) return Unbounded_Array_Type;
305+ New_Item : String_8) return Unbounded_Array_Type;
306306
307307 function Overwrite
308308 (Source : Unbounded_Array_Type;
@@ -317,7 +317,7 @@
317317 procedure Overwrite
318318 (Source : in out Unbounded_Array_Type;
319319 Position : Positive;
320- New_Item : String);
320+ New_Item : String_8);
321321
322322 procedure Overwrite
323323 (Source : in out Unbounded_Array_Type;
@@ -336,7 +336,7 @@
336336
337337 function "*"
338338 (Left : Natural;
339- Right : Character) return Unbounded_Array_Type;
339+ Right : Character_8) return Unbounded_Array_Type;
340340
341341 function "*"
342342 (Left : Natural;
@@ -344,7 +344,7 @@
344344
345345 function "*"
346346 (Left : Natural;
347- Right : String) return Unbounded_Array_Type;
347+ Right : String_8) return Unbounded_Array_Type;
348348
349349 function "*"
350350 (Left : Natural;
@@ -370,7 +370,7 @@
370370 return Unbounded_Array_Type;
371371
372372 procedure From_Utf8_To_Utf32 (Utf32S : in out Unbounded_Array_Type;
373- Utf8S : String;
373+ Utf8S : String_8;
374374 BOM : Boolean := False);
375375
376376 procedure From_Utf32_To_Utf8 (Utf8S : in out Unbounded_Array_Type;
Show on old repository browser