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
|
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
|
+
-
+
|
procedure Process_Input;
-- Read lines from current input and process them.
Input_Processed : Boolean := False;
Empty : Boolean := True;
Verbose : Boolean := False;
Subsecond_Digits : Natural := Duration'Aft;
procedure Process (Line : in String) is
begin
if Verbose then
Ada.Text_IO.Put (Line);
end if;
if Natools.Time_Keys.Is_Valid (Line) then
if Verbose then
Ada.Text_IO.Put (" => ");
end if;
Ada.Text_IO.Put_Line
(Natools.Time_IO.RFC_3339.Image
(Natools.Time_Keys.To_Time (Line), Duration'Aft, False));
(Natools.Time_Keys.To_Time (Line), Subsecond_Digits, False));
elsif Natools.Time_IO.RFC_3339.Is_Valid (Line) then
if Verbose then
Ada.Text_IO.Put (" => ");
end if;
Ada.Text_IO.Put_Line
|
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
|
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
|
-
+
|
if Empty then
declare
Now : constant Ada.Calendar.Time := Ada.Calendar.Clock;
begin
if Verbose then
Ada.Text_IO.Put
(Natools.Time_IO.RFC_3339.Image (Now, Duration'Aft, False)
(Natools.Time_IO.RFC_3339.Image (Now, Subsecond_Digits, False)
& " => ");
end if;
Ada.Text_IO.Put_Line (Natools.Time_Keys.To_Key (Now));
end;
end if;
end Timekey;
|