annotate gcc/ada/libgnat/a-stzunb.ads @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children 1830386684a0
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 ------------------------------------------------------------------------------
kono
parents:
diff changeset
2 -- --
kono
parents:
diff changeset
3 -- GNAT RUN-TIME COMPONENTS --
kono
parents:
diff changeset
4 -- --
kono
parents:
diff changeset
5 -- A D A . S T R I N G S . W I D E _ W I D E _ U N B O U N D E D --
kono
parents:
diff changeset
6 -- --
kono
parents:
diff changeset
7 -- S p e c --
kono
parents:
diff changeset
8 -- --
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
9 -- Copyright (C) 1992-2018, Free Software Foundation, Inc. --
111
kono
parents:
diff changeset
10 -- --
kono
parents:
diff changeset
11 -- This specification is derived from the Ada Reference Manual for use with --
kono
parents:
diff changeset
12 -- GNAT. The copyright notice above, and the license provisions that follow --
kono
parents:
diff changeset
13 -- apply solely to the contents of the part following the private keyword. --
kono
parents:
diff changeset
14 -- --
kono
parents:
diff changeset
15 -- GNAT is free software; you can redistribute it and/or modify it under --
kono
parents:
diff changeset
16 -- terms of the GNU General Public License as published by the Free Soft- --
kono
parents:
diff changeset
17 -- ware Foundation; either version 3, or (at your option) any later ver- --
kono
parents:
diff changeset
18 -- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
kono
parents:
diff changeset
19 -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
kono
parents:
diff changeset
20 -- or FITNESS FOR A PARTICULAR PURPOSE. --
kono
parents:
diff changeset
21 -- --
kono
parents:
diff changeset
22 -- As a special exception under Section 7 of GPL version 3, you are granted --
kono
parents:
diff changeset
23 -- additional permissions described in the GCC Runtime Library Exception, --
kono
parents:
diff changeset
24 -- version 3.1, as published by the Free Software Foundation. --
kono
parents:
diff changeset
25 -- --
kono
parents:
diff changeset
26 -- You should have received a copy of the GNU General Public License and --
kono
parents:
diff changeset
27 -- a copy of the GCC Runtime Library Exception along with this program; --
kono
parents:
diff changeset
28 -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
kono
parents:
diff changeset
29 -- <http://www.gnu.org/licenses/>. --
kono
parents:
diff changeset
30 -- --
kono
parents:
diff changeset
31 -- GNAT was originally developed by the GNAT team at New York University. --
kono
parents:
diff changeset
32 -- Extensive contributions were provided by Ada Core Technologies Inc. --
kono
parents:
diff changeset
33 -- --
kono
parents:
diff changeset
34 ------------------------------------------------------------------------------
kono
parents:
diff changeset
35
kono
parents:
diff changeset
36 with Ada.Strings.Wide_Wide_Maps;
kono
parents:
diff changeset
37 with Ada.Finalization;
kono
parents:
diff changeset
38
kono
parents:
diff changeset
39 package Ada.Strings.Wide_Wide_Unbounded is
kono
parents:
diff changeset
40 pragma Preelaborate;
kono
parents:
diff changeset
41
kono
parents:
diff changeset
42 type Unbounded_Wide_Wide_String is private;
kono
parents:
diff changeset
43 pragma Preelaborable_Initialization (Unbounded_Wide_Wide_String);
kono
parents:
diff changeset
44
kono
parents:
diff changeset
45 Null_Unbounded_Wide_Wide_String : constant Unbounded_Wide_Wide_String;
kono
parents:
diff changeset
46
kono
parents:
diff changeset
47 function Length (Source : Unbounded_Wide_Wide_String) return Natural;
kono
parents:
diff changeset
48
kono
parents:
diff changeset
49 type Wide_Wide_String_Access is access all Wide_Wide_String;
kono
parents:
diff changeset
50
kono
parents:
diff changeset
51 procedure Free (X : in out Wide_Wide_String_Access);
kono
parents:
diff changeset
52
kono
parents:
diff changeset
53 --------------------------------------------------------
kono
parents:
diff changeset
54 -- Conversion, Concatenation, and Selection Functions --
kono
parents:
diff changeset
55 --------------------------------------------------------
kono
parents:
diff changeset
56
kono
parents:
diff changeset
57 function To_Unbounded_Wide_Wide_String
kono
parents:
diff changeset
58 (Source : Wide_Wide_String) return Unbounded_Wide_Wide_String;
kono
parents:
diff changeset
59
kono
parents:
diff changeset
60 function To_Unbounded_Wide_Wide_String
kono
parents:
diff changeset
61 (Length : Natural) return Unbounded_Wide_Wide_String;
kono
parents:
diff changeset
62
kono
parents:
diff changeset
63 function To_Wide_Wide_String
kono
parents:
diff changeset
64 (Source : Unbounded_Wide_Wide_String) return Wide_Wide_String;
kono
parents:
diff changeset
65
kono
parents:
diff changeset
66 procedure Set_Unbounded_Wide_Wide_String
kono
parents:
diff changeset
67 (Target : out Unbounded_Wide_Wide_String;
kono
parents:
diff changeset
68 Source : Wide_Wide_String);
kono
parents:
diff changeset
69 pragma Ada_05 (Set_Unbounded_Wide_Wide_String);
kono
parents:
diff changeset
70
kono
parents:
diff changeset
71 procedure Append
kono
parents:
diff changeset
72 (Source : in out Unbounded_Wide_Wide_String;
kono
parents:
diff changeset
73 New_Item : Unbounded_Wide_Wide_String);
kono
parents:
diff changeset
74
kono
parents:
diff changeset
75 procedure Append
kono
parents:
diff changeset
76 (Source : in out Unbounded_Wide_Wide_String;
kono
parents:
diff changeset
77 New_Item : Wide_Wide_String);
kono
parents:
diff changeset
78
kono
parents:
diff changeset
79 procedure Append
kono
parents:
diff changeset
80 (Source : in out Unbounded_Wide_Wide_String;
kono
parents:
diff changeset
81 New_Item : Wide_Wide_Character);
kono
parents:
diff changeset
82
kono
parents:
diff changeset
83 function "&"
kono
parents:
diff changeset
84 (Left : Unbounded_Wide_Wide_String;
kono
parents:
diff changeset
85 Right : Unbounded_Wide_Wide_String) return Unbounded_Wide_Wide_String;
kono
parents:
diff changeset
86
kono
parents:
diff changeset
87 function "&"
kono
parents:
diff changeset
88 (Left : Unbounded_Wide_Wide_String;
kono
parents:
diff changeset
89 Right : Wide_Wide_String) return Unbounded_Wide_Wide_String;
kono
parents:
diff changeset
90
kono
parents:
diff changeset
91 function "&"
kono
parents:
diff changeset
92 (Left : Wide_Wide_String;
kono
parents:
diff changeset
93 Right : Unbounded_Wide_Wide_String) return Unbounded_Wide_Wide_String;
kono
parents:
diff changeset
94
kono
parents:
diff changeset
95 function "&"
kono
parents:
diff changeset
96 (Left : Unbounded_Wide_Wide_String;
kono
parents:
diff changeset
97 Right : Wide_Wide_Character) return Unbounded_Wide_Wide_String;
kono
parents:
diff changeset
98
kono
parents:
diff changeset
99 function "&"
kono
parents:
diff changeset
100 (Left : Wide_Wide_Character;
kono
parents:
diff changeset
101 Right : Unbounded_Wide_Wide_String) return Unbounded_Wide_Wide_String;
kono
parents:
diff changeset
102
kono
parents:
diff changeset
103 function Element
kono
parents:
diff changeset
104 (Source : Unbounded_Wide_Wide_String;
kono
parents:
diff changeset
105 Index : Positive) return Wide_Wide_Character;
kono
parents:
diff changeset
106
kono
parents:
diff changeset
107 procedure Replace_Element
kono
parents:
diff changeset
108 (Source : in out Unbounded_Wide_Wide_String;
kono
parents:
diff changeset
109 Index : Positive;
kono
parents:
diff changeset
110 By : Wide_Wide_Character);
kono
parents:
diff changeset
111
kono
parents:
diff changeset
112 function Slice
kono
parents:
diff changeset
113 (Source : Unbounded_Wide_Wide_String;
kono
parents:
diff changeset
114 Low : Positive;
kono
parents:
diff changeset
115 High : Natural) return Wide_Wide_String;
kono
parents:
diff changeset
116
kono
parents:
diff changeset
117 function Unbounded_Slice
kono
parents:
diff changeset
118 (Source : Unbounded_Wide_Wide_String;
kono
parents:
diff changeset
119 Low : Positive;
kono
parents:
diff changeset
120 High : Natural) return Unbounded_Wide_Wide_String;
kono
parents:
diff changeset
121 pragma Ada_05 (Unbounded_Slice);
kono
parents:
diff changeset
122
kono
parents:
diff changeset
123 procedure Unbounded_Slice
kono
parents:
diff changeset
124 (Source : Unbounded_Wide_Wide_String;
kono
parents:
diff changeset
125 Target : out Unbounded_Wide_Wide_String;
kono
parents:
diff changeset
126 Low : Positive;
kono
parents:
diff changeset
127 High : Natural);
kono
parents:
diff changeset
128 pragma Ada_05 (Unbounded_Slice);
kono
parents:
diff changeset
129
kono
parents:
diff changeset
130 function "="
kono
parents:
diff changeset
131 (Left : Unbounded_Wide_Wide_String;
kono
parents:
diff changeset
132 Right : Unbounded_Wide_Wide_String) return Boolean;
kono
parents:
diff changeset
133
kono
parents:
diff changeset
134 function "="
kono
parents:
diff changeset
135 (Left : Unbounded_Wide_Wide_String;
kono
parents:
diff changeset
136 Right : Wide_Wide_String) return Boolean;
kono
parents:
diff changeset
137
kono
parents:
diff changeset
138 function "="
kono
parents:
diff changeset
139 (Left : Wide_Wide_String;
kono
parents:
diff changeset
140 Right : Unbounded_Wide_Wide_String) return Boolean;
kono
parents:
diff changeset
141
kono
parents:
diff changeset
142 function "<"
kono
parents:
diff changeset
143 (Left : Unbounded_Wide_Wide_String;
kono
parents:
diff changeset
144 Right : Unbounded_Wide_Wide_String) return Boolean;
kono
parents:
diff changeset
145
kono
parents:
diff changeset
146 function "<"
kono
parents:
diff changeset
147 (Left : Unbounded_Wide_Wide_String;
kono
parents:
diff changeset
148 Right : Wide_Wide_String) return Boolean;
kono
parents:
diff changeset
149
kono
parents:
diff changeset
150 function "<"
kono
parents:
diff changeset
151 (Left : Wide_Wide_String;
kono
parents:
diff changeset
152 Right : Unbounded_Wide_Wide_String) return Boolean;
kono
parents:
diff changeset
153
kono
parents:
diff changeset
154 function "<="
kono
parents:
diff changeset
155 (Left : Unbounded_Wide_Wide_String;
kono
parents:
diff changeset
156 Right : Unbounded_Wide_Wide_String) return Boolean;
kono
parents:
diff changeset
157
kono
parents:
diff changeset
158 function "<="
kono
parents:
diff changeset
159 (Left : Unbounded_Wide_Wide_String;
kono
parents:
diff changeset
160 Right : Wide_Wide_String) return Boolean;
kono
parents:
diff changeset
161
kono
parents:
diff changeset
162 function "<="
kono
parents:
diff changeset
163 (Left : Wide_Wide_String;
kono
parents:
diff changeset
164 Right : Unbounded_Wide_Wide_String) return Boolean;
kono
parents:
diff changeset
165
kono
parents:
diff changeset
166 function ">"
kono
parents:
diff changeset
167 (Left : Unbounded_Wide_Wide_String;
kono
parents:
diff changeset
168 Right : Unbounded_Wide_Wide_String) return Boolean;
kono
parents:
diff changeset
169
kono
parents:
diff changeset
170 function ">"
kono
parents:
diff changeset
171 (Left : Unbounded_Wide_Wide_String;
kono
parents:
diff changeset
172 Right : Wide_Wide_String) return Boolean;
kono
parents:
diff changeset
173
kono
parents:
diff changeset
174 function ">"
kono
parents:
diff changeset
175 (Left : Wide_Wide_String;
kono
parents:
diff changeset
176 Right : Unbounded_Wide_Wide_String) return Boolean;
kono
parents:
diff changeset
177
kono
parents:
diff changeset
178 function ">="
kono
parents:
diff changeset
179 (Left : Unbounded_Wide_Wide_String;
kono
parents:
diff changeset
180 Right : Unbounded_Wide_Wide_String) return Boolean;
kono
parents:
diff changeset
181
kono
parents:
diff changeset
182 function ">="
kono
parents:
diff changeset
183 (Left : Unbounded_Wide_Wide_String;
kono
parents:
diff changeset
184 Right : Wide_Wide_String) return Boolean;
kono
parents:
diff changeset
185
kono
parents:
diff changeset
186 function ">="
kono
parents:
diff changeset
187 (Left : Wide_Wide_String;
kono
parents:
diff changeset
188 Right : Unbounded_Wide_Wide_String) return Boolean;
kono
parents:
diff changeset
189
kono
parents:
diff changeset
190 ------------------------
kono
parents:
diff changeset
191 -- Search Subprograms --
kono
parents:
diff changeset
192 ------------------------
kono
parents:
diff changeset
193
kono
parents:
diff changeset
194 function Index
kono
parents:
diff changeset
195 (Source : Unbounded_Wide_Wide_String;
kono
parents:
diff changeset
196 Pattern : Wide_Wide_String;
kono
parents:
diff changeset
197 Going : Direction := Forward;
kono
parents:
diff changeset
198 Mapping : Wide_Wide_Maps.Wide_Wide_Character_Mapping :=
kono
parents:
diff changeset
199 Wide_Wide_Maps.Identity)
kono
parents:
diff changeset
200 return Natural;
kono
parents:
diff changeset
201
kono
parents:
diff changeset
202 function Index
kono
parents:
diff changeset
203 (Source : Unbounded_Wide_Wide_String;
kono
parents:
diff changeset
204 Pattern : Wide_Wide_String;
kono
parents:
diff changeset
205 Going : Direction := Forward;
kono
parents:
diff changeset
206 Mapping : Wide_Wide_Maps.Wide_Wide_Character_Mapping_Function)
kono
parents:
diff changeset
207 return Natural;
kono
parents:
diff changeset
208
kono
parents:
diff changeset
209 function Index
kono
parents:
diff changeset
210 (Source : Unbounded_Wide_Wide_String;
kono
parents:
diff changeset
211 Set : Wide_Wide_Maps.Wide_Wide_Character_Set;
kono
parents:
diff changeset
212 Test : Membership := Inside;
kono
parents:
diff changeset
213 Going : Direction := Forward) return Natural;
kono
parents:
diff changeset
214
kono
parents:
diff changeset
215 function Index
kono
parents:
diff changeset
216 (Source : Unbounded_Wide_Wide_String;
kono
parents:
diff changeset
217 Pattern : Wide_Wide_String;
kono
parents:
diff changeset
218 From : Positive;
kono
parents:
diff changeset
219 Going : Direction := Forward;
kono
parents:
diff changeset
220 Mapping : Wide_Wide_Maps.Wide_Wide_Character_Mapping :=
kono
parents:
diff changeset
221 Wide_Wide_Maps.Identity)
kono
parents:
diff changeset
222 return Natural;
kono
parents:
diff changeset
223 pragma Ada_05 (Index);
kono
parents:
diff changeset
224
kono
parents:
diff changeset
225 function Index
kono
parents:
diff changeset
226 (Source : Unbounded_Wide_Wide_String;
kono
parents:
diff changeset
227 Pattern : Wide_Wide_String;
kono
parents:
diff changeset
228 From : Positive;
kono
parents:
diff changeset
229 Going : Direction := Forward;
kono
parents:
diff changeset
230 Mapping : Wide_Wide_Maps.Wide_Wide_Character_Mapping_Function)
kono
parents:
diff changeset
231 return Natural;
kono
parents:
diff changeset
232 pragma Ada_05 (Index);
kono
parents:
diff changeset
233
kono
parents:
diff changeset
234 function Index
kono
parents:
diff changeset
235 (Source : Unbounded_Wide_Wide_String;
kono
parents:
diff changeset
236 Set : Wide_Wide_Maps.Wide_Wide_Character_Set;
kono
parents:
diff changeset
237 From : Positive;
kono
parents:
diff changeset
238 Test : Membership := Inside;
kono
parents:
diff changeset
239 Going : Direction := Forward) return Natural;
kono
parents:
diff changeset
240 pragma Ada_05 (Index);
kono
parents:
diff changeset
241
kono
parents:
diff changeset
242 function Index_Non_Blank
kono
parents:
diff changeset
243 (Source : Unbounded_Wide_Wide_String;
kono
parents:
diff changeset
244 Going : Direction := Forward) return Natural;
kono
parents:
diff changeset
245
kono
parents:
diff changeset
246 function Index_Non_Blank
kono
parents:
diff changeset
247 (Source : Unbounded_Wide_Wide_String;
kono
parents:
diff changeset
248 From : Positive;
kono
parents:
diff changeset
249 Going : Direction := Forward) return Natural;
kono
parents:
diff changeset
250 pragma Ada_05 (Index_Non_Blank);
kono
parents:
diff changeset
251
kono
parents:
diff changeset
252 function Count
kono
parents:
diff changeset
253 (Source : Unbounded_Wide_Wide_String;
kono
parents:
diff changeset
254 Pattern : Wide_Wide_String;
kono
parents:
diff changeset
255 Mapping : Wide_Wide_Maps.Wide_Wide_Character_Mapping :=
kono
parents:
diff changeset
256 Wide_Wide_Maps.Identity)
kono
parents:
diff changeset
257 return Natural;
kono
parents:
diff changeset
258
kono
parents:
diff changeset
259 function Count
kono
parents:
diff changeset
260 (Source : Unbounded_Wide_Wide_String;
kono
parents:
diff changeset
261 Pattern : Wide_Wide_String;
kono
parents:
diff changeset
262 Mapping : Wide_Wide_Maps.Wide_Wide_Character_Mapping_Function)
kono
parents:
diff changeset
263 return Natural;
kono
parents:
diff changeset
264
kono
parents:
diff changeset
265 function Count
kono
parents:
diff changeset
266 (Source : Unbounded_Wide_Wide_String;
kono
parents:
diff changeset
267 Set : Wide_Wide_Maps.Wide_Wide_Character_Set) return Natural;
kono
parents:
diff changeset
268
kono
parents:
diff changeset
269 procedure Find_Token
kono
parents:
diff changeset
270 (Source : Unbounded_Wide_Wide_String;
kono
parents:
diff changeset
271 Set : Wide_Wide_Maps.Wide_Wide_Character_Set;
kono
parents:
diff changeset
272 From : Positive;
kono
parents:
diff changeset
273 Test : Membership;
kono
parents:
diff changeset
274 First : out Positive;
kono
parents:
diff changeset
275 Last : out Natural);
kono
parents:
diff changeset
276 pragma Ada_2012 (Find_Token);
kono
parents:
diff changeset
277
kono
parents:
diff changeset
278 procedure Find_Token
kono
parents:
diff changeset
279 (Source : Unbounded_Wide_Wide_String;
kono
parents:
diff changeset
280 Set : Wide_Wide_Maps.Wide_Wide_Character_Set;
kono
parents:
diff changeset
281 Test : Membership;
kono
parents:
diff changeset
282 First : out Positive;
kono
parents:
diff changeset
283 Last : out Natural);
kono
parents:
diff changeset
284
kono
parents:
diff changeset
285 ------------------------------------
kono
parents:
diff changeset
286 -- String Translation Subprograms --
kono
parents:
diff changeset
287 ------------------------------------
kono
parents:
diff changeset
288
kono
parents:
diff changeset
289 function Translate
kono
parents:
diff changeset
290 (Source : Unbounded_Wide_Wide_String;
kono
parents:
diff changeset
291 Mapping : Wide_Wide_Maps.Wide_Wide_Character_Mapping)
kono
parents:
diff changeset
292 return Unbounded_Wide_Wide_String;
kono
parents:
diff changeset
293
kono
parents:
diff changeset
294 procedure Translate
kono
parents:
diff changeset
295 (Source : in out Unbounded_Wide_Wide_String;
kono
parents:
diff changeset
296 Mapping : Wide_Wide_Maps.Wide_Wide_Character_Mapping);
kono
parents:
diff changeset
297
kono
parents:
diff changeset
298 function Translate
kono
parents:
diff changeset
299 (Source : Unbounded_Wide_Wide_String;
kono
parents:
diff changeset
300 Mapping : Wide_Wide_Maps.Wide_Wide_Character_Mapping_Function)
kono
parents:
diff changeset
301 return Unbounded_Wide_Wide_String;
kono
parents:
diff changeset
302
kono
parents:
diff changeset
303 procedure Translate
kono
parents:
diff changeset
304 (Source : in out Unbounded_Wide_Wide_String;
kono
parents:
diff changeset
305 Mapping : Wide_Wide_Maps.Wide_Wide_Character_Mapping_Function);
kono
parents:
diff changeset
306
kono
parents:
diff changeset
307 ---------------------------------------
kono
parents:
diff changeset
308 -- String Transformation Subprograms --
kono
parents:
diff changeset
309 ---------------------------------------
kono
parents:
diff changeset
310
kono
parents:
diff changeset
311 function Replace_Slice
kono
parents:
diff changeset
312 (Source : Unbounded_Wide_Wide_String;
kono
parents:
diff changeset
313 Low : Positive;
kono
parents:
diff changeset
314 High : Natural;
kono
parents:
diff changeset
315 By : Wide_Wide_String) return Unbounded_Wide_Wide_String;
kono
parents:
diff changeset
316
kono
parents:
diff changeset
317 procedure Replace_Slice
kono
parents:
diff changeset
318 (Source : in out Unbounded_Wide_Wide_String;
kono
parents:
diff changeset
319 Low : Positive;
kono
parents:
diff changeset
320 High : Natural;
kono
parents:
diff changeset
321 By : Wide_Wide_String);
kono
parents:
diff changeset
322
kono
parents:
diff changeset
323 function Insert
kono
parents:
diff changeset
324 (Source : Unbounded_Wide_Wide_String;
kono
parents:
diff changeset
325 Before : Positive;
kono
parents:
diff changeset
326 New_Item : Wide_Wide_String) return Unbounded_Wide_Wide_String;
kono
parents:
diff changeset
327
kono
parents:
diff changeset
328 procedure Insert
kono
parents:
diff changeset
329 (Source : in out Unbounded_Wide_Wide_String;
kono
parents:
diff changeset
330 Before : Positive;
kono
parents:
diff changeset
331 New_Item : Wide_Wide_String);
kono
parents:
diff changeset
332
kono
parents:
diff changeset
333 function Overwrite
kono
parents:
diff changeset
334 (Source : Unbounded_Wide_Wide_String;
kono
parents:
diff changeset
335 Position : Positive;
kono
parents:
diff changeset
336 New_Item : Wide_Wide_String) return Unbounded_Wide_Wide_String;
kono
parents:
diff changeset
337
kono
parents:
diff changeset
338 procedure Overwrite
kono
parents:
diff changeset
339 (Source : in out Unbounded_Wide_Wide_String;
kono
parents:
diff changeset
340 Position : Positive;
kono
parents:
diff changeset
341 New_Item : Wide_Wide_String);
kono
parents:
diff changeset
342
kono
parents:
diff changeset
343 function Delete
kono
parents:
diff changeset
344 (Source : Unbounded_Wide_Wide_String;
kono
parents:
diff changeset
345 From : Positive;
kono
parents:
diff changeset
346 Through : Natural) return Unbounded_Wide_Wide_String;
kono
parents:
diff changeset
347
kono
parents:
diff changeset
348 procedure Delete
kono
parents:
diff changeset
349 (Source : in out Unbounded_Wide_Wide_String;
kono
parents:
diff changeset
350 From : Positive;
kono
parents:
diff changeset
351 Through : Natural);
kono
parents:
diff changeset
352
kono
parents:
diff changeset
353 function Trim
kono
parents:
diff changeset
354 (Source : Unbounded_Wide_Wide_String;
kono
parents:
diff changeset
355 Side : Trim_End) return Unbounded_Wide_Wide_String;
kono
parents:
diff changeset
356
kono
parents:
diff changeset
357 procedure Trim
kono
parents:
diff changeset
358 (Source : in out Unbounded_Wide_Wide_String;
kono
parents:
diff changeset
359 Side : Trim_End);
kono
parents:
diff changeset
360
kono
parents:
diff changeset
361 function Trim
kono
parents:
diff changeset
362 (Source : Unbounded_Wide_Wide_String;
kono
parents:
diff changeset
363 Left : Wide_Wide_Maps.Wide_Wide_Character_Set;
kono
parents:
diff changeset
364 Right : Wide_Wide_Maps.Wide_Wide_Character_Set)
kono
parents:
diff changeset
365 return Unbounded_Wide_Wide_String;
kono
parents:
diff changeset
366
kono
parents:
diff changeset
367 procedure Trim
kono
parents:
diff changeset
368 (Source : in out Unbounded_Wide_Wide_String;
kono
parents:
diff changeset
369 Left : Wide_Wide_Maps.Wide_Wide_Character_Set;
kono
parents:
diff changeset
370 Right : Wide_Wide_Maps.Wide_Wide_Character_Set);
kono
parents:
diff changeset
371
kono
parents:
diff changeset
372 function Head
kono
parents:
diff changeset
373 (Source : Unbounded_Wide_Wide_String;
kono
parents:
diff changeset
374 Count : Natural;
kono
parents:
diff changeset
375 Pad : Wide_Wide_Character := Wide_Wide_Space)
kono
parents:
diff changeset
376 return Unbounded_Wide_Wide_String;
kono
parents:
diff changeset
377
kono
parents:
diff changeset
378 procedure Head
kono
parents:
diff changeset
379 (Source : in out Unbounded_Wide_Wide_String;
kono
parents:
diff changeset
380 Count : Natural;
kono
parents:
diff changeset
381 Pad : Wide_Wide_Character := Wide_Wide_Space);
kono
parents:
diff changeset
382
kono
parents:
diff changeset
383 function Tail
kono
parents:
diff changeset
384 (Source : Unbounded_Wide_Wide_String;
kono
parents:
diff changeset
385 Count : Natural;
kono
parents:
diff changeset
386 Pad : Wide_Wide_Character := Wide_Wide_Space)
kono
parents:
diff changeset
387 return Unbounded_Wide_Wide_String;
kono
parents:
diff changeset
388
kono
parents:
diff changeset
389 procedure Tail
kono
parents:
diff changeset
390 (Source : in out Unbounded_Wide_Wide_String;
kono
parents:
diff changeset
391 Count : Natural;
kono
parents:
diff changeset
392 Pad : Wide_Wide_Character := Wide_Wide_Space);
kono
parents:
diff changeset
393
kono
parents:
diff changeset
394 function "*"
kono
parents:
diff changeset
395 (Left : Natural;
kono
parents:
diff changeset
396 Right : Wide_Wide_Character) return Unbounded_Wide_Wide_String;
kono
parents:
diff changeset
397
kono
parents:
diff changeset
398 function "*"
kono
parents:
diff changeset
399 (Left : Natural;
kono
parents:
diff changeset
400 Right : Wide_Wide_String) return Unbounded_Wide_Wide_String;
kono
parents:
diff changeset
401
kono
parents:
diff changeset
402 function "*"
kono
parents:
diff changeset
403 (Left : Natural;
kono
parents:
diff changeset
404 Right : Unbounded_Wide_Wide_String) return Unbounded_Wide_Wide_String;
kono
parents:
diff changeset
405
kono
parents:
diff changeset
406 private
kono
parents:
diff changeset
407 pragma Inline (Length);
kono
parents:
diff changeset
408
kono
parents:
diff changeset
409 package AF renames Ada.Finalization;
kono
parents:
diff changeset
410
kono
parents:
diff changeset
411 Null_Wide_Wide_String : aliased Wide_Wide_String := "";
kono
parents:
diff changeset
412
kono
parents:
diff changeset
413 function To_Unbounded_Wide
kono
parents:
diff changeset
414 (S : Wide_Wide_String) return Unbounded_Wide_Wide_String
kono
parents:
diff changeset
415 renames To_Unbounded_Wide_Wide_String;
kono
parents:
diff changeset
416
kono
parents:
diff changeset
417 type Unbounded_Wide_Wide_String is new AF.Controlled with record
kono
parents:
diff changeset
418 Reference : Wide_Wide_String_Access := Null_Wide_Wide_String'Access;
kono
parents:
diff changeset
419 Last : Natural := 0;
kono
parents:
diff changeset
420 end record;
kono
parents:
diff changeset
421
kono
parents:
diff changeset
422 -- The Unbounded_Wide_Wide_String is using a buffered implementation to
kono
parents:
diff changeset
423 -- increase speed of the Append/Delete/Insert procedures. The Reference
kono
parents:
diff changeset
424 -- string pointer above contains the current string value and extra room
kono
parents:
diff changeset
425 -- at the end to be used by the next Append routine. Last is the index of
kono
parents:
diff changeset
426 -- the string ending character. So the current string value is really
kono
parents:
diff changeset
427 -- Reference (1 .. Last).
kono
parents:
diff changeset
428
kono
parents:
diff changeset
429 pragma Stream_Convert
kono
parents:
diff changeset
430 (Unbounded_Wide_Wide_String, To_Unbounded_Wide, To_Wide_Wide_String);
kono
parents:
diff changeset
431
kono
parents:
diff changeset
432 pragma Finalize_Storage_Only (Unbounded_Wide_Wide_String);
kono
parents:
diff changeset
433 -- Finalization is required only for freeing storage
kono
parents:
diff changeset
434
kono
parents:
diff changeset
435 procedure Initialize (Object : in out Unbounded_Wide_Wide_String);
kono
parents:
diff changeset
436 procedure Adjust (Object : in out Unbounded_Wide_Wide_String);
kono
parents:
diff changeset
437 procedure Finalize (Object : in out Unbounded_Wide_Wide_String);
kono
parents:
diff changeset
438 procedure Realloc_For_Chunk
kono
parents:
diff changeset
439 (Source : in out Unbounded_Wide_Wide_String;
kono
parents:
diff changeset
440 Chunk_Size : Natural);
kono
parents:
diff changeset
441 -- Adjust the size allocated for the string. Add at least Chunk_Size so it
kono
parents:
diff changeset
442 -- is safe to add a string of this size at the end of the current content.
kono
parents:
diff changeset
443 -- The real size allocated for the string is Chunk_Size + x of the current
kono
parents:
diff changeset
444 -- string size. This buffered handling makes the Append unbounded string
kono
parents:
diff changeset
445 -- routines very fast.
kono
parents:
diff changeset
446
kono
parents:
diff changeset
447 Null_Unbounded_Wide_Wide_String : constant Unbounded_Wide_Wide_String :=
kono
parents:
diff changeset
448 (AF.Controlled with
kono
parents:
diff changeset
449 Reference =>
kono
parents:
diff changeset
450 Null_Wide_Wide_String'Access,
kono
parents:
diff changeset
451 Last => 0);
kono
parents:
diff changeset
452 end Ada.Strings.Wide_Wide_Unbounded;