Natools

Diff
Login

Differences From Artifact [01b696634e]:

To Artifact [595ca22ff2]:


1
2

3
4
5
6
7
8
9
1

2
3
4
5
6
7
8
9

-
+







------------------------------------------------------------------------------
-- Copyright (c) 2014, Natacha Porté                                        --
-- Copyright (c) 2014-2017, Natacha Porté                                   --
--                                                                          --
-- Permission to use, copy, modify, and distribute this software for any    --
-- purpose with or without fee is hereby granted, provided that the above   --
-- copyright notice and this permission notice appear in all copies.        --
--                                                                          --
-- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES --
-- WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF         --
37
38
39
40
41
42
43










44
45
46
47
48
49
50
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60







+
+
+
+
+
+
+
+
+
+







      Name : in String;
      Form : in String := "");
   procedure Open
     (Self : in out Writer;
      Name : in String;
      Form : in String := "");
      --  Reinitialize Self using Stream_IO.Create or Stream_IO.Open

   function Open_Or_Create (Name : String; Form : String := "") return Writer;
   procedure Open_Or_Create
     (Self : in out Writer;
      Name : in String;
      Form : in String := "");
      --  Construct or reinitialize a writer, trying a regular open first
      --  and attempting to create if it doesn't work.
      --  Note that there is some time between failure to open and actual
      --  file creation, which might lead to race conditions.

   function Name (Self : Writer) return String;
      --  Return the underlying file name

private

   type Autoclose is new Ada.Finalization.Limited_Controlled with record