]>
Commit | Line | Data |
---|---|---|
d23b8f57 RK |
1 | ------------------------------------------------------------------------------ |
2 | -- -- | |
3 | -- GNAT RUN-TIME COMPONENTS -- | |
4 | -- -- | |
5 | -- A D A . S T R I N G S . B O U N D E D -- | |
6 | -- -- | |
7 | -- S p e c -- | |
8 | -- -- | |
748086b7 | 9 | -- Copyright (C) 1992-2009, Free Software Foundation, Inc. -- |
d23b8f57 RK |
10 | -- -- |
11 | -- This specification is derived from the Ada Reference Manual for use with -- | |
12 | -- GNAT. The copyright notice above, and the license provisions that follow -- | |
13 | -- apply solely to the contents of the part following the private keyword. -- | |
14 | -- -- | |
15 | -- GNAT is free software; you can redistribute it and/or modify it under -- | |
16 | -- terms of the GNU General Public License as published by the Free Soft- -- | |
748086b7 | 17 | -- ware Foundation; either version 3, or (at your option) any later ver- -- |
d23b8f57 RK |
18 | -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- |
19 | -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- | |
748086b7 JJ |
20 | -- or FITNESS FOR A PARTICULAR PURPOSE. -- |
21 | -- -- | |
22 | -- As a special exception under Section 7 of GPL version 3, you are granted -- | |
23 | -- additional permissions described in the GCC Runtime Library Exception, -- | |
24 | -- version 3.1, as published by the Free Software Foundation. -- | |
25 | -- -- | |
26 | -- You should have received a copy of the GNU General Public License and -- | |
27 | -- a copy of the GCC Runtime Library Exception along with this program; -- | |
28 | -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- | |
29 | -- <http://www.gnu.org/licenses/>. -- | |
d23b8f57 RK |
30 | -- -- |
31 | -- GNAT was originally developed by the GNAT team at New York University. -- | |
71ff80dc | 32 | -- Extensive contributions were provided by Ada Core Technologies Inc. -- |
d23b8f57 RK |
33 | -- -- |
34 | ------------------------------------------------------------------------------ | |
35 | ||
36 | with Ada.Strings.Maps; | |
fbf5a39b | 37 | with Ada.Strings.Superbounded; |
d23b8f57 RK |
38 | |
39 | package Ada.Strings.Bounded is | |
009186e0 | 40 | pragma Preelaborate; |
d23b8f57 RK |
41 | |
42 | generic | |
43 | Max : Positive; | |
44 | -- Maximum length of a Bounded_String | |
45 | ||
46 | package Generic_Bounded_Length is | |
47 | ||
48 | Max_Length : constant Positive := Max; | |
49 | ||
50 | type Bounded_String is private; | |
9b832db5 | 51 | pragma Preelaborable_Initialization (Bounded_String); |
d23b8f57 RK |
52 | |
53 | Null_Bounded_String : constant Bounded_String; | |
54 | ||
55 | subtype Length_Range is Natural range 0 .. Max_Length; | |
56 | ||
82c80734 | 57 | function Length (Source : Bounded_String) return Length_Range; |
d23b8f57 RK |
58 | |
59 | -------------------------------------------------------- | |
60 | -- Conversion, Concatenation, and Selection Functions -- | |
61 | -------------------------------------------------------- | |
62 | ||
63 | function To_Bounded_String | |
82c80734 RD |
64 | (Source : String; |
65 | Drop : Truncation := Error) return Bounded_String; | |
d23b8f57 | 66 | |
82c80734 RD |
67 | function To_String (Source : Bounded_String) return String; |
68 | ||
69 | procedure Set_Bounded_String | |
70 | (Target : out Bounded_String; | |
71 | Source : String; | |
72 | Drop : Truncation := Error); | |
73 | pragma Ada_05 (Set_Bounded_String); | |
d23b8f57 RK |
74 | |
75 | function Append | |
82c80734 RD |
76 | (Left : Bounded_String; |
77 | Right : Bounded_String; | |
78 | Drop : Truncation := Error) return Bounded_String; | |
d23b8f57 RK |
79 | |
80 | function Append | |
82c80734 RD |
81 | (Left : Bounded_String; |
82 | Right : String; | |
83 | Drop : Truncation := Error) return Bounded_String; | |
d23b8f57 RK |
84 | |
85 | function Append | |
82c80734 RD |
86 | (Left : String; |
87 | Right : Bounded_String; | |
88 | Drop : Truncation := Error) return Bounded_String; | |
d23b8f57 RK |
89 | |
90 | function Append | |
82c80734 RD |
91 | (Left : Bounded_String; |
92 | Right : Character; | |
93 | Drop : Truncation := Error) return Bounded_String; | |
d23b8f57 RK |
94 | |
95 | function Append | |
82c80734 RD |
96 | (Left : Character; |
97 | Right : Bounded_String; | |
98 | Drop : Truncation := Error) return Bounded_String; | |
d23b8f57 RK |
99 | |
100 | procedure Append | |
101 | (Source : in out Bounded_String; | |
82c80734 RD |
102 | New_Item : Bounded_String; |
103 | Drop : Truncation := Error); | |
d23b8f57 RK |
104 | |
105 | procedure Append | |
106 | (Source : in out Bounded_String; | |
82c80734 RD |
107 | New_Item : String; |
108 | Drop : Truncation := Error); | |
d23b8f57 RK |
109 | |
110 | procedure Append | |
111 | (Source : in out Bounded_String; | |
82c80734 RD |
112 | New_Item : Character; |
113 | Drop : Truncation := Error); | |
d23b8f57 RK |
114 | |
115 | function "&" | |
82c80734 RD |
116 | (Left : Bounded_String; |
117 | Right : Bounded_String) return Bounded_String; | |
d23b8f57 RK |
118 | |
119 | function "&" | |
82c80734 RD |
120 | (Left : Bounded_String; |
121 | Right : String) return Bounded_String; | |
d23b8f57 RK |
122 | |
123 | function "&" | |
82c80734 RD |
124 | (Left : String; |
125 | Right : Bounded_String) return Bounded_String; | |
d23b8f57 RK |
126 | |
127 | function "&" | |
82c80734 RD |
128 | (Left : Bounded_String; |
129 | Right : Character) return Bounded_String; | |
d23b8f57 RK |
130 | |
131 | function "&" | |
82c80734 RD |
132 | (Left : Character; |
133 | Right : Bounded_String) return Bounded_String; | |
d23b8f57 RK |
134 | |
135 | function Element | |
82c80734 RD |
136 | (Source : Bounded_String; |
137 | Index : Positive) return Character; | |
d23b8f57 RK |
138 | |
139 | procedure Replace_Element | |
140 | (Source : in out Bounded_String; | |
82c80734 RD |
141 | Index : Positive; |
142 | By : Character); | |
d23b8f57 RK |
143 | |
144 | function Slice | |
82c80734 RD |
145 | (Source : Bounded_String; |
146 | Low : Positive; | |
147 | High : Natural) return String; | |
148 | ||
149 | function Bounded_Slice | |
150 | (Source : Bounded_String; | |
151 | Low : Positive; | |
152 | High : Natural) return Bounded_String; | |
153 | pragma Ada_05 (Bounded_Slice); | |
154 | ||
155 | procedure Bounded_Slice | |
156 | (Source : Bounded_String; | |
157 | Target : out Bounded_String; | |
158 | Low : Positive; | |
159 | High : Natural); | |
160 | pragma Ada_05 (Bounded_Slice); | |
d23b8f57 | 161 | |
82c80734 RD |
162 | function "=" |
163 | (Left : Bounded_String; | |
164 | Right : Bounded_String) return Boolean; | |
d23b8f57 RK |
165 | |
166 | function "=" | |
82c80734 RD |
167 | (Left : Bounded_String; |
168 | Right : String) return Boolean; | |
d23b8f57 RK |
169 | |
170 | function "=" | |
82c80734 RD |
171 | (Left : String; |
172 | Right : Bounded_String) return Boolean; | |
d23b8f57 | 173 | |
82c80734 RD |
174 | function "<" |
175 | (Left : Bounded_String; | |
176 | Right : Bounded_String) return Boolean; | |
d23b8f57 RK |
177 | |
178 | function "<" | |
82c80734 RD |
179 | (Left : Bounded_String; |
180 | Right : String) return Boolean; | |
d23b8f57 RK |
181 | |
182 | function "<" | |
82c80734 RD |
183 | (Left : String; |
184 | Right : Bounded_String) return Boolean; | |
d23b8f57 | 185 | |
82c80734 RD |
186 | function "<=" |
187 | (Left : Bounded_String; | |
188 | Right : Bounded_String) return Boolean; | |
d23b8f57 RK |
189 | |
190 | function "<=" | |
82c80734 RD |
191 | (Left : Bounded_String; |
192 | Right : String) return Boolean; | |
d23b8f57 RK |
193 | |
194 | function "<=" | |
82c80734 RD |
195 | (Left : String; |
196 | Right : Bounded_String) return Boolean; | |
d23b8f57 | 197 | |
82c80734 RD |
198 | function ">" |
199 | (Left : Bounded_String; | |
200 | Right : Bounded_String) return Boolean; | |
d23b8f57 RK |
201 | |
202 | function ">" | |
82c80734 RD |
203 | (Left : Bounded_String; |
204 | Right : String) return Boolean; | |
d23b8f57 RK |
205 | |
206 | function ">" | |
82c80734 RD |
207 | (Left : String; |
208 | Right : Bounded_String) return Boolean; | |
d23b8f57 | 209 | |
82c80734 RD |
210 | function ">=" |
211 | (Left : Bounded_String; | |
212 | Right : Bounded_String) return Boolean; | |
d23b8f57 RK |
213 | |
214 | function ">=" | |
82c80734 RD |
215 | (Left : Bounded_String; |
216 | Right : String) return Boolean; | |
d23b8f57 RK |
217 | |
218 | function ">=" | |
82c80734 RD |
219 | (Left : String; |
220 | Right : Bounded_String) return Boolean; | |
d23b8f57 RK |
221 | |
222 | ---------------------- | |
223 | -- Search Functions -- | |
224 | ---------------------- | |
225 | ||
226 | function Index | |
82c80734 RD |
227 | (Source : Bounded_String; |
228 | Pattern : String; | |
229 | Going : Direction := Forward; | |
230 | Mapping : Maps.Character_Mapping := Maps.Identity) return Natural; | |
231 | ||
232 | function Index | |
233 | (Source : Bounded_String; | |
234 | Pattern : String; | |
235 | Going : Direction := Forward; | |
236 | Mapping : Maps.Character_Mapping_Function) return Natural; | |
d23b8f57 RK |
237 | |
238 | function Index | |
82c80734 RD |
239 | (Source : Bounded_String; |
240 | Set : Maps.Character_Set; | |
241 | Test : Membership := Inside; | |
242 | Going : Direction := Forward) return Natural; | |
d23b8f57 RK |
243 | |
244 | function Index | |
82c80734 RD |
245 | (Source : Bounded_String; |
246 | Pattern : String; | |
247 | From : Positive; | |
248 | Going : Direction := Forward; | |
249 | Mapping : Maps.Character_Mapping := Maps.Identity) return Natural; | |
250 | pragma Ada_05 (Index); | |
251 | ||
252 | function Index | |
253 | (Source : Bounded_String; | |
254 | Pattern : String; | |
255 | From : Positive; | |
256 | Going : Direction := Forward; | |
257 | Mapping : Maps.Character_Mapping_Function) return Natural; | |
258 | pragma Ada_05 (Index); | |
259 | ||
260 | function Index | |
261 | (Source : Bounded_String; | |
262 | Set : Maps.Character_Set; | |
263 | From : Positive; | |
264 | Test : Membership := Inside; | |
265 | Going : Direction := Forward) return Natural; | |
266 | pragma Ada_05 (Index); | |
d23b8f57 RK |
267 | |
268 | function Index_Non_Blank | |
82c80734 RD |
269 | (Source : Bounded_String; |
270 | Going : Direction := Forward) return Natural; | |
271 | ||
272 | function Index_Non_Blank | |
273 | (Source : Bounded_String; | |
274 | From : Positive; | |
275 | Going : Direction := Forward) return Natural; | |
276 | pragma Ada_05 (Index_Non_Blank); | |
d23b8f57 RK |
277 | |
278 | function Count | |
82c80734 RD |
279 | (Source : Bounded_String; |
280 | Pattern : String; | |
281 | Mapping : Maps.Character_Mapping := Maps.Identity) return Natural; | |
d23b8f57 RK |
282 | |
283 | function Count | |
82c80734 RD |
284 | (Source : Bounded_String; |
285 | Pattern : String; | |
286 | Mapping : Maps.Character_Mapping_Function) return Natural; | |
d23b8f57 RK |
287 | |
288 | function Count | |
82c80734 RD |
289 | (Source : Bounded_String; |
290 | Set : Maps.Character_Set) return Natural; | |
d23b8f57 RK |
291 | |
292 | procedure Find_Token | |
82c80734 RD |
293 | (Source : Bounded_String; |
294 | Set : Maps.Character_Set; | |
295 | Test : Membership; | |
d23b8f57 RK |
296 | First : out Positive; |
297 | Last : out Natural); | |
298 | ||
299 | ------------------------------------ | |
300 | -- String Translation Subprograms -- | |
301 | ------------------------------------ | |
302 | ||
303 | function Translate | |
82c80734 RD |
304 | (Source : Bounded_String; |
305 | Mapping : Maps.Character_Mapping) return Bounded_String; | |
d23b8f57 RK |
306 | |
307 | procedure Translate | |
308 | (Source : in out Bounded_String; | |
82c80734 | 309 | Mapping : Maps.Character_Mapping); |
d23b8f57 RK |
310 | |
311 | function Translate | |
82c80734 RD |
312 | (Source : Bounded_String; |
313 | Mapping : Maps.Character_Mapping_Function) return Bounded_String; | |
d23b8f57 RK |
314 | |
315 | procedure Translate | |
316 | (Source : in out Bounded_String; | |
82c80734 | 317 | Mapping : Maps.Character_Mapping_Function); |
d23b8f57 RK |
318 | |
319 | --------------------------------------- | |
320 | -- String Transformation Subprograms -- | |
321 | --------------------------------------- | |
322 | ||
323 | function Replace_Slice | |
82c80734 RD |
324 | (Source : Bounded_String; |
325 | Low : Positive; | |
326 | High : Natural; | |
327 | By : String; | |
328 | Drop : Truncation := Error) return Bounded_String; | |
d23b8f57 RK |
329 | |
330 | procedure Replace_Slice | |
331 | (Source : in out Bounded_String; | |
82c80734 RD |
332 | Low : Positive; |
333 | High : Natural; | |
334 | By : String; | |
335 | Drop : Truncation := Error); | |
d23b8f57 RK |
336 | |
337 | function Insert | |
82c80734 RD |
338 | (Source : Bounded_String; |
339 | Before : Positive; | |
340 | New_Item : String; | |
341 | Drop : Truncation := Error) return Bounded_String; | |
d23b8f57 RK |
342 | |
343 | procedure Insert | |
344 | (Source : in out Bounded_String; | |
82c80734 RD |
345 | Before : Positive; |
346 | New_Item : String; | |
347 | Drop : Truncation := Error); | |
d23b8f57 RK |
348 | |
349 | function Overwrite | |
82c80734 RD |
350 | (Source : Bounded_String; |
351 | Position : Positive; | |
352 | New_Item : String; | |
353 | Drop : Truncation := Error) return Bounded_String; | |
d23b8f57 RK |
354 | |
355 | procedure Overwrite | |
356 | (Source : in out Bounded_String; | |
82c80734 RD |
357 | Position : Positive; |
358 | New_Item : String; | |
359 | Drop : Truncation := Error); | |
d23b8f57 RK |
360 | |
361 | function Delete | |
82c80734 RD |
362 | (Source : Bounded_String; |
363 | From : Positive; | |
364 | Through : Natural) return Bounded_String; | |
d23b8f57 RK |
365 | |
366 | procedure Delete | |
367 | (Source : in out Bounded_String; | |
82c80734 RD |
368 | From : Positive; |
369 | Through : Natural); | |
d23b8f57 RK |
370 | |
371 | --------------------------------- | |
372 | -- String Selector Subprograms -- | |
373 | --------------------------------- | |
374 | ||
375 | function Trim | |
82c80734 RD |
376 | (Source : Bounded_String; |
377 | Side : Trim_End) return Bounded_String; | |
d23b8f57 RK |
378 | |
379 | procedure Trim | |
380 | (Source : in out Bounded_String; | |
82c80734 | 381 | Side : Trim_End); |
d23b8f57 RK |
382 | |
383 | function Trim | |
82c80734 RD |
384 | (Source : Bounded_String; |
385 | Left : Maps.Character_Set; | |
386 | Right : Maps.Character_Set) return Bounded_String; | |
d23b8f57 RK |
387 | |
388 | procedure Trim | |
389 | (Source : in out Bounded_String; | |
82c80734 RD |
390 | Left : Maps.Character_Set; |
391 | Right : Maps.Character_Set); | |
d23b8f57 RK |
392 | |
393 | function Head | |
82c80734 RD |
394 | (Source : Bounded_String; |
395 | Count : Natural; | |
396 | Pad : Character := Space; | |
397 | Drop : Truncation := Error) return Bounded_String; | |
d23b8f57 RK |
398 | |
399 | procedure Head | |
400 | (Source : in out Bounded_String; | |
82c80734 RD |
401 | Count : Natural; |
402 | Pad : Character := Space; | |
403 | Drop : Truncation := Error); | |
d23b8f57 RK |
404 | |
405 | function Tail | |
82c80734 RD |
406 | (Source : Bounded_String; |
407 | Count : Natural; | |
408 | Pad : Character := Space; | |
409 | Drop : Truncation := Error) return Bounded_String; | |
d23b8f57 RK |
410 | |
411 | procedure Tail | |
412 | (Source : in out Bounded_String; | |
82c80734 RD |
413 | Count : Natural; |
414 | Pad : Character := Space; | |
415 | Drop : Truncation := Error); | |
d23b8f57 RK |
416 | |
417 | ------------------------------------ | |
418 | -- String Constructor Subprograms -- | |
419 | ------------------------------------ | |
420 | ||
421 | function "*" | |
82c80734 RD |
422 | (Left : Natural; |
423 | Right : Character) return Bounded_String; | |
d23b8f57 RK |
424 | |
425 | function "*" | |
82c80734 RD |
426 | (Left : Natural; |
427 | Right : String) return Bounded_String; | |
d23b8f57 RK |
428 | |
429 | function "*" | |
82c80734 RD |
430 | (Left : Natural; |
431 | Right : Bounded_String) return Bounded_String; | |
d23b8f57 RK |
432 | |
433 | function Replicate | |
82c80734 RD |
434 | (Count : Natural; |
435 | Item : Character; | |
436 | Drop : Truncation := Error) return Bounded_String; | |
d23b8f57 RK |
437 | |
438 | function Replicate | |
82c80734 RD |
439 | (Count : Natural; |
440 | Item : String; | |
441 | Drop : Truncation := Error) return Bounded_String; | |
d23b8f57 RK |
442 | |
443 | function Replicate | |
82c80734 RD |
444 | (Count : Natural; |
445 | Item : Bounded_String; | |
446 | Drop : Truncation := Error) return Bounded_String; | |
d23b8f57 RK |
447 | |
448 | private | |
82c80734 | 449 | -- Most of the implementation is in the separate non generic package |
fbf5a39b | 450 | -- Ada.Strings.Superbounded. Type Bounded_String is derived from type |
82c80734 RD |
451 | -- Superbounded.Super_String with the maximum length constraint. In |
452 | -- almost all cases, the routines in Superbounded can be called with | |
453 | -- no requirement to pass the maximum length explicitly, since there | |
454 | -- is at least one Bounded_String argument from which the maximum | |
455 | -- length can be obtained. For all such routines, the implementation | |
456 | -- in this private part is simply a renaming of the corresponding | |
8fc789c8 | 457 | -- routine in the superbounded package. |
82c80734 RD |
458 | |
459 | -- The five exceptions are the * and Replicate routines operating on | |
460 | -- character values. For these cases, we have a routine in the body | |
461 | -- that calls the superbounded routine passing the maximum length | |
462 | -- explicitly as an extra parameter. | |
fbf5a39b AC |
463 | |
464 | type Bounded_String is new Superbounded.Super_String (Max_Length); | |
82c80734 RD |
465 | -- Deriving Bounded_String from Superbounded.Super_String is the |
466 | -- real trick, it ensures that the type Bounded_String declared in | |
467 | -- the generic instantiation is compatible with the Super_String | |
468 | -- type declared in the Superbounded package. | |
d23b8f57 | 469 | |
868e30a5 RD |
470 | function From_String (Source : String) return Bounded_String; |
471 | -- Private routine used only by Stream_Convert | |
472 | ||
473 | pragma Stream_Convert (Bounded_String, From_String, To_String); | |
474 | -- Provide stream routines without dragging in Ada.Streams | |
475 | ||
d23b8f57 | 476 | Null_Bounded_String : constant Bounded_String := |
82c80734 RD |
477 | (Max_Length => Max_Length, |
478 | Current_Length => 0, | |
479 | Data => | |
480 | (1 .. Max_Length => ASCII.NUL)); | |
fbf5a39b | 481 | |
d23b8f57 | 482 | pragma Inline (To_Bounded_String); |
fbf5a39b | 483 | |
82c80734 RD |
484 | procedure Set_Bounded_String |
485 | (Target : out Bounded_String; | |
486 | Source : String; | |
487 | Drop : Truncation := Error) | |
488 | renames Set_Super_String; | |
fbf5a39b | 489 | |
82c80734 RD |
490 | function Length |
491 | (Source : Bounded_String) return Length_Range | |
492 | renames Super_Length; | |
493 | ||
494 | function To_String | |
495 | (Source : Bounded_String) return String | |
496 | renames Super_To_String; | |
fbf5a39b AC |
497 | |
498 | function Append | |
82c80734 RD |
499 | (Left : Bounded_String; |
500 | Right : Bounded_String; | |
501 | Drop : Truncation := Error) return Bounded_String | |
502 | renames Super_Append; | |
fbf5a39b AC |
503 | |
504 | function Append | |
82c80734 RD |
505 | (Left : Bounded_String; |
506 | Right : String; | |
507 | Drop : Truncation := Error) return Bounded_String | |
508 | renames Super_Append; | |
fbf5a39b AC |
509 | |
510 | function Append | |
82c80734 RD |
511 | (Left : String; |
512 | Right : Bounded_String; | |
513 | Drop : Truncation := Error) return Bounded_String | |
514 | renames Super_Append; | |
fbf5a39b AC |
515 | |
516 | function Append | |
82c80734 RD |
517 | (Left : Bounded_String; |
518 | Right : Character; | |
519 | Drop : Truncation := Error) return Bounded_String | |
520 | renames Super_Append; | |
fbf5a39b AC |
521 | |
522 | function Append | |
82c80734 RD |
523 | (Left : Character; |
524 | Right : Bounded_String; | |
525 | Drop : Truncation := Error) return Bounded_String | |
526 | renames Super_Append; | |
fbf5a39b AC |
527 | |
528 | procedure Append | |
529 | (Source : in out Bounded_String; | |
82c80734 RD |
530 | New_Item : Bounded_String; |
531 | Drop : Truncation := Error) | |
532 | renames Super_Append; | |
fbf5a39b AC |
533 | |
534 | procedure Append | |
535 | (Source : in out Bounded_String; | |
82c80734 RD |
536 | New_Item : String; |
537 | Drop : Truncation := Error) | |
538 | renames Super_Append; | |
fbf5a39b AC |
539 | |
540 | procedure Append | |
541 | (Source : in out Bounded_String; | |
82c80734 RD |
542 | New_Item : Character; |
543 | Drop : Truncation := Error) | |
544 | renames Super_Append; | |
fbf5a39b AC |
545 | |
546 | function "&" | |
82c80734 RD |
547 | (Left : Bounded_String; |
548 | Right : Bounded_String) return Bounded_String | |
549 | renames Concat; | |
fbf5a39b AC |
550 | |
551 | function "&" | |
82c80734 RD |
552 | (Left : Bounded_String; |
553 | Right : String) return Bounded_String | |
554 | renames Concat; | |
fbf5a39b AC |
555 | |
556 | function "&" | |
82c80734 RD |
557 | (Left : String; |
558 | Right : Bounded_String) return Bounded_String | |
559 | renames Concat; | |
fbf5a39b AC |
560 | |
561 | function "&" | |
82c80734 RD |
562 | (Left : Bounded_String; |
563 | Right : Character) return Bounded_String | |
564 | renames Concat; | |
fbf5a39b AC |
565 | |
566 | function "&" | |
82c80734 RD |
567 | (Left : Character; |
568 | Right : Bounded_String) return Bounded_String | |
569 | renames Concat; | |
fbf5a39b AC |
570 | |
571 | function Element | |
82c80734 RD |
572 | (Source : Bounded_String; |
573 | Index : Positive) return Character | |
574 | renames Super_Element; | |
fbf5a39b AC |
575 | |
576 | procedure Replace_Element | |
577 | (Source : in out Bounded_String; | |
82c80734 RD |
578 | Index : Positive; |
579 | By : Character) | |
580 | renames Super_Replace_Element; | |
fbf5a39b AC |
581 | |
582 | function Slice | |
82c80734 RD |
583 | (Source : Bounded_String; |
584 | Low : Positive; | |
585 | High : Natural) return String | |
586 | renames Super_Slice; | |
587 | ||
588 | function Bounded_Slice | |
589 | (Source : Bounded_String; | |
590 | Low : Positive; | |
591 | High : Natural) return Bounded_String | |
592 | renames Super_Slice; | |
593 | ||
594 | procedure Bounded_Slice | |
595 | (Source : Bounded_String; | |
596 | Target : out Bounded_String; | |
597 | Low : Positive; | |
598 | High : Natural) | |
599 | renames Super_Slice; | |
fbf5a39b | 600 | |
82c80734 RD |
601 | function "=" |
602 | (Left : Bounded_String; | |
603 | Right : Bounded_String) return Boolean | |
604 | renames Equal; | |
fbf5a39b AC |
605 | |
606 | function "=" | |
82c80734 RD |
607 | (Left : Bounded_String; |
608 | Right : String) return Boolean | |
609 | renames Equal; | |
fbf5a39b AC |
610 | |
611 | function "=" | |
82c80734 RD |
612 | (Left : String; |
613 | Right : Bounded_String) return Boolean | |
614 | renames Equal; | |
fbf5a39b | 615 | |
82c80734 RD |
616 | function "<" |
617 | (Left : Bounded_String; | |
618 | Right : Bounded_String) return Boolean | |
619 | renames Less; | |
fbf5a39b AC |
620 | |
621 | function "<" | |
82c80734 RD |
622 | (Left : Bounded_String; |
623 | Right : String) return Boolean | |
624 | renames Less; | |
fbf5a39b AC |
625 | |
626 | function "<" | |
82c80734 RD |
627 | (Left : String; |
628 | Right : Bounded_String) return Boolean | |
629 | renames Less; | |
fbf5a39b | 630 | |
82c80734 RD |
631 | function "<=" |
632 | (Left : Bounded_String; | |
633 | Right : Bounded_String) return Boolean | |
634 | renames Less_Or_Equal; | |
fbf5a39b AC |
635 | |
636 | function "<=" | |
82c80734 RD |
637 | (Left : Bounded_String; |
638 | Right : String) return Boolean | |
639 | renames Less_Or_Equal; | |
fbf5a39b AC |
640 | |
641 | function "<=" | |
82c80734 RD |
642 | (Left : String; |
643 | Right : Bounded_String) return Boolean | |
644 | renames Less_Or_Equal; | |
fbf5a39b | 645 | |
82c80734 RD |
646 | function ">" |
647 | (Left : Bounded_String; | |
648 | Right : Bounded_String) return Boolean | |
649 | renames Greater; | |
fbf5a39b AC |
650 | |
651 | function ">" | |
82c80734 RD |
652 | (Left : Bounded_String; |
653 | Right : String) return Boolean | |
654 | renames Greater; | |
fbf5a39b AC |
655 | |
656 | function ">" | |
82c80734 RD |
657 | (Left : String; |
658 | Right : Bounded_String) return Boolean | |
659 | renames Greater; | |
fbf5a39b | 660 | |
82c80734 RD |
661 | function ">=" |
662 | (Left : Bounded_String; | |
663 | Right : Bounded_String) return Boolean | |
664 | renames Greater_Or_Equal; | |
fbf5a39b AC |
665 | |
666 | function ">=" | |
82c80734 RD |
667 | (Left : Bounded_String; |
668 | Right : String) return Boolean | |
669 | renames Greater_Or_Equal; | |
fbf5a39b AC |
670 | |
671 | function ">=" | |
82c80734 RD |
672 | (Left : String; |
673 | Right : Bounded_String) return Boolean | |
674 | renames Greater_Or_Equal; | |
675 | ||
676 | function Index | |
677 | (Source : Bounded_String; | |
678 | Pattern : String; | |
679 | Going : Direction := Forward; | |
680 | Mapping : Maps.Character_Mapping := Maps.Identity) return Natural | |
681 | renames Super_Index; | |
682 | ||
683 | function Index | |
684 | (Source : Bounded_String; | |
685 | Pattern : String; | |
686 | Going : Direction := Forward; | |
687 | Mapping : Maps.Character_Mapping_Function) return Natural | |
688 | renames Super_Index; | |
fbf5a39b AC |
689 | |
690 | function Index | |
82c80734 RD |
691 | (Source : Bounded_String; |
692 | Set : Maps.Character_Set; | |
693 | Test : Membership := Inside; | |
694 | Going : Direction := Forward) return Natural | |
695 | renames Super_Index; | |
fbf5a39b AC |
696 | |
697 | function Index | |
82c80734 RD |
698 | (Source : Bounded_String; |
699 | Pattern : String; | |
700 | From : Positive; | |
701 | Going : Direction := Forward; | |
702 | Mapping : Maps.Character_Mapping := Maps.Identity) return Natural | |
703 | renames Super_Index; | |
fbf5a39b AC |
704 | |
705 | function Index | |
82c80734 RD |
706 | (Source : Bounded_String; |
707 | Pattern : String; | |
708 | From : Positive; | |
709 | Going : Direction := Forward; | |
710 | Mapping : Maps.Character_Mapping_Function) return Natural | |
711 | renames Super_Index; | |
712 | ||
713 | function Index | |
714 | (Source : Bounded_String; | |
715 | Set : Maps.Character_Set; | |
716 | From : Positive; | |
717 | Test : Membership := Inside; | |
718 | Going : Direction := Forward) return Natural | |
719 | renames Super_Index; | |
720 | ||
721 | function Index_Non_Blank | |
722 | (Source : Bounded_String; | |
723 | Going : Direction := Forward) return Natural | |
724 | renames Super_Index_Non_Blank; | |
fbf5a39b AC |
725 | |
726 | function Index_Non_Blank | |
82c80734 RD |
727 | (Source : Bounded_String; |
728 | From : Positive; | |
729 | Going : Direction := Forward) return Natural | |
730 | renames Super_Index_Non_Blank; | |
fbf5a39b AC |
731 | |
732 | function Count | |
82c80734 RD |
733 | (Source : Bounded_String; |
734 | Pattern : String; | |
735 | Mapping : Maps.Character_Mapping := Maps.Identity) return Natural | |
736 | renames Super_Count; | |
fbf5a39b AC |
737 | |
738 | function Count | |
82c80734 RD |
739 | (Source : Bounded_String; |
740 | Pattern : String; | |
741 | Mapping : Maps.Character_Mapping_Function) return Natural | |
742 | renames Super_Count; | |
fbf5a39b AC |
743 | |
744 | function Count | |
82c80734 RD |
745 | (Source : Bounded_String; |
746 | Set : Maps.Character_Set) return Natural | |
747 | renames Super_Count; | |
fbf5a39b AC |
748 | |
749 | procedure Find_Token | |
82c80734 RD |
750 | (Source : Bounded_String; |
751 | Set : Maps.Character_Set; | |
752 | Test : Membership; | |
fbf5a39b AC |
753 | First : out Positive; |
754 | Last : out Natural) | |
82c80734 | 755 | renames Super_Find_Token; |
fbf5a39b AC |
756 | |
757 | function Translate | |
82c80734 RD |
758 | (Source : Bounded_String; |
759 | Mapping : Maps.Character_Mapping) return Bounded_String | |
760 | renames Super_Translate; | |
fbf5a39b AC |
761 | |
762 | procedure Translate | |
763 | (Source : in out Bounded_String; | |
82c80734 RD |
764 | Mapping : Maps.Character_Mapping) |
765 | renames Super_Translate; | |
fbf5a39b AC |
766 | |
767 | function Translate | |
82c80734 RD |
768 | (Source : Bounded_String; |
769 | Mapping : Maps.Character_Mapping_Function) return Bounded_String | |
770 | renames Super_Translate; | |
fbf5a39b AC |
771 | |
772 | procedure Translate | |
773 | (Source : in out Bounded_String; | |
82c80734 RD |
774 | Mapping : Maps.Character_Mapping_Function) |
775 | renames Super_Translate; | |
fbf5a39b AC |
776 | |
777 | function Replace_Slice | |
82c80734 RD |
778 | (Source : Bounded_String; |
779 | Low : Positive; | |
780 | High : Natural; | |
781 | By : String; | |
782 | Drop : Truncation := Error) return Bounded_String | |
783 | renames Super_Replace_Slice; | |
fbf5a39b AC |
784 | |
785 | procedure Replace_Slice | |
786 | (Source : in out Bounded_String; | |
82c80734 RD |
787 | Low : Positive; |
788 | High : Natural; | |
789 | By : String; | |
790 | Drop : Truncation := Error) | |
791 | renames Super_Replace_Slice; | |
fbf5a39b AC |
792 | |
793 | function Insert | |
82c80734 RD |
794 | (Source : Bounded_String; |
795 | Before : Positive; | |
796 | New_Item : String; | |
797 | Drop : Truncation := Error) return Bounded_String | |
798 | renames Super_Insert; | |
fbf5a39b AC |
799 | |
800 | procedure Insert | |
801 | (Source : in out Bounded_String; | |
82c80734 RD |
802 | Before : Positive; |
803 | New_Item : String; | |
804 | Drop : Truncation := Error) | |
805 | renames Super_Insert; | |
fbf5a39b AC |
806 | |
807 | function Overwrite | |
82c80734 RD |
808 | (Source : Bounded_String; |
809 | Position : Positive; | |
810 | New_Item : String; | |
811 | Drop : Truncation := Error) return Bounded_String | |
812 | renames Super_Overwrite; | |
fbf5a39b AC |
813 | |
814 | procedure Overwrite | |
815 | (Source : in out Bounded_String; | |
82c80734 RD |
816 | Position : Positive; |
817 | New_Item : String; | |
818 | Drop : Truncation := Error) | |
819 | renames Super_Overwrite; | |
fbf5a39b AC |
820 | |
821 | function Delete | |
82c80734 RD |
822 | (Source : Bounded_String; |
823 | From : Positive; | |
824 | Through : Natural) return Bounded_String | |
825 | renames Super_Delete; | |
fbf5a39b AC |
826 | |
827 | procedure Delete | |
828 | (Source : in out Bounded_String; | |
82c80734 RD |
829 | From : Positive; |
830 | Through : Natural) | |
831 | renames Super_Delete; | |
fbf5a39b AC |
832 | |
833 | function Trim | |
82c80734 RD |
834 | (Source : Bounded_String; |
835 | Side : Trim_End) return Bounded_String | |
836 | renames Super_Trim; | |
fbf5a39b AC |
837 | |
838 | procedure Trim | |
839 | (Source : in out Bounded_String; | |
82c80734 RD |
840 | Side : Trim_End) |
841 | renames Super_Trim; | |
fbf5a39b AC |
842 | |
843 | function Trim | |
82c80734 RD |
844 | (Source : Bounded_String; |
845 | Left : Maps.Character_Set; | |
846 | Right : Maps.Character_Set) return Bounded_String | |
847 | renames Super_Trim; | |
fbf5a39b AC |
848 | |
849 | procedure Trim | |
850 | (Source : in out Bounded_String; | |
82c80734 RD |
851 | Left : Maps.Character_Set; |
852 | Right : Maps.Character_Set) | |
853 | renames Super_Trim; | |
fbf5a39b AC |
854 | |
855 | function Head | |
82c80734 RD |
856 | (Source : Bounded_String; |
857 | Count : Natural; | |
858 | Pad : Character := Space; | |
859 | Drop : Truncation := Error) return Bounded_String | |
860 | renames Super_Head; | |
fbf5a39b AC |
861 | |
862 | procedure Head | |
863 | (Source : in out Bounded_String; | |
82c80734 RD |
864 | Count : Natural; |
865 | Pad : Character := Space; | |
866 | Drop : Truncation := Error) | |
867 | renames Super_Head; | |
fbf5a39b AC |
868 | |
869 | function Tail | |
82c80734 RD |
870 | (Source : Bounded_String; |
871 | Count : Natural; | |
872 | Pad : Character := Space; | |
873 | Drop : Truncation := Error) return Bounded_String | |
874 | renames Super_Tail; | |
fbf5a39b AC |
875 | |
876 | procedure Tail | |
877 | (Source : in out Bounded_String; | |
82c80734 RD |
878 | Count : Natural; |
879 | Pad : Character := Space; | |
880 | Drop : Truncation := Error) | |
881 | renames Super_Tail; | |
fbf5a39b AC |
882 | |
883 | function "*" | |
82c80734 RD |
884 | (Left : Natural; |
885 | Right : Bounded_String) return Bounded_String | |
886 | renames Times; | |
fbf5a39b AC |
887 | |
888 | function Replicate | |
82c80734 RD |
889 | (Count : Natural; |
890 | Item : Bounded_String; | |
891 | Drop : Truncation := Error) return Bounded_String | |
fbf5a39b | 892 | renames Super_Replicate; |
d23b8f57 RK |
893 | |
894 | end Generic_Bounded_Length; | |
895 | ||
896 | end Ada.Strings.Bounded; |