Fix thinko
[official-gcc.git] / gcc / ada / a-stwiun.adb
blob113957e918b2b8fd84ffbb757ab318fb07478361
1 ------------------------------------------------------------------------------
2 -- --
3 -- GNAT RUNTIME COMPONENTS --
4 -- --
5 -- A D A . S T R I N G S . W I D E _ U N B O U N D E D --
6 -- --
7 -- B o d y --
8 -- --
9 -- Copyright (C) 1992-2001 Free Software Foundation, Inc. --
10 -- --
11 -- GNAT is free software; you can redistribute it and/or modify it under --
12 -- terms of the GNU General Public License as published by the Free Soft- --
13 -- ware Foundation; either version 2, or (at your option) any later ver- --
14 -- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
15 -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
16 -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
17 -- for more details. You should have received a copy of the GNU General --
18 -- Public License distributed with GNAT; see file COPYING. If not, write --
19 -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, --
20 -- MA 02111-1307, USA. --
21 -- --
22 -- As a special exception, if other files instantiate generics from this --
23 -- unit, or you link this unit with other files to produce an executable, --
24 -- this unit does not by itself cause the resulting executable to be --
25 -- covered by the GNU General Public License. This exception does not --
26 -- however invalidate any other reasons why the executable file might be --
27 -- covered by the GNU Public License. --
28 -- --
29 -- GNAT was originally developed by the GNAT team at New York University. --
30 -- Extensive contributions were provided by Ada Core Technologies Inc. --
31 -- --
32 ------------------------------------------------------------------------------
34 with Ada.Strings.Wide_Fixed;
35 with Ada.Strings.Wide_Search;
36 with Ada.Unchecked_Deallocation;
38 package body Ada.Strings.Wide_Unbounded is
40 use Ada.Finalization;
42 ---------
43 -- "&" --
44 ---------
46 function "&"
47 (Left : Unbounded_Wide_String;
48 Right : Unbounded_Wide_String)
49 return Unbounded_Wide_String
51 L_Length : constant Integer := Left.Reference.all'Length;
52 R_Length : constant Integer := Right.Reference.all'Length;
53 Length : constant Integer := L_Length + R_Length;
54 Result : Unbounded_Wide_String;
56 begin
57 Result.Reference := new Wide_String (1 .. Length);
58 Result.Reference.all (1 .. L_Length) := Left.Reference.all;
59 Result.Reference.all (L_Length + 1 .. Length) := Right.Reference.all;
60 return Result;
61 end "&";
63 function "&"
64 (Left : Unbounded_Wide_String;
65 Right : Wide_String)
66 return Unbounded_Wide_String
68 L_Length : constant Integer := Left.Reference.all'Length;
69 Length : constant Integer := L_Length + Right'Length;
70 Result : Unbounded_Wide_String;
72 begin
73 Result.Reference := new Wide_String (1 .. Length);
74 Result.Reference.all (1 .. L_Length) := Left.Reference.all;
75 Result.Reference.all (L_Length + 1 .. Length) := Right;
76 return Result;
77 end "&";
79 function "&"
80 (Left : Wide_String;
81 Right : Unbounded_Wide_String)
82 return Unbounded_Wide_String
84 R_Length : constant Integer := Right.Reference.all'Length;
85 Length : constant Integer := Left'Length + R_Length;
86 Result : Unbounded_Wide_String;
88 begin
89 Result.Reference := new Wide_String (1 .. Length);
90 Result.Reference.all (1 .. Left'Length) := Left;
91 Result.Reference.all (Left'Length + 1 .. Length) := Right.Reference.all;
92 return Result;
93 end "&";
95 function "&"
96 (Left : Unbounded_Wide_String;
97 Right : Wide_Character)
98 return Unbounded_Wide_String
100 Length : constant Integer := Left.Reference.all'Length + 1;
101 Result : Unbounded_Wide_String;
103 begin
104 Result.Reference := new Wide_String (1 .. Length);
105 Result.Reference.all (1 .. Length - 1) := Left.Reference.all;
106 Result.Reference.all (Length) := Right;
107 return Result;
108 end "&";
110 function "&"
111 (Left : Wide_Character;
112 Right : Unbounded_Wide_String)
113 return Unbounded_Wide_String
115 Length : constant Integer := Right.Reference.all'Length + 1;
116 Result : Unbounded_Wide_String;
118 begin
119 Result.Reference := new Wide_String (1 .. Length);
120 Result.Reference.all (1) := Left;
121 Result.Reference.all (2 .. Length) := Right.Reference.all;
122 return Result;
123 end "&";
125 ---------
126 -- "*" --
127 ---------
129 function "*"
130 (Left : Natural;
131 Right : Wide_Character)
132 return Unbounded_Wide_String
134 Result : Unbounded_Wide_String;
136 begin
137 Result.Reference := new Wide_String (1 .. Left);
138 for J in Result.Reference'Range loop
139 Result.Reference (J) := Right;
140 end loop;
142 return Result;
143 end "*";
145 function "*"
146 (Left : Natural;
147 Right : Wide_String)
148 return Unbounded_Wide_String
150 Result : Unbounded_Wide_String;
152 begin
153 Result.Reference := new Wide_String (1 .. Left * Right'Length);
155 for J in 1 .. Left loop
156 Result.Reference.all
157 (Right'Length * J - Right'Length + 1 .. Right'Length * J) := Right;
158 end loop;
160 return Result;
161 end "*";
163 function "*"
164 (Left : Natural;
165 Right : Unbounded_Wide_String)
166 return Unbounded_Wide_String
168 R_Length : constant Integer := Right.Reference.all'Length;
169 Result : Unbounded_Wide_String;
171 begin
172 Result.Reference := new Wide_String (1 .. Left * R_Length);
174 for I in 1 .. Left loop
175 Result.Reference.all (R_Length * I - R_Length + 1 .. R_Length * I) :=
176 Right.Reference.all;
177 end loop;
179 return Result;
180 end "*";
182 ---------
183 -- "<" --
184 ---------
186 function "<"
187 (Left : in Unbounded_Wide_String;
188 Right : in Unbounded_Wide_String)
189 return Boolean
191 begin
192 return Left.Reference.all < Right.Reference.all;
193 end "<";
195 function "<"
196 (Left : in Unbounded_Wide_String;
197 Right : in Wide_String)
198 return Boolean
200 begin
201 return Left.Reference.all < Right;
202 end "<";
204 function "<"
205 (Left : in Wide_String;
206 Right : in Unbounded_Wide_String)
207 return Boolean
209 begin
210 return Left < Right.Reference.all;
211 end "<";
213 ----------
214 -- "<=" --
215 ----------
217 function "<="
218 (Left : in Unbounded_Wide_String;
219 Right : in Unbounded_Wide_String)
220 return Boolean
222 begin
223 return Left.Reference.all <= Right.Reference.all;
224 end "<=";
226 function "<="
227 (Left : in Unbounded_Wide_String;
228 Right : in Wide_String)
229 return Boolean
231 begin
232 return Left.Reference.all <= Right;
233 end "<=";
235 function "<="
236 (Left : in Wide_String;
237 Right : in Unbounded_Wide_String)
238 return Boolean
240 begin
241 return Left <= Right.Reference.all;
242 end "<=";
244 ---------
245 -- "=" --
246 ---------
248 function "="
249 (Left : in Unbounded_Wide_String;
250 Right : in Unbounded_Wide_String)
251 return Boolean
253 begin
254 return Left.Reference.all = Right.Reference.all;
255 end "=";
257 function "="
258 (Left : in Unbounded_Wide_String;
259 Right : in Wide_String)
260 return Boolean
262 begin
263 return Left.Reference.all = Right;
264 end "=";
266 function "="
267 (Left : in Wide_String;
268 Right : in Unbounded_Wide_String)
269 return Boolean
271 begin
272 return Left = Right.Reference.all;
273 end "=";
275 ---------
276 -- ">" --
277 ---------
279 function ">"
280 (Left : in Unbounded_Wide_String;
281 Right : in Unbounded_Wide_String)
282 return Boolean
284 begin
285 return Left.Reference.all > Right.Reference.all;
286 end ">";
288 function ">"
289 (Left : in Unbounded_Wide_String;
290 Right : in Wide_String)
291 return Boolean
293 begin
294 return Left.Reference.all > Right;
295 end ">";
297 function ">"
298 (Left : in Wide_String;
299 Right : in Unbounded_Wide_String)
300 return Boolean
302 begin
303 return Left > Right.Reference.all;
304 end ">";
306 ----------
307 -- ">=" --
308 ----------
310 function ">="
311 (Left : in Unbounded_Wide_String;
312 Right : in Unbounded_Wide_String)
313 return Boolean
315 begin
316 return Left.Reference.all >= Right.Reference.all;
317 end ">=";
319 function ">="
320 (Left : in Unbounded_Wide_String;
321 Right : in Wide_String)
322 return Boolean
324 begin
325 return Left.Reference.all >= Right;
326 end ">=";
328 function ">="
329 (Left : in Wide_String;
330 Right : in Unbounded_Wide_String)
331 return Boolean
333 begin
334 return Left >= Right.Reference.all;
335 end ">=";
337 ------------
338 -- Adjust --
339 ------------
341 procedure Adjust (Object : in out Unbounded_Wide_String) is
342 begin
343 -- Copy string, except we do not copy the statically allocated
344 -- null string, since it can never be deallocated.
346 if Object.Reference /= Null_Wide_String'Access then
347 Object.Reference := new Wide_String'(Object.Reference.all);
348 end if;
349 end Adjust;
351 ------------
352 -- Append --
353 ------------
355 procedure Append
356 (Source : in out Unbounded_Wide_String;
357 New_Item : in Unbounded_Wide_String)
359 S_Length : constant Integer := Source.Reference.all'Length;
360 Length : constant Integer := S_Length + New_Item.Reference.all'Length;
361 Temp : Wide_String_Access := Source.Reference;
363 begin
364 if Source.Reference = Null_Wide_String'Access then
365 Source := To_Unbounded_Wide_String (New_Item.Reference.all);
366 return;
367 end if;
369 Source.Reference := new Wide_String (1 .. Length);
371 Source.Reference.all (1 .. S_Length) := Temp.all;
372 Source.Reference.all (S_Length + 1 .. Length) := New_Item.Reference.all;
373 Free (Temp);
374 end Append;
376 procedure Append
377 (Source : in out Unbounded_Wide_String;
378 New_Item : in Wide_String)
380 S_Length : constant Integer := Source.Reference.all'Length;
381 Length : constant Integer := S_Length + New_Item'Length;
382 Temp : Wide_String_Access := Source.Reference;
384 begin
385 if Source.Reference = Null_Wide_String'Access then
386 Source := To_Unbounded_Wide_String (New_Item);
387 return;
388 end if;
390 Source.Reference := new Wide_String (1 .. Length);
391 Source.Reference.all (1 .. S_Length) := Temp.all;
392 Source.Reference.all (S_Length + 1 .. Length) := New_Item;
393 Free (Temp);
394 end Append;
396 procedure Append
397 (Source : in out Unbounded_Wide_String;
398 New_Item : in Wide_Character)
400 S_Length : constant Integer := Source.Reference.all'Length;
401 Length : constant Integer := S_Length + 1;
402 Temp : Wide_String_Access := Source.Reference;
404 begin
405 if Source.Reference = Null_Wide_String'Access then
406 Source := To_Unbounded_Wide_String ("" & New_Item);
407 return;
408 end if;
410 Source.Reference := new Wide_String (1 .. Length);
411 Source.Reference.all (1 .. S_Length) := Temp.all;
412 Source.Reference.all (S_Length + 1) := New_Item;
413 Free (Temp);
414 end Append;
416 -----------
417 -- Count --
418 -----------
420 function Count
421 (Source : Unbounded_Wide_String;
422 Pattern : Wide_String;
423 Mapping : Wide_Maps.Wide_Character_Mapping :=
424 Wide_Maps.Identity)
425 return Natural
427 begin
428 return Wide_Search.Count (Source.Reference.all, Pattern, Mapping);
429 end Count;
431 function Count
432 (Source : in Unbounded_Wide_String;
433 Pattern : in Wide_String;
434 Mapping : in Wide_Maps.Wide_Character_Mapping_Function)
435 return Natural
437 begin
438 return Wide_Search.Count (Source.Reference.all, Pattern, Mapping);
439 end Count;
441 function Count
442 (Source : Unbounded_Wide_String;
443 Set : Wide_Maps.Wide_Character_Set)
444 return Natural
446 begin
447 return Wide_Search.Count (Source.Reference.all, Set);
448 end Count;
450 ------------
451 -- Delete --
452 ------------
454 function Delete
455 (Source : Unbounded_Wide_String;
456 From : Positive;
457 Through : Natural)
458 return Unbounded_Wide_String
460 begin
461 return
462 To_Unbounded_Wide_String
463 (Wide_Fixed.Delete (Source.Reference.all, From, Through));
464 end Delete;
466 procedure Delete
467 (Source : in out Unbounded_Wide_String;
468 From : in Positive;
469 Through : in Natural)
471 Temp : Wide_String_Access := Source.Reference;
472 begin
473 Source := To_Unbounded_Wide_String
474 (Wide_Fixed.Delete (Temp.all, From, Through));
475 end Delete;
477 -------------
478 -- Element --
479 -------------
481 function Element
482 (Source : Unbounded_Wide_String;
483 Index : Positive)
484 return Wide_Character
486 begin
487 if Index <= Source.Reference.all'Last then
488 return Source.Reference.all (Index);
489 else
490 raise Strings.Index_Error;
491 end if;
492 end Element;
494 --------------
495 -- Finalize --
496 --------------
498 procedure Finalize (Object : in out Unbounded_Wide_String) is
499 procedure Deallocate is
500 new Ada.Unchecked_Deallocation (Wide_String, Wide_String_Access);
502 begin
503 -- Note: Don't try to free statically allocated null string
505 if Object.Reference /= Null_Wide_String'Access then
506 Deallocate (Object.Reference);
507 Object.Reference := Null_Unbounded_Wide_String.Reference;
508 end if;
509 end Finalize;
511 ----------------
512 -- Find_Token --
513 ----------------
515 procedure Find_Token
516 (Source : Unbounded_Wide_String;
517 Set : Wide_Maps.Wide_Character_Set;
518 Test : Strings.Membership;
519 First : out Positive;
520 Last : out Natural)
522 begin
523 Wide_Search.Find_Token (Source.Reference.all, Set, Test, First, Last);
524 end Find_Token;
526 ----------
527 -- Free --
528 ----------
530 procedure Free (X : in out Wide_String_Access) is
531 procedure Deallocate is
532 new Ada.Unchecked_Deallocation (Wide_String, Wide_String_Access);
533 begin
534 Deallocate (X);
535 end Free;
537 ----------
538 -- Head --
539 ----------
541 function Head
542 (Source : Unbounded_Wide_String;
543 Count : Natural;
544 Pad : Wide_Character := Wide_Space)
545 return Unbounded_Wide_String
547 begin
548 return
549 To_Unbounded_Wide_String
550 (Wide_Fixed.Head (Source.Reference.all, Count, Pad));
551 end Head;
553 procedure Head
554 (Source : in out Unbounded_Wide_String;
555 Count : in Natural;
556 Pad : in Wide_Character := Wide_Space)
558 begin
559 Source := To_Unbounded_Wide_String
560 (Wide_Fixed.Head (Source.Reference.all, Count, Pad));
561 end Head;
563 -----------
564 -- Index --
565 -----------
567 function Index
568 (Source : Unbounded_Wide_String;
569 Pattern : Wide_String;
570 Going : Strings.Direction := Strings.Forward;
571 Mapping : Wide_Maps.Wide_Character_Mapping :=
572 Wide_Maps.Identity)
573 return Natural
575 begin
576 return
577 Wide_Search.Index (Source.Reference.all, Pattern, Going, Mapping);
578 end Index;
580 function Index
581 (Source : in Unbounded_Wide_String;
582 Pattern : in Wide_String;
583 Going : in Direction := Forward;
584 Mapping : in Wide_Maps.Wide_Character_Mapping_Function)
585 return Natural
587 begin
588 return
589 Wide_Search.Index (Source.Reference.all, Pattern, Going, Mapping);
590 end Index;
592 function Index
593 (Source : Unbounded_Wide_String;
594 Set : Wide_Maps.Wide_Character_Set;
595 Test : Strings.Membership := Strings.Inside;
596 Going : Strings.Direction := Strings.Forward)
597 return Natural
599 begin
600 return Wide_Search.Index (Source.Reference.all, Set, Test, Going);
601 end Index;
603 function Index_Non_Blank
604 (Source : Unbounded_Wide_String;
605 Going : Strings.Direction := Strings.Forward)
606 return Natural
608 begin
609 return Wide_Search.Index_Non_Blank (Source.Reference.all, Going);
610 end Index_Non_Blank;
612 ----------------
613 -- Initialize --
614 ----------------
616 procedure Initialize (Object : in out Unbounded_Wide_String) is
617 begin
618 Object.Reference := Null_Unbounded_Wide_String.Reference;
619 end Initialize;
621 ------------
622 -- Insert --
623 ------------
625 function Insert
626 (Source : Unbounded_Wide_String;
627 Before : Positive;
628 New_Item : Wide_String)
629 return Unbounded_Wide_String
631 begin
632 return
633 To_Unbounded_Wide_String
634 (Wide_Fixed.Insert (Source.Reference.all, Before, New_Item));
635 end Insert;
637 procedure Insert
638 (Source : in out Unbounded_Wide_String;
639 Before : in Positive;
640 New_Item : in Wide_String)
642 begin
643 Source := To_Unbounded_Wide_String
644 (Wide_Fixed.Insert (Source.Reference.all, Before, New_Item));
645 end Insert;
647 ------------
648 -- Length --
649 ------------
651 function Length (Source : Unbounded_Wide_String) return Natural is
652 begin
653 return Source.Reference.all'Length;
654 end Length;
656 ---------------
657 -- Overwrite --
658 ---------------
660 function Overwrite
661 (Source : Unbounded_Wide_String;
662 Position : Positive;
663 New_Item : Wide_String)
664 return Unbounded_Wide_String is
666 begin
667 return To_Unbounded_Wide_String
668 (Wide_Fixed.Overwrite (Source.Reference.all, Position, New_Item));
669 end Overwrite;
671 procedure Overwrite
672 (Source : in out Unbounded_Wide_String;
673 Position : in Positive;
674 New_Item : in Wide_String)
676 Temp : Wide_String_Access := Source.Reference;
677 begin
678 Source := To_Unbounded_Wide_String
679 (Wide_Fixed.Overwrite (Temp.all, Position, New_Item));
680 end Overwrite;
682 ---------------------
683 -- Replace_Element --
684 ---------------------
686 procedure Replace_Element
687 (Source : in out Unbounded_Wide_String;
688 Index : Positive;
689 By : Wide_Character)
691 begin
692 if Index <= Source.Reference.all'Last then
693 Source.Reference.all (Index) := By;
694 else
695 raise Strings.Index_Error;
696 end if;
697 end Replace_Element;
699 -------------------
700 -- Replace_Slice --
701 -------------------
703 function Replace_Slice
704 (Source : Unbounded_Wide_String;
705 Low : Positive;
706 High : Natural;
707 By : Wide_String)
708 return Unbounded_Wide_String
710 begin
711 return
712 To_Unbounded_Wide_String
713 (Wide_Fixed.Replace_Slice (Source.Reference.all, Low, High, By));
714 end Replace_Slice;
716 procedure Replace_Slice
717 (Source : in out Unbounded_Wide_String;
718 Low : in Positive;
719 High : in Natural;
720 By : in Wide_String)
722 Temp : Wide_String_Access := Source.Reference;
723 begin
724 Source := To_Unbounded_Wide_String
725 (Wide_Fixed.Replace_Slice (Temp.all, Low, High, By));
726 end Replace_Slice;
728 -----------
729 -- Slice --
730 -----------
732 function Slice
733 (Source : Unbounded_Wide_String;
734 Low : Positive;
735 High : Natural)
736 return Wide_String
738 Length : constant Natural := Source.Reference'Length;
740 begin
741 -- Note: test of High > Length is in accordance with AI95-00128
743 if Low > Length + 1 or else High > Length then
744 raise Index_Error;
746 else
747 declare
748 Result : Wide_String (1 .. High - Low + 1);
750 begin
751 Result := Source.Reference.all (Low .. High);
752 return Result;
753 end;
754 end if;
755 end Slice;
757 ----------
758 -- Tail --
759 ----------
761 function Tail
762 (Source : Unbounded_Wide_String;
763 Count : Natural;
764 Pad : Wide_Character := Wide_Space)
765 return Unbounded_Wide_String is
767 begin
768 return
769 To_Unbounded_Wide_String
770 (Wide_Fixed.Tail (Source.Reference.all, Count, Pad));
771 end Tail;
773 procedure Tail
774 (Source : in out Unbounded_Wide_String;
775 Count : in Natural;
776 Pad : in Wide_Character := Wide_Space)
778 Temp : Wide_String_Access := Source.Reference;
780 begin
781 Source := To_Unbounded_Wide_String
782 (Wide_Fixed.Tail (Temp.all, Count, Pad));
783 end Tail;
785 ------------------------------
786 -- To_Unbounded_Wide_String --
787 ------------------------------
789 function To_Unbounded_Wide_String
790 (Source : Wide_String)
791 return Unbounded_Wide_String
793 Result : Unbounded_Wide_String;
795 begin
796 Result.Reference := new Wide_String (1 .. Source'Length);
797 Result.Reference.all := Source;
798 return Result;
799 end To_Unbounded_Wide_String;
801 function To_Unbounded_Wide_String (Length : in Natural)
802 return Unbounded_Wide_String
804 Result : Unbounded_Wide_String;
806 begin
807 Result.Reference := new Wide_String (1 .. Length);
808 return Result;
809 end To_Unbounded_Wide_String;
811 --------------------
812 -- To_Wide_String --
813 --------------------
815 function To_Wide_String
816 (Source : Unbounded_Wide_String)
817 return Wide_String
819 begin
820 return Source.Reference.all;
821 end To_Wide_String;
823 ---------------
824 -- Translate --
825 ---------------
827 function Translate
828 (Source : Unbounded_Wide_String;
829 Mapping : Wide_Maps.Wide_Character_Mapping)
830 return Unbounded_Wide_String
832 begin
833 return
834 To_Unbounded_Wide_String
835 (Wide_Fixed.Translate (Source.Reference.all, Mapping));
836 end Translate;
838 procedure Translate
839 (Source : in out Unbounded_Wide_String;
840 Mapping : Wide_Maps.Wide_Character_Mapping)
842 begin
843 Wide_Fixed.Translate (Source.Reference.all, Mapping);
844 end Translate;
846 function Translate
847 (Source : in Unbounded_Wide_String;
848 Mapping : in Wide_Maps.Wide_Character_Mapping_Function)
849 return Unbounded_Wide_String
851 begin
852 return
853 To_Unbounded_Wide_String
854 (Wide_Fixed.Translate (Source.Reference.all, Mapping));
855 end Translate;
857 procedure Translate
858 (Source : in out Unbounded_Wide_String;
859 Mapping : in Wide_Maps.Wide_Character_Mapping_Function)
861 begin
862 Wide_Fixed.Translate (Source.Reference.all, Mapping);
863 end Translate;
865 ----------
866 -- Trim --
867 ----------
869 function Trim
870 (Source : in Unbounded_Wide_String;
871 Side : in Trim_End)
872 return Unbounded_Wide_String
874 begin
875 return
876 To_Unbounded_Wide_String
877 (Wide_Fixed.Trim (Source.Reference.all, Side));
878 end Trim;
880 procedure Trim
881 (Source : in out Unbounded_Wide_String;
882 Side : in Trim_End)
884 Old : Wide_String_Access := Source.Reference;
885 begin
886 Source.Reference := new Wide_String'(Wide_Fixed.Trim (Old.all, Side));
887 Free (Old);
888 end Trim;
890 function Trim
891 (Source : in Unbounded_Wide_String;
892 Left : in Wide_Maps.Wide_Character_Set;
893 Right : in Wide_Maps.Wide_Character_Set)
894 return Unbounded_Wide_String
896 begin
897 return
898 To_Unbounded_Wide_String
899 (Wide_Fixed.Trim (Source.Reference.all, Left, Right));
900 end Trim;
902 procedure Trim
903 (Source : in out Unbounded_Wide_String;
904 Left : in Wide_Maps.Wide_Character_Set;
905 Right : in Wide_Maps.Wide_Character_Set)
907 Old : Wide_String_Access := Source.Reference;
909 begin
910 Source.Reference :=
911 new Wide_String'(Wide_Fixed.Trim (Old.all, Left, Right));
912 Free (Old);
913 end Trim;
915 end Ada.Strings.Wide_Unbounded;