Add API calls
This commit is contained in:
parent
cea7bb8db9
commit
a0cd38fb82
|
|
@ -1,10 +1,10 @@
|
|||
with Ada.Strings.Unbounded; use Ada.Strings.Unbounded;
|
||||
|
||||
package Argument_Parser is
|
||||
|
||||
type Option is interface;
|
||||
|
||||
function Parse (I : string) return Option is abstract;
|
||||
|
||||
type Argument_Parser is tagged private;
|
||||
function Parse (I : String) return Option is abstract;
|
||||
|
||||
procedure Add_Positional (
|
||||
Parser : in out Argument_Parser;
|
||||
|
|
@ -15,7 +15,7 @@ package Argument_Parser is
|
|||
procedure Add_Boolean_Option (
|
||||
Parser : in out Argument_Parser;
|
||||
Short_String : string;
|
||||
Long_String : string)
|
||||
Long_String : string);
|
||||
|
||||
procedure Add_Count_Option (
|
||||
Parser : in out Argument_Parser;
|
||||
|
|
@ -29,6 +29,30 @@ package Argument_Parser is
|
|||
Short_String : string;
|
||||
Long_String : string);
|
||||
|
||||
type String_Option is new Option with
|
||||
record
|
||||
Value : Unbounded_String;
|
||||
end record;
|
||||
|
||||
overriding
|
||||
function Parse (I : String) return String_Option;
|
||||
|
||||
type Integer_Option is new Option with
|
||||
record
|
||||
Value : Integer;
|
||||
end record;
|
||||
|
||||
overriding
|
||||
function Parse (I : String) return Integer_Option;
|
||||
|
||||
type Float_Option is new Option with
|
||||
record
|
||||
Value : Float;
|
||||
end record;
|
||||
|
||||
overriding
|
||||
function Parse (I : String) return Float_Option;
|
||||
|
||||
private
|
||||
|
||||
type Argument_Parser is tagged null record;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user