Joutsen.ArgumentsParsing  v0.2.1
Public Member Functions | Protected Member Functions | Protected Attributes | Properties | List of all members
Joutsen.ArgumentsParsing.TargetPropertyArgument< ValueType > Class Template Reference

A base class that can be used to easily create implementations of ParserArgument. More...

Public Member Functions

virtual string Description (string name=null, string alternative=null)
 Fetches the description of this argument. More...
 
virtual string Usage (string name=null)
 Fetches the usage description of this argument. More...
 
ArgumentLiteralParser GetParser ()
 Fetchs the literal parser for this argument. More...
 

Protected Member Functions

 TargetPropertyArgument (ArgumentReader< ValueType > reader, string name, bool required, ValueType defaultValue, string destination, string help, bool isFlag)
 Creates a new instance of the argument. More...
 

Protected Attributes

string helpText
 
TargetPropertyParser< ValueType > parser
 

Properties

String Name [get]
 
bool IsRequired [get]
 

Detailed Description

A base class that can be used to easily create implementations of ParserArgument.

Since
0.1.0

Constructor & Destructor Documentation

◆ TargetPropertyArgument()

Joutsen.ArgumentsParsing.TargetPropertyArgument< ValueType >.TargetPropertyArgument ( ArgumentReader< ValueType >  reader,
string  name,
bool  required,
ValueType  defaultValue,
string  destination,
string  help,
bool  isFlag 
)
protected

Creates a new instance of the argument.

Parameters
namethe name of the argument
requiredindicates wether this argument has to appear in the input list or if it is optional
defaultValuethe value that wil be set onthe target for this argument if it is not required and did not appear int he input list
destiantionthe property name of the target instance which shall recieve the parsed value. If this is null the name will be used instead.
helpa help text describing the parameter. It will be used to generade the description of the argument.
Since
0.2.0

Member Function Documentation

◆ Description()

virtual string Joutsen.ArgumentsParsing.TargetPropertyArgument< ValueType >.Description ( string  name = null,
string  alternative = null 
)
virtual

Fetches the description of this argument.

Parameters
namefor arguments that are identified by their name in the input string, the name to incorporate into the description
alternativefor 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.

Reimplemented in Joutsen.ArgumentsParsing.ValueArgument< ValueType >, Joutsen.ArgumentsParsing.CollectionArgument< CollectionType, ValueType >, Joutsen.ArgumentsParsing.FlagArgument< TValueType >, and Joutsen.ArgumentsParsing.ChoiceArgument< ValueType >.

◆ GetParser()

Fetchs the literal parser for this argument.

Implements Joutsen.ArgumentsParsing.ParserArgument.

◆ Usage()

virtual string Joutsen.ArgumentsParsing.TargetPropertyArgument< ValueType >.Usage ( string  name = null)
virtual

Fetches the usage description of this argument.

Parameters
namefor 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.

Reimplemented in Joutsen.ArgumentsParsing.ValueArgument< ValueType >, Joutsen.ArgumentsParsing.CollectionArgument< CollectionType, ValueType >, and Joutsen.ArgumentsParsing.FlagArgument< TValueType >.

Member Data Documentation

◆ helpText

string Joutsen.ArgumentsParsing.TargetPropertyArgument< ValueType >.helpText
protected

◆ parser

Property Documentation

◆ IsRequired

bool Joutsen.ArgumentsParsing.TargetPropertyArgument< ValueType >.IsRequired
get

◆ Name