Natools

Diff
Login

Differences From Artifact [25471d80ad]:

To Artifact [d3cf5765f6]:


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
   Subsecond_Separator : constant Character := '.';

   function Is_Valid (Image : String) return Boolean;
      --  Check whether Image is a valid RFC-3339 date

   function Image
     (Date : Ada.Calendar.Time;
      Subsecond_Digits : Natural := 0)

     return String
     with Post => Is_Valid (Image'Result);
      --  Return the RFC-3339 representation of Date in current time zone

   function Image
     (Date : Ada.Calendar.Time;
      Time_Zone : Ada.Calendar.Time_Zones.Time_Offset;
      Subsecond_Digits : Natural := 0)

     return String
     with Post => Is_Valid (Image'Result);
      --  Return the RFC-3339 representation of Date in Time_Zone

   function Value (Image : String) return Ada.Calendar.Time
     with Pre => Is_Valid (Image) or else raise Constraint_Error;
      --  Return the time associated with the given RFC-3339 representation

   procedure Value
     (Image : in String;
      Date : out Ada.Calendar.Time;
      Time_Zone : out Ada.Calendar.Time_Zones.Time_Offset)








     with Pre => Is_Valid (Image) or else raise Constraint_Error;
      --  Return the time associated with the given RFC-3339 representation

end Natools.Time_IO.RFC_3339;







|
>







|
>












>
>
>
>
>
>
>
>




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
   Subsecond_Separator : constant Character := '.';

   function Is_Valid (Image : String) return Boolean;
      --  Check whether Image is a valid RFC-3339 date

   function Image
     (Date : Ada.Calendar.Time;
      Subsecond_Digits : Natural := 0;
      Force_Leap_Second : Boolean := False)
     return String
     with Post => Is_Valid (Image'Result);
      --  Return the RFC-3339 representation of Date in current time zone

   function Image
     (Date : Ada.Calendar.Time;
      Time_Zone : Ada.Calendar.Time_Zones.Time_Offset;
      Subsecond_Digits : Natural := 0;
      Force_Leap_Second : Boolean := False)
     return String
     with Post => Is_Valid (Image'Result);
      --  Return the RFC-3339 representation of Date in Time_Zone

   function Value (Image : String) return Ada.Calendar.Time
     with Pre => Is_Valid (Image) or else raise Constraint_Error;
      --  Return the time associated with the given RFC-3339 representation

   procedure Value
     (Image : in String;
      Date : out Ada.Calendar.Time;
      Time_Zone : out Ada.Calendar.Time_Zones.Time_Offset)
     with Pre => Is_Valid (Image) or else raise Constraint_Error;
      --  Return the time associated with the given RFC-3339 representation

   procedure Value
     (Image : in String;
      Date : out Ada.Calendar.Time;
      Time_Zone : out Ada.Calendar.Time_Zones.Time_Offset;
      Leap_Second : out Boolean)
     with Pre => Is_Valid (Image) or else raise Constraint_Error;
      --  Return the time associated with the given RFC-3339 representation

end Natools.Time_IO.RFC_3339;