4
type Parameter_Index is (<>);
5
package Generic_Line_Parser.Storing is
6
type Parameter_Type is (Str, Real, Int);
8
type Action_Descriptor is
9
new Ada.Finalization.Limited_Controlled
12
function Call (Callback : Parameter_Callback) return Action_Descriptor;
14
function Store (Name : Parameter_Index;
15
Format : Parameter_Type)
16
return Action_Descriptor;
19
type Extended_Descriptor is
21
Name : Unbounded_String; -- Parameter name
22
Default : Unbounded_String; -- Default value used if not on C.L.
23
If_Missing : Missing_Action; -- What to do if parameter missing
24
Only_Once : Boolean; -- Parameter MUST NOT be given more than once
25
Action : Action_Descriptor;
28
type Extended_Descriptor_Array is
29
array (Natural range <>) of Extended_Descriptor;
31
procedure Parse_Command_Line
32
(Parameters : in Extended_Descriptor_Array;
33
Result : out Config_Data;
34
Help_Line : in String := "";
35
Help_Output : in Ada.Text_IO.File_Type := Ada.Text_IO.Standard_Error);
37
function Get (Name : Parameter_Index) return Integer;
38
function Get (Name : Parameter_Index) return Float;
39
function Get (Name : Parameter_Index) return String;
41
type Action_Class is (Call, Store);
43
type Action_Internal_Descriptor (Class : Action_Class) is
47
Handle : Parameter_Callback;
50
Where : Parameter_Index;
51
Format : Parameter_Type;
55
type Access_Internal_Descriptor is
56
access Action_Internal_Descriptor;
58
type Action_Descriptor is
59
new Ada.Finalization.Limited_Controlled with
61
Handle : Access_Internal_Descriptor;
64
overriding procedure Finalize (Object : in out Action_Descriptor);
65
end Generic_Line_Parser.Storing;