Natools

Check-in [9ef479b9be]
Login
Overview
Comment:s_expressions-file_writers: add a filename accessor function
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 9ef479b9be8e6e4fda5dc396f54ff0b0e05d5f37
User & Date: nat on 2014-06-06 19:04:20
Other Links: manifest | tags
Context
2014-06-07
17:11
s_expressions-file_rw_tests: new test suite for both S-expression file readers and writers check-in: 5787543b72 user: nat tags: trunk
2014-06-06
19:04
s_expressions-file_writers: add a filename accessor function check-in: 9ef479b9be user: nat tags: trunk
2014-06-05
20:20
s_expressions-file_writers: new package providing a pretty printer based on Stream_IO files check-in: 9d6c39db7d user: nat tags: trunk
Changes

Modified src/natools-s_expressions-file_writers.adb from [a9d77c7157] to [96c31e5d5b].

70
71
72
73
74
75
76






77
      Name : in String;
      Form : in String := "") is
   begin
      Finalize (Self.Holder);
      Stream_IO.Open (Self.Holder.File, Stream_IO.Append_File, Name, Form);
   end Open;







end Natools.S_Expressions.File_Writers;







>
>
>
>
>
>

70
71
72
73
74
75
76
77
78
79
80
81
82
83
      Name : in String;
      Form : in String := "") is
   begin
      Finalize (Self.Holder);
      Stream_IO.Open (Self.Holder.File, Stream_IO.Append_File, Name, Form);
   end Open;


   function Name (Self : Writer) return String is
   begin
      return Stream_IO.Name (Self.Holder.File);
   end Name;

end Natools.S_Expressions.File_Writers;

Modified src/natools-s_expressions-file_writers.ads from [9cd299dc99] to [01b696634e].

37
38
39
40
41
42
43



44
45
46
47
48
49
50
      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




private

   type Autoclose is new Ada.Finalization.Limited_Controlled with record
      File : Ada.Streams.Stream_IO.File_Type;
   end record;








>
>
>







37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
      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 Name (Self : Writer) return String;
      --  Return the underlying file name

private

   type Autoclose is new Ada.Finalization.Limited_Controlled with record
      File : Ada.Streams.Stream_IO.File_Type;
   end record;