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