A base class that can be used to easily create implementations of DisplayArgument.
More...
|
| | AbstractDisplayArgument (String name, String alternative, DisplayException displayException, String help) |
| | Creates a new instance. More...
|
| |
| string | Usage (string name=null) |
| | Fetches the usage description of this argument. More...
|
| |
| string | Description (string name=null, string alternative=null) |
| | Fetches the description of this argument. More...
|
| |
| virtual ArgumentLiteralParser | GetParser () |
| | Fetchs the literal parser for this argument. More...
|
| |
| object | SetDefaultValue (object target, string name=null) |
| | Sets the default value of the argument to a target object. More...
|
| |
| virtual ParseResult | Parse (ArgumentsIterator args, object target, string name=null) |
| | Parses the relevant argument in the list and modifies the target object with it. More...
|
| |
| string | Description (string name=null, string alternative=null) |
| | Fetches the description of this argument. More...
|
| |
| string | Usage (string name=null) |
| | Fetches the usage description of this argument. More...
|
| |
| ArgumentLiteralParser | GetParser () |
| | Fetchs the literal parser for this argument. More...
|
| |
| ParseResult | Parse (ArgumentsIterator args, object target, string name=null) |
| | Parses the relevant argument in the list and modifies the target object with it. More...
|
| |
| void | Reset () |
| | Clears the parsers state if any in order to prepare it for a new run. More...
|
| |
| object | SetDefaultValue (object target, string name=null) |
| | Sets the default value of the argument to a target object. More...
|
| |
|
| virtual bool | MatchesArgument (String argument) |
| | Checks if an input value matches the argument's name or alternative name. More...
|
| |
|
| bool | IsRequired [get] |
| |
| virtual bool | IsFlag [get] |
| | Determines if this argument is nearly a flag (name only) or uses values. More...
|
| |
| string | Name [get] |
| | The name that identifies the argument in the input list. More...
|
| |
| string | Alternative [get] |
| | The alternative name that identifies the argument in the input list. More...
|
| |
| String | Name [get] |
| | The name that identifies the argument in the input list. More...
|
| |
| String | Alternative [get] |
| | The alternative name that identifies the argument in the input list. More...
|
| |
| ArgumentsListParser | ParentParser [set] |
| | The list parser this literal parser belongs to. More...
|
| |
| bool | IsFlag [get] |
| | Determines if this argument is nearly a flag (name only) or uses values. More...
|
| |
A base class that can be used to easily create implementations of DisplayArgument.
- Since
- 0.2.0
◆ AbstractDisplayArgument()
| Joutsen.ArgumentsParsing.AbstractDisplayArgument.AbstractDisplayArgument |
( |
String |
name, |
|
|
String |
alternative, |
|
|
DisplayException |
displayException, |
|
|
String |
help |
|
) |
| |
Creates a new instance.
- Parameters
-
| name | the name that identifies the argument in the input list |
| alternative | the alternative name that identifies the argument in the input list |
| help | additional description that will be part of this arguments description |
◆ Description()
| string Joutsen.ArgumentsParsing.AbstractDisplayArgument.Description |
( |
string |
name = null, |
|
|
string |
alternative = null |
|
) |
| |
Fetches the description of this argument.
- Parameters
-
| name | for arguments that are identified by their name in the input string, the name to incorporate into the description |
| alternative | for arguments that are identified by their alternative name in the input string, the alternative name to incorporate into the description |
- Returns
- the description
Implements Joutsen.ArgumentsParsing.ParserArgument.
◆ GetParser()
◆ MatchesArgument()
| virtual bool Joutsen.ArgumentsParsing.AbstractDisplayArgument.MatchesArgument |
( |
String |
argument | ) |
|
|
protectedvirtual |
Checks if an input value matches the argument's name or alternative name.
◆ Parse()
Parses the relevant argument in the list and modifies the target object with it.
- Parameters
-
| args | the list of input strings that need to be parsed |
| target | the receiver of the parsed values |
| name | an optional name of the argument that is being parsed. This is usually only used for arguments that are identified by their name. |
- Returns
- the modified target object and the arguments that still need to be parsed as a PareseResult instance.
Implements Joutsen.ArgumentsParsing.ArgumentLiteralParser.
◆ SetDefaultValue()
| object Joutsen.ArgumentsParsing.AbstractDisplayArgument.SetDefaultValue |
( |
object |
target, |
|
|
string |
name = null |
|
) |
| |
Sets the default value of the argument to a target object.
- Parameters
-
| target | the receiver of the default value |
| name | an optional name of this argument. This is usually only used for arguments that are identified by their name. |
- Returns
- the modified target object
- Since
- 0.2.0
Implements Joutsen.ArgumentsParsing.ArgumentLiteralParser.
◆ Usage()
| string Joutsen.ArgumentsParsing.AbstractDisplayArgument.Usage |
( |
string |
name = null | ) |
|
Fetches the usage description of this argument.
- Parameters
-
| name | for arguments that are identified by their name in the input string, the name to incorporate into the description |
- Returns
- the usage description
Implements Joutsen.ArgumentsParsing.ParserArgument.
◆ help
| String Joutsen.ArgumentsParsing.AbstractDisplayArgument.help |
|
protected |
◆ parser
◆ Alternative
| string Joutsen.ArgumentsParsing.AbstractDisplayArgument.Alternative |
|
get |
◆ IsFlag
| virtual bool Joutsen.ArgumentsParsing.AbstractDisplayArgument.IsFlag |
|
get |
◆ IsRequired
| bool Joutsen.ArgumentsParsing.AbstractDisplayArgument.IsRequired |
|
get |
◆ Name
| string Joutsen.ArgumentsParsing.AbstractDisplayArgument.Name |
|
get |