1515-- of the license. --
1616-- ----------------------------------------------------------------------------
1717
18- with VSS.Stream_Element_Vectors .Conversions ;
18+ with VSS.Strings .Conversions ;
1919
2020package body Streams is
2121
@@ -25,7 +25,8 @@ package body Streams is
2525
2626 procedure Close (Self : in out Output_Text_Stream'Class) is
2727 begin
28- GNATCOLL.VFS.Close (Self.Writable);
28+ VSS.Text_Streams.File_Output.File_Output_Text_Stream
29+ (Self).Close;
2930 end Close ;
3031
3132 -- --------
@@ -36,28 +37,9 @@ package body Streams is
3637 (Self : in out Output_Text_Stream'Class;
3738 File : GNATCOLL.VFS.Virtual_File) is
3839 begin
39- Self.Encoder.Initialize (" utf-8" );
40- Self.Writable := File.Write_File;
40+ Self.Create
41+ (VSS.Strings.Conversions.To_Virtual_String (File.Display_Full_Name),
42+ " utf-8" );
4143 end Open ;
4244
43- -- -------
44- -- Put --
45- -- -------
46-
47- overriding procedure Put
48- (Self : in out Output_Text_Stream;
49- Item : VSS.Characters.Virtual_Character;
50- Success : in out Boolean)
51- is
52- pragma Unreferenced (Success);
53-
54- Data : constant String :=
55- VSS.Stream_Element_Vectors.Conversions.Unchecked_To_String
56- (Self.Encoder.Encode (Item));
57-
58- begin
59- GNATCOLL.VFS.Write (Self.Writable, Data);
60- -- Note, any errors are reported at the time of file close only.
61- end Put ;
62-
6345end Streams ;
0 commit comments