1 |
281 |
jeremybenn |
------------------------------------------------------------------------------
|
2 |
|
|
-- --
|
3 |
|
|
-- GNAT RUN-TIME COMPONENTS --
|
4 |
|
|
-- --
|
5 |
|
|
-- A D A . S T R I N G S . W I D E _ W I D E _ F I X E D --
|
6 |
|
|
-- --
|
7 |
|
|
-- S p e c --
|
8 |
|
|
-- --
|
9 |
|
|
-- This specification is derived from the Ada Reference Manual for use with --
|
10 |
|
|
-- GNAT. In accordance with the copyright of that document, you can freely --
|
11 |
|
|
-- copy and modify this specification, provided that if you redistribute a --
|
12 |
|
|
-- modified version, any changes that you have made are clearly indicated. --
|
13 |
|
|
-- --
|
14 |
|
|
------------------------------------------------------------------------------
|
15 |
|
|
|
16 |
|
|
with Ada.Strings.Wide_Wide_Maps;
|
17 |
|
|
|
18 |
|
|
package Ada.Strings.Wide_Wide_Fixed is
|
19 |
|
|
pragma Preelaborate;
|
20 |
|
|
|
21 |
|
|
------------------------------------------------------------------------
|
22 |
|
|
-- Copy Procedure for Wide_Wide_Strings of Possibly Different Lengths --
|
23 |
|
|
------------------------------------------------------------------------
|
24 |
|
|
|
25 |
|
|
procedure Move
|
26 |
|
|
(Source : Wide_Wide_String;
|
27 |
|
|
Target : out Wide_Wide_String;
|
28 |
|
|
Drop : Truncation := Error;
|
29 |
|
|
Justify : Alignment := Left;
|
30 |
|
|
Pad : Wide_Wide_Character := Ada.Strings.Wide_Wide_Space);
|
31 |
|
|
|
32 |
|
|
------------------------
|
33 |
|
|
-- Search Subprograms --
|
34 |
|
|
------------------------
|
35 |
|
|
|
36 |
|
|
function Index
|
37 |
|
|
(Source : Wide_Wide_String;
|
38 |
|
|
Pattern : Wide_Wide_String;
|
39 |
|
|
Going : Direction := Forward;
|
40 |
|
|
Mapping : Wide_Wide_Maps.Wide_Wide_Character_Mapping :=
|
41 |
|
|
Wide_Wide_Maps.Identity) return Natural;
|
42 |
|
|
|
43 |
|
|
function Index
|
44 |
|
|
(Source : Wide_Wide_String;
|
45 |
|
|
Pattern : Wide_Wide_String;
|
46 |
|
|
Going : Direction := Forward;
|
47 |
|
|
Mapping : Wide_Wide_Maps.Wide_Wide_Character_Mapping_Function)
|
48 |
|
|
return Natural;
|
49 |
|
|
|
50 |
|
|
function Index
|
51 |
|
|
(Source : Wide_Wide_String;
|
52 |
|
|
Set : Wide_Wide_Maps.Wide_Wide_Character_Set;
|
53 |
|
|
Test : Membership := Inside;
|
54 |
|
|
Going : Direction := Forward) return Natural;
|
55 |
|
|
|
56 |
|
|
function Index
|
57 |
|
|
(Source : Wide_Wide_String;
|
58 |
|
|
Pattern : Wide_Wide_String;
|
59 |
|
|
From : Positive;
|
60 |
|
|
Going : Direction := Forward;
|
61 |
|
|
Mapping : Wide_Wide_Maps.Wide_Wide_Character_Mapping :=
|
62 |
|
|
Wide_Wide_Maps.Identity)
|
63 |
|
|
return Natural;
|
64 |
|
|
pragma Ada_05 (Index);
|
65 |
|
|
|
66 |
|
|
function Index
|
67 |
|
|
(Source : Wide_Wide_String;
|
68 |
|
|
Pattern : Wide_Wide_String;
|
69 |
|
|
From : Positive;
|
70 |
|
|
Going : Direction := Forward;
|
71 |
|
|
Mapping : Wide_Wide_Maps.Wide_Wide_Character_Mapping_Function)
|
72 |
|
|
return Natural;
|
73 |
|
|
pragma Ada_05 (Index);
|
74 |
|
|
|
75 |
|
|
function Index
|
76 |
|
|
(Source : Wide_Wide_String;
|
77 |
|
|
Set : Wide_Wide_Maps.Wide_Wide_Character_Set;
|
78 |
|
|
From : Positive;
|
79 |
|
|
Test : Membership := Inside;
|
80 |
|
|
Going : Direction := Forward) return Natural;
|
81 |
|
|
pragma Ada_05 (Index);
|
82 |
|
|
|
83 |
|
|
function Index_Non_Blank
|
84 |
|
|
(Source : Wide_Wide_String;
|
85 |
|
|
Going : Direction := Forward) return Natural;
|
86 |
|
|
|
87 |
|
|
function Index_Non_Blank
|
88 |
|
|
(Source : Wide_Wide_String;
|
89 |
|
|
From : Positive;
|
90 |
|
|
Going : Direction := Forward) return Natural;
|
91 |
|
|
pragma Ada_05 (Index_Non_Blank);
|
92 |
|
|
|
93 |
|
|
function Count
|
94 |
|
|
(Source : Wide_Wide_String;
|
95 |
|
|
Pattern : Wide_Wide_String;
|
96 |
|
|
Mapping : Wide_Wide_Maps.Wide_Wide_Character_Mapping :=
|
97 |
|
|
Wide_Wide_Maps.Identity)
|
98 |
|
|
return Natural;
|
99 |
|
|
|
100 |
|
|
function Count
|
101 |
|
|
(Source : Wide_Wide_String;
|
102 |
|
|
Pattern : Wide_Wide_String;
|
103 |
|
|
Mapping : Wide_Wide_Maps.Wide_Wide_Character_Mapping_Function)
|
104 |
|
|
return Natural;
|
105 |
|
|
|
106 |
|
|
function Count
|
107 |
|
|
(Source : Wide_Wide_String;
|
108 |
|
|
Set : Wide_Wide_Maps.Wide_Wide_Character_Set) return Natural;
|
109 |
|
|
|
110 |
|
|
procedure Find_Token
|
111 |
|
|
(Source : Wide_Wide_String;
|
112 |
|
|
Set : Wide_Wide_Maps.Wide_Wide_Character_Set;
|
113 |
|
|
Test : Membership;
|
114 |
|
|
First : out Positive;
|
115 |
|
|
Last : out Natural);
|
116 |
|
|
|
117 |
|
|
----------------------------------------------
|
118 |
|
|
-- Wide_Wide_String Translation Subprograms --
|
119 |
|
|
----------------------------------------------
|
120 |
|
|
|
121 |
|
|
function Translate
|
122 |
|
|
(Source : Wide_Wide_String;
|
123 |
|
|
Mapping : Wide_Wide_Maps.Wide_Wide_Character_Mapping)
|
124 |
|
|
return Wide_Wide_String;
|
125 |
|
|
|
126 |
|
|
procedure Translate
|
127 |
|
|
(Source : in out Wide_Wide_String;
|
128 |
|
|
Mapping : Wide_Wide_Maps.Wide_Wide_Character_Mapping);
|
129 |
|
|
|
130 |
|
|
function Translate
|
131 |
|
|
(Source : Wide_Wide_String;
|
132 |
|
|
Mapping : Wide_Wide_Maps.Wide_Wide_Character_Mapping_Function)
|
133 |
|
|
return Wide_Wide_String;
|
134 |
|
|
|
135 |
|
|
procedure Translate
|
136 |
|
|
(Source : in out Wide_Wide_String;
|
137 |
|
|
Mapping : Wide_Wide_Maps.Wide_Wide_Character_Mapping_Function);
|
138 |
|
|
|
139 |
|
|
-------------------------------------------------
|
140 |
|
|
-- Wide_Wide_String Transformation Subprograms --
|
141 |
|
|
-------------------------------------------------
|
142 |
|
|
|
143 |
|
|
function Replace_Slice
|
144 |
|
|
(Source : Wide_Wide_String;
|
145 |
|
|
Low : Positive;
|
146 |
|
|
High : Natural;
|
147 |
|
|
By : Wide_Wide_String) return Wide_Wide_String;
|
148 |
|
|
|
149 |
|
|
procedure Replace_Slice
|
150 |
|
|
(Source : in out Wide_Wide_String;
|
151 |
|
|
Low : Positive;
|
152 |
|
|
High : Natural;
|
153 |
|
|
By : Wide_Wide_String;
|
154 |
|
|
Drop : Truncation := Error;
|
155 |
|
|
Justify : Alignment := Left;
|
156 |
|
|
Pad : Wide_Wide_Character := Ada.Strings.Wide_Wide_Space);
|
157 |
|
|
|
158 |
|
|
function Insert
|
159 |
|
|
(Source : Wide_Wide_String;
|
160 |
|
|
Before : Positive;
|
161 |
|
|
New_Item : Wide_Wide_String) return Wide_Wide_String;
|
162 |
|
|
|
163 |
|
|
procedure Insert
|
164 |
|
|
(Source : in out Wide_Wide_String;
|
165 |
|
|
Before : Positive;
|
166 |
|
|
New_Item : Wide_Wide_String;
|
167 |
|
|
Drop : Truncation := Error);
|
168 |
|
|
|
169 |
|
|
function Overwrite
|
170 |
|
|
(Source : Wide_Wide_String;
|
171 |
|
|
Position : Positive;
|
172 |
|
|
New_Item : Wide_Wide_String) return Wide_Wide_String;
|
173 |
|
|
|
174 |
|
|
procedure Overwrite
|
175 |
|
|
(Source : in out Wide_Wide_String;
|
176 |
|
|
Position : Positive;
|
177 |
|
|
New_Item : Wide_Wide_String;
|
178 |
|
|
Drop : Truncation := Right);
|
179 |
|
|
|
180 |
|
|
function Delete
|
181 |
|
|
(Source : Wide_Wide_String;
|
182 |
|
|
From : Positive;
|
183 |
|
|
Through : Natural) return Wide_Wide_String;
|
184 |
|
|
|
185 |
|
|
procedure Delete
|
186 |
|
|
(Source : in out Wide_Wide_String;
|
187 |
|
|
From : Positive;
|
188 |
|
|
Through : Natural;
|
189 |
|
|
Justify : Alignment := Left;
|
190 |
|
|
Pad : Wide_Wide_Character := Ada.Strings.Wide_Wide_Space);
|
191 |
|
|
|
192 |
|
|
-------------------------------------------
|
193 |
|
|
-- Wide_Wide_String Selector Subprograms --
|
194 |
|
|
-------------------------------------------
|
195 |
|
|
|
196 |
|
|
function Trim
|
197 |
|
|
(Source : Wide_Wide_String;
|
198 |
|
|
Side : Trim_End) return Wide_Wide_String;
|
199 |
|
|
|
200 |
|
|
procedure Trim
|
201 |
|
|
(Source : in out Wide_Wide_String;
|
202 |
|
|
Side : Trim_End;
|
203 |
|
|
Justify : Alignment := Left;
|
204 |
|
|
Pad : Wide_Wide_Character := Wide_Wide_Space);
|
205 |
|
|
|
206 |
|
|
function Trim
|
207 |
|
|
(Source : Wide_Wide_String;
|
208 |
|
|
Left : Wide_Wide_Maps.Wide_Wide_Character_Set;
|
209 |
|
|
Right : Wide_Wide_Maps.Wide_Wide_Character_Set)
|
210 |
|
|
return Wide_Wide_String;
|
211 |
|
|
|
212 |
|
|
procedure Trim
|
213 |
|
|
(Source : in out Wide_Wide_String;
|
214 |
|
|
Left : Wide_Wide_Maps.Wide_Wide_Character_Set;
|
215 |
|
|
Right : Wide_Wide_Maps.Wide_Wide_Character_Set;
|
216 |
|
|
Justify : Alignment := Ada.Strings.Left;
|
217 |
|
|
Pad : Wide_Wide_Character := Ada.Strings.Wide_Wide_Space);
|
218 |
|
|
|
219 |
|
|
function Head
|
220 |
|
|
(Source : Wide_Wide_String;
|
221 |
|
|
Count : Natural;
|
222 |
|
|
Pad : Wide_Wide_Character := Ada.Strings.Wide_Wide_Space)
|
223 |
|
|
return Wide_Wide_String;
|
224 |
|
|
|
225 |
|
|
procedure Head
|
226 |
|
|
(Source : in out Wide_Wide_String;
|
227 |
|
|
Count : Natural;
|
228 |
|
|
Justify : Alignment := Left;
|
229 |
|
|
Pad : Wide_Wide_Character := Ada.Strings.Wide_Wide_Space);
|
230 |
|
|
|
231 |
|
|
function Tail
|
232 |
|
|
(Source : Wide_Wide_String;
|
233 |
|
|
Count : Natural;
|
234 |
|
|
Pad : Wide_Wide_Character := Ada.Strings.Wide_Wide_Space)
|
235 |
|
|
return Wide_Wide_String;
|
236 |
|
|
|
237 |
|
|
procedure Tail
|
238 |
|
|
(Source : in out Wide_Wide_String;
|
239 |
|
|
Count : Natural;
|
240 |
|
|
Justify : Alignment := Left;
|
241 |
|
|
Pad : Wide_Wide_Character := Ada.Strings.Wide_Wide_Space);
|
242 |
|
|
|
243 |
|
|
--------------------------------------------
|
244 |
|
|
-- Wide_Wide_String Constructor Functions --
|
245 |
|
|
--------------------------------------------
|
246 |
|
|
|
247 |
|
|
function "*"
|
248 |
|
|
(Left : Natural;
|
249 |
|
|
Right : Wide_Wide_Character) return Wide_Wide_String;
|
250 |
|
|
|
251 |
|
|
function "*"
|
252 |
|
|
(Left : Natural;
|
253 |
|
|
Right : Wide_Wide_String) return Wide_Wide_String;
|
254 |
|
|
|
255 |
|
|
end Ada.Strings.Wide_Wide_Fixed;
|