zipada_56.0.2_b3043499/extras/ada_directories_extensions.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
--  (c) Martin M. Dowie, 2003-2004
--
--  This is a non-standard extension to the approved package. It is
--  currently implemented for Win32 only.
--
--  GdM 2009-2010:
--  - Moved Validate, which is not in Ada 2005's Ada.Directories
--  - Renamed with '_' to compile with the "true" GNAT Ada.Directories.

pragma License (Modified_GPL);

with Ada.Directories; use Ada.Directories; -- ...

with Ada.Calendar;

package Ada_Directories_Extensions is

   Not_Supported : exception;
   --  Can be because the underlying OS does not support this feature
   --  or because the implementation does not yet support this feature.

   procedure Touch_Modification_Time
      (Directory_Entry : in Directory_Entry_Type);
   --  Sets the modification of the file specified by <EM>Directory_Entry</EM>
   --  to the current system time. Raises Name_Error if the file does not
   --  exist or Use_Error if <EM>Name</EM> is an invalid directory
   --  entry.

   procedure Touch_Modification_Time (Name : in String);
   --  Sets the modification of the file specified by <EM>Name</EM> to
   --  the current system time. Raises Name_Error if the file does not
   --  exist or Use_Error if <EM>Name</EM> is an invalid directory
   --  entry.

   procedure Set_Access_Time (Directory_Entry : in Directory_Entry_Type;
                              To : in Ada.Calendar.Time);
   --  Set the access time of the file specified by <EM>Directory_Entry</EM> to
   --  the value <EM>To</EM>. Raises Name_Error if the file does not
   --  exist or Use_Error if <EM>Name</EM> is an invalid directory
   --  entry.

   procedure Set_Access_Time (Name : in String;
                              To : in Ada.Calendar.Time);
   --  Set the access time of the file specified by <EM>Name</EM> to
   --  the value <EM>To</EM>. Raises Name_Error if the file does not
   --  exist or Use_Error if <EM>Name</EM> is an invalid directory
   --  entry.

   procedure Set_Modification_Time (Directory_Entry : in Directory_Entry_Type;
                                    To : in Ada.Calendar.Time);
   --  Set the modification time of the file specified by
   --  <EM>Directory_Entry</EM> to the value <EM>To</EM>. Raises Name_Error if
   --  the file does not exist or Use_Error if <EM>Name</EM> is an invalid
   --  directory entry.

   procedure Set_Modification_Time (Name : in String;
                                    To : in Ada.Calendar.Time);
   --  Set the modification time of the file specified by <EM>Name</EM>
   --  to the value <EM>To</EM>. Raises Name_Error if the file does not
   --  exist or Use_Error if <EM>Name</EM> is an invalid directory
   --  entry.

   procedure Set_Times (Directory_Entry : in Directory_Entry_Type;
                        Access_Time : in Ada.Calendar.Time;
                        Modification_Time : in Ada.Calendar.Time);
   --  Set the access and modification times of the file specified by
   --  <EM>Directory_Entry</EM> to the values <EM>Access_Time</EM> and
   --  <EM>Modification_Time</EM>. Raises Name_Error if the file does
   --  not exist or Use_Error if <EM>Name</EM> is an invalid directory
   --  entry.

   procedure Set_Times (Name : in String;
                        Access_Time : in Ada.Calendar.Time;
                        Modification_Time : in Ada.Calendar.Time);
   --  Set the access and modification times of the file specified by
   --  <EM>Name</EM> to the values <EM>Access_Time</EM> and
   --  <EM>Modification_Time</EM>. Raises Name_Error if the file does
   --  not exist or Use_Error if <EM>Name</EM> is an invalid directory
   --  entry.

   --------------
   -- Validate --
   --------------

   procedure Validate (Name : in Directory_Entry_Type);

   --------------
   -- Validate --
   --------------

   procedure Validate (Name : in String);

end Ada_Directories_Extensions;