1 ------------------------------------------------------------------------------
3 -- GNAT RUNTIME COMPONENTS --
5 -- ADA.STRINGS.WIDE_UNBOUNDED.WIDE_TEXT_IO --
10 -- Copyright (C) 1997-1999 Free Software Foundation, Inc. --
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. --
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. --
30 -- GNAT was originally developed by the GNAT team at New York University. --
31 -- Extensive contributions were provided by Ada Core Technologies Inc. --
33 ------------------------------------------------------------------------------
35 with Ada
.Wide_Text_IO
; use Ada
.Wide_Text_IO
;
37 package body Ada
.Strings
.Wide_Unbounded
.Wide_Text_IO
is
43 function Get_Line
return Unbounded_Wide_String
is
44 Buffer
: Wide_String (1 .. 1000);
46 Str1
: Wide_String_Access
;
47 Str2
: Wide_String_Access
;
50 Get_Line
(Buffer
, Last
);
51 Str1
:= new Wide_String'(Buffer (1 .. Last));
53 while Last = Buffer'Last loop
54 Get_Line (Buffer, Last);
55 Str2 := new Wide_String'(Str1
.all & Buffer
(1 .. Last
));
60 return To_Unbounded_Wide_String
(Str1
.all);
64 (File
: Ada
.Wide_Text_IO
.File_Type
)
65 return Unbounded_Wide_String
67 Buffer
: Wide_String (1 .. 1000);
69 Str1
: Wide_String_Access
;
70 Str2
: Wide_String_Access
;
73 Get_Line
(File
, Buffer
, Last
);
74 Str1
:= new Wide_String'(Buffer (1 .. Last));
76 while Last = Buffer'Last loop
77 Get_Line (File, Buffer, Last);
78 Str2 := new Wide_String'(Str1
.all & Buffer
(1 .. Last
));
83 return To_Unbounded_Wide_String
(Str1
.all);
90 procedure Put
(U
: Unbounded_Wide_String
) is
92 Put
(To_Wide_String
(U
));
95 procedure Put
(File
: File_Type
; U
: Unbounded_Wide_String
) is
97 Put
(File
, To_Wide_String
(U
));
104 procedure Put_Line
(U
: Unbounded_Wide_String
) is
106 Put_Line
(To_Wide_String
(U
));
109 procedure Put_Line
(File
: File_Type
; U
: Unbounded_Wide_String
) is
111 Put_Line
(File
, To_Wide_String
(U
));
114 end Ada
.Strings
.Wide_Unbounded
.Wide_Text_IO
;