TCustomConsoleInputParser
TCustomConsoleInputParser is an abstract class which defines the basic structure of a console parser.
Available functionality (users)
Available functionality (developers)
Create
constructor Create(AnInput: String = '');
Creates an instance of TCustomConsoleInputParser; optionally, it sets and parses the given string in AnInput.
SetInput
procedure SetInput(AnInput: String);
Sets the string to be parsed. After setting, the string will be parsed immediately.
GetCommand
function GetCommand: String;
Returns the command out of the parsed input. Example: "echo foo" returns "echo". Please note that calling GetCommand several times will not result in calling the parsing - the parsing is done immediately after having set the input.
GetParameters
function GetParameters: TStringArray;
Returns the parameters out of the parsed input. Example: "echo foo bar" returns the parameters "foo" and "bar". The return value is a dynamic string array.
FParse
procedure FParse;
FParse is the parsing function which is executed directly after the change of the input. The parsing function's task is to parse the FInput string and store the command in the FCommand variable and the parameters in the FParameters string array.