C# Class HandCoded.Framework.Option

The Option class provide a basic command line processing capability. Instances of Option define the keywords to look for and the presence of associated parameters. The application should pass the entire set of command line strings recieved from Main to the processing function. The state of any option referenced by the strings is updated and any remaining strings are returned to the caller.
Datei anzeigen Open project: formicary/fpml-toolkit-csharp

Public Methods

Method Description
DescribeOptions ( ) : void

Prints out a description of the options and thier parameters.

ListOptions ( ) : string

Returns a string describing the available command line options.

Option ( string name, string description ) : System

Constructs a Option instance for an option that does not have a parameter.

Option ( string name, string description, string parameter ) : System

Constructs a Option instance for an option that has an associated parameter value (e.g. -output <file>).

ProcessArguments ( string arguments ) : string[]

Processes the command line arguments to extract options and parameter values.

ToString ( ) : string

Converts the instance data members to a string representation that can be displayed for debugging purposes.

Protected Methods

Method Description
ToDebug ( ) : string

Converts the instance's member values to string representations and concatenates them all together. This function is used by ToString and my be overwritten in derived classes.

Method Details

DescribeOptions() public static method

Prints out a description of the options and thier parameters.
public static DescribeOptions ( ) : void
return void

ListOptions() public static method

Returns a string describing the available command line options.
public static ListOptions ( ) : string
return string

Option() public method

Constructs a Option instance for an option that does not have a parameter.
public Option ( string name, string description ) : System
name string The name of the option (e.g. -help).
description string A description of the options purpose.
return System

Option() public method

Constructs a Option instance for an option that has an associated parameter value (e.g. -output <file>).
public Option ( string name, string description, string parameter ) : System
name string The name of the option (e.g. -output).
description string A description of the options purpose.
parameter string A description of the required parameter or /// null if none allowed.
return System

ProcessArguments() public static method

Processes the command line arguments to extract options and parameter values.
public static ProcessArguments ( string arguments ) : string[]
arguments string The command line arguments pass to Main
return string[]

ToDebug() protected method

Converts the instance's member values to string representations and concatenates them all together. This function is used by ToString and my be overwritten in derived classes.
protected ToDebug ( ) : string
return string

ToString() public method

Converts the instance data members to a string representation that can be displayed for debugging purposes.
public ToString ( ) : string
return string