stephes_ada_library_3.7.3_08b48307/source/sal-unix_text_io.ads

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
--  Abstract :
--
--  Replacement for subset of Ada.Text_IO, using Unix line endings
--  on all platforms.
--
--  For very large files, this is significantly faster than Text_IO
--  output followed by dos2unix.
--
--  Copyright (C) 2020 Free Software Foundation All Rights Reserved.
--
--  This library is free software;  you can redistribute it and/or modify it
--  under terms of the  GNU General Public License  as published by the Free
--  Software  Foundation;  either version 3,  or (at your  option) any later
--  version. This library is distributed in the hope that it will be useful,
--  but WITHOUT ANY WARRANTY;  without even the implied warranty of MERCHAN-
--  TABILITY or FITNESS FOR A PARTICULAR PURPOSE.

pragma License (Modified_GPL);

private with Ada.Streams.Stream_IO;
package SAL.Unix_Text_IO is

   type File_Type is limited private;

   type File_Mode is (In_File, Out_File, Append_File);

   procedure Create
     (File : in out File_Type;
      Mode : in     File_Mode := Out_File;
      Name : in     String    := "";
      Form : in     String    := "");

   procedure Close (File : in out File_Type);

   procedure Put (File : in File_Type; Item : in Character);
   procedure Put (File : in File_Type; Item : in String);

   procedure Put_Line (File : in File_Type; Item : in String);

   procedure New_Line (File : in File_Type);

private
   type File_Type is limited record
      Stream : Ada.Streams.Stream_IO.File_Type;
   end record;

end SAL.Unix_Text_IO;