* rtl.h (struct rtx_def): Update comments.
[official-gcc.git] / gcc / ada / a-stwiun.adb
blob8470d432ffe534f8315140276e49e127e5c31da4
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 -- --
10 -- Copyright (C) 1992-2001 Free Software Foundation, Inc. --
11 -- --
12 -- GNAT is free software; you can redistribute it and/or modify it under --
13 -- terms of the GNU General Public License as published by the Free Soft- --
14 -- ware Foundation; either version 2, or (at your option) any later ver- --
15 -- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
16 -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
17 -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
18 -- for more details. You should have received a copy of the GNU General --
19 -- Public License distributed with GNAT; see file COPYING. If not, write --
20 -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, --
21 -- MA 02111-1307, USA. --
22 -- --
23 -- As a special exception, if other files instantiate generics from this --
24 -- unit, or you link this unit with other files to produce an executable, --
25 -- this unit does not by itself cause the resulting executable to be --
26 -- covered by the GNU General Public License. This exception does not --
27 -- however invalidate any other reasons why the executable file might be --
28 -- covered by the GNU Public License. --
29 -- --
30 -- GNAT was originally developed by the GNAT team at New York University. --
31 -- It is now maintained by Ada Core Technologies Inc (http://www.gnat.com). --
32 -- --
33 ------------------------------------------------------------------------------
35 with Ada.Strings.Wide_Fixed;
36 with Ada.Strings.Wide_Search;
37 with Ada.Unchecked_Deallocation;
39 package body Ada.Strings.Wide_Unbounded is
41 use Ada.Finalization;
43 ---------
44 -- "&" --
45 ---------
47 function "&"
48 (Left : Unbounded_Wide_String;
49 Right : Unbounded_Wide_String)
50 return Unbounded_Wide_String
52 L_Length : constant Integer := Left.Reference.all'Length;
53 R_Length : constant Integer := Right.Reference.all'Length;
54 Length : constant Integer := L_Length + R_Length;
55 Result : Unbounded_Wide_String;
57 begin
58 Result.Reference := new Wide_String (1 .. Length);
59 Result.Reference.all (1 .. L_Length) := Left.Reference.all;
60 Result.Reference.all (L_Length + 1 .. Length) := Right.Reference.all;
61 return Result;
62 end "&";
64 function "&"
65 (Left : Unbounded_Wide_String;
66 Right : Wide_String)
67 return Unbounded_Wide_String
69 L_Length : constant Integer := Left.Reference.all'Length;
70 Length : constant Integer := L_Length + Right'Length;
71 Result : Unbounded_Wide_String;
73 begin
74 Result.Reference := new Wide_String (1 .. Length);
75 Result.Reference.all (1 .. L_Length) := Left.Reference.all;
76 Result.Reference.all (L_Length + 1 .. Length) := Right;
77 return Result;
78 end "&";
80 function "&"
81 (Left : Wide_String;
82 Right : Unbounded_Wide_String)
83 return Unbounded_Wide_String
85 R_Length : constant Integer := Right.Reference.all'Length;
86 Length : constant Integer := Left'Length + R_Length;
87 Result : Unbounded_Wide_String;
89 begin
90 Result.Reference := new Wide_String (1 .. Length);
91 Result.Reference.all (1 .. Left'Length) := Left;
92 Result.Reference.all (Left'Length + 1 .. Length) := Right.Reference.all;
93 return Result;
94 end "&";
96 function "&"
97 (Left : Unbounded_Wide_String;
98 Right : Wide_Character)
99 return Unbounded_Wide_String
101 Length : constant Integer := Left.Reference.all'Length + 1;
102 Result : Unbounded_Wide_String;
104 begin
105 Result.Reference := new Wide_String (1 .. Length);
106 Result.Reference.all (1 .. Length - 1) := Left.Reference.all;
107 Result.Reference.all (Length) := Right;
108 return Result;
109 end "&";
111 function "&"
112 (Left : Wide_Character;
113 Right : Unbounded_Wide_String)
114 return Unbounded_Wide_String
116 Length : constant Integer := Right.Reference.all'Length + 1;
117 Result : Unbounded_Wide_String;
119 begin
120 Result.Reference := new Wide_String (1 .. Length);
121 Result.Reference.all (1) := Left;
122 Result.Reference.all (2 .. Length) := Right.Reference.all;
123 return Result;
124 end "&";
126 ---------
127 -- "*" --
128 ---------
130 function "*"
131 (Left : Natural;
132 Right : Wide_Character)
133 return Unbounded_Wide_String
135 Result : Unbounded_Wide_String;
137 begin
138 Result.Reference := new Wide_String (1 .. Left);
139 for J in Result.Reference'Range loop
140 Result.Reference (J) := Right;
141 end loop;
143 return Result;
144 end "*";
146 function "*"
147 (Left : Natural;
148 Right : Wide_String)
149 return Unbounded_Wide_String
151 Result : Unbounded_Wide_String;
153 begin
154 Result.Reference := new Wide_String (1 .. Left * Right'Length);
156 for J in 1 .. Left loop
157 Result.Reference.all
158 (Right'Length * J - Right'Length + 1 .. Right'Length * J) := Right;
159 end loop;
161 return Result;
162 end "*";
164 function "*"
165 (Left : Natural;
166 Right : Unbounded_Wide_String)
167 return Unbounded_Wide_String
169 R_Length : constant Integer := Right.Reference.all'Length;
170 Result : Unbounded_Wide_String;
172 begin
173 Result.Reference := new Wide_String (1 .. Left * R_Length);
175 for I in 1 .. Left loop
176 Result.Reference.all (R_Length * I - R_Length + 1 .. R_Length * I) :=
177 Right.Reference.all;
178 end loop;
180 return Result;
181 end "*";
183 ---------
184 -- "<" --
185 ---------
187 function "<"
188 (Left : in Unbounded_Wide_String;
189 Right : in Unbounded_Wide_String)
190 return Boolean
192 begin
193 return Left.Reference.all < Right.Reference.all;
194 end "<";
196 function "<"
197 (Left : in Unbounded_Wide_String;
198 Right : in Wide_String)
199 return Boolean
201 begin
202 return Left.Reference.all < Right;
203 end "<";
205 function "<"
206 (Left : in Wide_String;
207 Right : in Unbounded_Wide_String)
208 return Boolean
210 begin
211 return Left < Right.Reference.all;
212 end "<";
214 ----------
215 -- "<=" --
216 ----------
218 function "<="
219 (Left : in Unbounded_Wide_String;
220 Right : in Unbounded_Wide_String)
221 return Boolean
223 begin
224 return Left.Reference.all <= Right.Reference.all;
225 end "<=";
227 function "<="
228 (Left : in Unbounded_Wide_String;
229 Right : in Wide_String)
230 return Boolean
232 begin
233 return Left.Reference.all <= Right;
234 end "<=";
236 function "<="
237 (Left : in Wide_String;
238 Right : in Unbounded_Wide_String)
239 return Boolean
241 begin
242 return Left <= Right.Reference.all;
243 end "<=";
245 ---------
246 -- "=" --
247 ---------
249 function "="
250 (Left : in Unbounded_Wide_String;
251 Right : in Unbounded_Wide_String)
252 return Boolean
254 begin
255 return Left.Reference.all = Right.Reference.all;
256 end "=";
258 function "="
259 (Left : in Unbounded_Wide_String;
260 Right : in Wide_String)
261 return Boolean
263 begin
264 return Left.Reference.all = Right;
265 end "=";
267 function "="
268 (Left : in Wide_String;
269 Right : in Unbounded_Wide_String)
270 return Boolean
272 begin
273 return Left = Right.Reference.all;
274 end "=";
276 ---------
277 -- ">" --
278 ---------
280 function ">"
281 (Left : in Unbounded_Wide_String;
282 Right : in Unbounded_Wide_String)
283 return Boolean
285 begin
286 return Left.Reference.all > Right.Reference.all;
287 end ">";
289 function ">"
290 (Left : in Unbounded_Wide_String;
291 Right : in Wide_String)
292 return Boolean
294 begin
295 return Left.Reference.all > Right;
296 end ">";
298 function ">"
299 (Left : in Wide_String;
300 Right : in Unbounded_Wide_String)
301 return Boolean
303 begin
304 return Left > Right.Reference.all;
305 end ">";
307 ----------
308 -- ">=" --
309 ----------
311 function ">="
312 (Left : in Unbounded_Wide_String;
313 Right : in Unbounded_Wide_String)
314 return Boolean
316 begin
317 return Left.Reference.all >= Right.Reference.all;
318 end ">=";
320 function ">="
321 (Left : in Unbounded_Wide_String;
322 Right : in Wide_String)
323 return Boolean
325 begin
326 return Left.Reference.all >= Right;
327 end ">=";
329 function ">="
330 (Left : in Wide_String;
331 Right : in Unbounded_Wide_String)
332 return Boolean
334 begin
335 return Left >= Right.Reference.all;
336 end ">=";
338 ------------
339 -- Adjust --
340 ------------
342 procedure Adjust (Object : in out Unbounded_Wide_String) is
343 begin
344 -- Copy string, except we do not copy the statically allocated
345 -- null string, since it can never be deallocated.
347 if Object.Reference /= Null_Wide_String'Access then
348 Object.Reference := new Wide_String'(Object.Reference.all);
349 end if;
350 end Adjust;
352 ------------
353 -- Append --
354 ------------
356 procedure Append
357 (Source : in out Unbounded_Wide_String;
358 New_Item : in Unbounded_Wide_String)
360 S_Length : constant Integer := Source.Reference.all'Length;
361 Length : constant Integer := S_Length + New_Item.Reference.all'Length;
362 Temp : Wide_String_Access := Source.Reference;
364 begin
365 if Source.Reference = Null_Wide_String'Access then
366 Source := To_Unbounded_Wide_String (New_Item.Reference.all);
367 return;
368 end if;
370 Source.Reference := new Wide_String (1 .. Length);
372 Source.Reference.all (1 .. S_Length) := Temp.all;
373 Source.Reference.all (S_Length + 1 .. Length) := New_Item.Reference.all;
374 Free (Temp);
375 end Append;
377 procedure Append
378 (Source : in out Unbounded_Wide_String;
379 New_Item : in Wide_String)
381 S_Length : constant Integer := Source.Reference.all'Length;
382 Length : constant Integer := S_Length + New_Item'Length;
383 Temp : Wide_String_Access := Source.Reference;
385 begin
386 if Source.Reference = Null_Wide_String'Access then
387 Source := To_Unbounded_Wide_String (New_Item);
388 return;
389 end if;
391 Source.Reference := new Wide_String (1 .. Length);
392 Source.Reference.all (1 .. S_Length) := Temp.all;
393 Source.Reference.all (S_Length + 1 .. Length) := New_Item;
394 Free (Temp);
395 end Append;
397 procedure Append
398 (Source : in out Unbounded_Wide_String;
399 New_Item : in Wide_Character)
401 S_Length : constant Integer := Source.Reference.all'Length;
402 Length : constant Integer := S_Length + 1;
403 Temp : Wide_String_Access := Source.Reference;
405 begin
406 if Source.Reference = Null_Wide_String'Access then
407 Source := To_Unbounded_Wide_String ("" & New_Item);
408 return;
409 end if;
411 Source.Reference := new Wide_String (1 .. Length);
412 Source.Reference.all (1 .. S_Length) := Temp.all;
413 Source.Reference.all (S_Length + 1) := New_Item;
414 Free (Temp);
415 end Append;
417 -----------
418 -- Count --
419 -----------
421 function Count
422 (Source : Unbounded_Wide_String;
423 Pattern : Wide_String;
424 Mapping : Wide_Maps.Wide_Character_Mapping :=
425 Wide_Maps.Identity)
426 return Natural
428 begin
429 return Wide_Search.Count (Source.Reference.all, Pattern, Mapping);
430 end Count;
432 function Count
433 (Source : in Unbounded_Wide_String;
434 Pattern : in Wide_String;
435 Mapping : in Wide_Maps.Wide_Character_Mapping_Function)
436 return Natural
438 begin
439 return Wide_Search.Count (Source.Reference.all, Pattern, Mapping);
440 end Count;
442 function Count
443 (Source : Unbounded_Wide_String;
444 Set : Wide_Maps.Wide_Character_Set)
445 return Natural
447 begin
448 return Wide_Search.Count (Source.Reference.all, Set);
449 end Count;
451 ------------
452 -- Delete --
453 ------------
455 function Delete
456 (Source : Unbounded_Wide_String;
457 From : Positive;
458 Through : Natural)
459 return Unbounded_Wide_String
461 begin
462 return
463 To_Unbounded_Wide_String
464 (Wide_Fixed.Delete (Source.Reference.all, From, Through));
465 end Delete;
467 procedure Delete
468 (Source : in out Unbounded_Wide_String;
469 From : in Positive;
470 Through : in Natural)
472 Temp : Wide_String_Access := Source.Reference;
473 begin
474 Source := To_Unbounded_Wide_String
475 (Wide_Fixed.Delete (Temp.all, From, Through));
476 end Delete;
478 -------------
479 -- Element --
480 -------------
482 function Element
483 (Source : Unbounded_Wide_String;
484 Index : Positive)
485 return Wide_Character
487 begin
488 if Index <= Source.Reference.all'Last then
489 return Source.Reference.all (Index);
490 else
491 raise Strings.Index_Error;
492 end if;
493 end Element;
495 --------------
496 -- Finalize --
497 --------------
499 procedure Finalize (Object : in out Unbounded_Wide_String) is
500 procedure Deallocate is
501 new Ada.Unchecked_Deallocation (Wide_String, Wide_String_Access);
503 begin
504 -- Note: Don't try to free statically allocated null string
506 if Object.Reference /= Null_Wide_String'Access then
507 Deallocate (Object.Reference);
508 Object.Reference := Null_Unbounded_Wide_String.Reference;
509 end if;
510 end Finalize;
512 ----------------
513 -- Find_Token --
514 ----------------
516 procedure Find_Token
517 (Source : Unbounded_Wide_String;
518 Set : Wide_Maps.Wide_Character_Set;
519 Test : Strings.Membership;
520 First : out Positive;
521 Last : out Natural)
523 begin
524 Wide_Search.Find_Token (Source.Reference.all, Set, Test, First, Last);
525 end Find_Token;
527 ----------
528 -- Free --
529 ----------
531 procedure Free (X : in out Wide_String_Access) is
532 procedure Deallocate is
533 new Ada.Unchecked_Deallocation (Wide_String, Wide_String_Access);
534 begin
535 Deallocate (X);
536 end Free;
538 ----------
539 -- Head --
540 ----------
542 function Head
543 (Source : Unbounded_Wide_String;
544 Count : Natural;
545 Pad : Wide_Character := Wide_Space)
546 return Unbounded_Wide_String
548 begin
549 return
550 To_Unbounded_Wide_String
551 (Wide_Fixed.Head (Source.Reference.all, Count, Pad));
552 end Head;
554 procedure Head
555 (Source : in out Unbounded_Wide_String;
556 Count : in Natural;
557 Pad : in Wide_Character := Wide_Space)
559 begin
560 Source := To_Unbounded_Wide_String
561 (Wide_Fixed.Head (Source.Reference.all, Count, Pad));
562 end Head;
564 -----------
565 -- Index --
566 -----------
568 function Index
569 (Source : Unbounded_Wide_String;
570 Pattern : Wide_String;
571 Going : Strings.Direction := Strings.Forward;
572 Mapping : Wide_Maps.Wide_Character_Mapping :=
573 Wide_Maps.Identity)
574 return Natural
576 begin
577 return
578 Wide_Search.Index (Source.Reference.all, Pattern, Going, Mapping);
579 end Index;
581 function Index
582 (Source : in Unbounded_Wide_String;
583 Pattern : in Wide_String;
584 Going : in Direction := Forward;
585 Mapping : in Wide_Maps.Wide_Character_Mapping_Function)
586 return Natural
588 begin
589 return
590 Wide_Search.Index (Source.Reference.all, Pattern, Going, Mapping);
591 end Index;
593 function Index
594 (Source : Unbounded_Wide_String;
595 Set : Wide_Maps.Wide_Character_Set;
596 Test : Strings.Membership := Strings.Inside;
597 Going : Strings.Direction := Strings.Forward)
598 return Natural
600 begin
601 return Wide_Search.Index (Source.Reference.all, Set, Test, Going);
602 end Index;
604 function Index_Non_Blank
605 (Source : Unbounded_Wide_String;
606 Going : Strings.Direction := Strings.Forward)
607 return Natural
609 begin
610 return Wide_Search.Index_Non_Blank (Source.Reference.all, Going);
611 end Index_Non_Blank;
613 ----------------
614 -- Initialize --
615 ----------------
617 procedure Initialize (Object : in out Unbounded_Wide_String) is
618 begin
619 Object.Reference := Null_Unbounded_Wide_String.Reference;
620 end Initialize;
622 ------------
623 -- Insert --
624 ------------
626 function Insert
627 (Source : Unbounded_Wide_String;
628 Before : Positive;
629 New_Item : Wide_String)
630 return Unbounded_Wide_String
632 begin
633 return
634 To_Unbounded_Wide_String
635 (Wide_Fixed.Insert (Source.Reference.all, Before, New_Item));
636 end Insert;
638 procedure Insert
639 (Source : in out Unbounded_Wide_String;
640 Before : in Positive;
641 New_Item : in Wide_String)
643 begin
644 Source := To_Unbounded_Wide_String
645 (Wide_Fixed.Insert (Source.Reference.all, Before, New_Item));
646 end Insert;
648 ------------
649 -- Length --
650 ------------
652 function Length (Source : Unbounded_Wide_String) return Natural is
653 begin
654 return Source.Reference.all'Length;
655 end Length;
657 ---------------
658 -- Overwrite --
659 ---------------
661 function Overwrite
662 (Source : Unbounded_Wide_String;
663 Position : Positive;
664 New_Item : Wide_String)
665 return Unbounded_Wide_String is
667 begin
668 return To_Unbounded_Wide_String
669 (Wide_Fixed.Overwrite (Source.Reference.all, Position, New_Item));
670 end Overwrite;
672 procedure Overwrite
673 (Source : in out Unbounded_Wide_String;
674 Position : in Positive;
675 New_Item : in Wide_String)
677 Temp : Wide_String_Access := Source.Reference;
678 begin
679 Source := To_Unbounded_Wide_String
680 (Wide_Fixed.Overwrite (Temp.all, Position, New_Item));
681 end Overwrite;
683 ---------------------
684 -- Replace_Element --
685 ---------------------
687 procedure Replace_Element
688 (Source : in out Unbounded_Wide_String;
689 Index : Positive;
690 By : Wide_Character)
692 begin
693 if Index <= Source.Reference.all'Last then
694 Source.Reference.all (Index) := By;
695 else
696 raise Strings.Index_Error;
697 end if;
698 end Replace_Element;
700 -------------------
701 -- Replace_Slice --
702 -------------------
704 function Replace_Slice
705 (Source : Unbounded_Wide_String;
706 Low : Positive;
707 High : Natural;
708 By : Wide_String)
709 return Unbounded_Wide_String
711 begin
712 return
713 To_Unbounded_Wide_String
714 (Wide_Fixed.Replace_Slice (Source.Reference.all, Low, High, By));
715 end Replace_Slice;
717 procedure Replace_Slice
718 (Source : in out Unbounded_Wide_String;
719 Low : in Positive;
720 High : in Natural;
721 By : in Wide_String)
723 Temp : Wide_String_Access := Source.Reference;
724 begin
725 Source := To_Unbounded_Wide_String
726 (Wide_Fixed.Replace_Slice (Temp.all, Low, High, By));
727 end Replace_Slice;
729 -----------
730 -- Slice --
731 -----------
733 function Slice
734 (Source : Unbounded_Wide_String;
735 Low : Positive;
736 High : Natural)
737 return Wide_String
739 Length : constant Natural := Source.Reference'Length;
741 begin
742 -- Note: test of High > Length is in accordance with AI95-00128
744 if Low > Length + 1 or else High > Length then
745 raise Index_Error;
747 else
748 declare
749 Result : Wide_String (1 .. High - Low + 1);
751 begin
752 Result := Source.Reference.all (Low .. High);
753 return Result;
754 end;
755 end if;
756 end Slice;
758 ----------
759 -- Tail --
760 ----------
762 function Tail
763 (Source : Unbounded_Wide_String;
764 Count : Natural;
765 Pad : Wide_Character := Wide_Space)
766 return Unbounded_Wide_String is
768 begin
769 return
770 To_Unbounded_Wide_String
771 (Wide_Fixed.Tail (Source.Reference.all, Count, Pad));
772 end Tail;
774 procedure Tail
775 (Source : in out Unbounded_Wide_String;
776 Count : in Natural;
777 Pad : in Wide_Character := Wide_Space)
779 Temp : Wide_String_Access := Source.Reference;
781 begin
782 Source := To_Unbounded_Wide_String
783 (Wide_Fixed.Tail (Temp.all, Count, Pad));
784 end Tail;
786 ------------------------------
787 -- To_Unbounded_Wide_String --
788 ------------------------------
790 function To_Unbounded_Wide_String
791 (Source : Wide_String)
792 return Unbounded_Wide_String
794 Result : Unbounded_Wide_String;
796 begin
797 Result.Reference := new Wide_String (1 .. Source'Length);
798 Result.Reference.all := Source;
799 return Result;
800 end To_Unbounded_Wide_String;
802 function To_Unbounded_Wide_String (Length : in Natural)
803 return Unbounded_Wide_String
805 Result : Unbounded_Wide_String;
807 begin
808 Result.Reference := new Wide_String (1 .. Length);
809 return Result;
810 end To_Unbounded_Wide_String;
812 --------------------
813 -- To_Wide_String --
814 --------------------
816 function To_Wide_String
817 (Source : Unbounded_Wide_String)
818 return Wide_String
820 begin
821 return Source.Reference.all;
822 end To_Wide_String;
824 ---------------
825 -- Translate --
826 ---------------
828 function Translate
829 (Source : Unbounded_Wide_String;
830 Mapping : Wide_Maps.Wide_Character_Mapping)
831 return Unbounded_Wide_String
833 begin
834 return
835 To_Unbounded_Wide_String
836 (Wide_Fixed.Translate (Source.Reference.all, Mapping));
837 end Translate;
839 procedure Translate
840 (Source : in out Unbounded_Wide_String;
841 Mapping : Wide_Maps.Wide_Character_Mapping)
843 begin
844 Wide_Fixed.Translate (Source.Reference.all, Mapping);
845 end Translate;
847 function Translate
848 (Source : in Unbounded_Wide_String;
849 Mapping : in Wide_Maps.Wide_Character_Mapping_Function)
850 return Unbounded_Wide_String
852 begin
853 return
854 To_Unbounded_Wide_String
855 (Wide_Fixed.Translate (Source.Reference.all, Mapping));
856 end Translate;
858 procedure Translate
859 (Source : in out Unbounded_Wide_String;
860 Mapping : in Wide_Maps.Wide_Character_Mapping_Function)
862 begin
863 Wide_Fixed.Translate (Source.Reference.all, Mapping);
864 end Translate;
866 ----------
867 -- Trim --
868 ----------
870 function Trim
871 (Source : in Unbounded_Wide_String;
872 Side : in Trim_End)
873 return Unbounded_Wide_String
875 begin
876 return
877 To_Unbounded_Wide_String
878 (Wide_Fixed.Trim (Source.Reference.all, Side));
879 end Trim;
881 procedure Trim
882 (Source : in out Unbounded_Wide_String;
883 Side : in Trim_End)
885 Old : Wide_String_Access := Source.Reference;
886 begin
887 Source.Reference := new Wide_String'(Wide_Fixed.Trim (Old.all, Side));
888 Free (Old);
889 end Trim;
891 function Trim
892 (Source : in Unbounded_Wide_String;
893 Left : in Wide_Maps.Wide_Character_Set;
894 Right : in Wide_Maps.Wide_Character_Set)
895 return Unbounded_Wide_String
897 begin
898 return
899 To_Unbounded_Wide_String
900 (Wide_Fixed.Trim (Source.Reference.all, Left, Right));
901 end Trim;
903 procedure Trim
904 (Source : in out Unbounded_Wide_String;
905 Left : in Wide_Maps.Wide_Character_Set;
906 Right : in Wide_Maps.Wide_Character_Set)
908 Old : Wide_String_Access := Source.Reference;
910 begin
911 Source.Reference :=
912 new Wide_String'(Wide_Fixed.Trim (Old.all, Left, Right));
913 Free (Old);
914 end Trim;
916 end Ada.Strings.Wide_Unbounded;