Joutsen.ArgumentsParsing  v0.2.1
Public Member Functions | Static Public Member Functions | Properties | List of all members
Joutsen.ArgumentsParsing.CollectionArgument< CollectionType, ValueType > Class Template Reference

An argument that parses multiple input values in order to create a list. More...

Public Member Functions

 CollectionArgument (string name, ValueCount valueCount, bool required=true, CollectionType defaultValue=default(CollectionType), string destination=null, string help=null)
 Creates a new instance of the argument. More...
 
override string Usage (string name=null)
 
override string Description (string name=null, string alternative=null)
 
- Public Member Functions inherited from Joutsen.ArgumentsParsing.TargetPropertyArgument< CollectionType >
ArgumentLiteralParser GetParser ()
 Fetchs the literal parser for this argument. More...
 

Static Public Member Functions

static CollectionArgument< CollectionType, ValueType > Create< TargetType, CollectionType, ValueType > (string name, ValueCount valueCount, bool required=true, CollectionType defaultValue=default(CollectionType), Expression< Func< TargetType, CollectionType >> destination=null, string help=null)
 Creates a new instance of the CollectionArgument. More...
 

Properties

String ValueStartDelimiter [get, set]
 The delimiter indicating the start of the combined value. More...
 
String ValueEndDelimiter [get, set]
 The delimiter indicating the end of the combined value. More...
 
String ValuePartsConnector [get, set]
 A term that is used to connect the values from the input list into a single parsed one. More...
 
bool KeepDelimiters [get, set]
 Determiens wether the delimiters are part of the resulting value or not. More...
 
SimpleTypeConverter< String, ValueType > TypeConverter [get, set]
 
- Properties inherited from Joutsen.ArgumentsParsing.TargetPropertyArgument< CollectionType >
String Name [get]
 
bool IsRequired [get]
 

Additional Inherited Members

- Protected Member Functions inherited from Joutsen.ArgumentsParsing.TargetPropertyArgument< CollectionType >
 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 inherited from Joutsen.ArgumentsParsing.TargetPropertyArgument< CollectionType >
string helpText
 
TargetPropertyParser< ValueType > parser
 

Detailed Description

An argument that parses multiple input values in order to create a list.

A static class offering convenient ways to create CollectionArguments.

Remarks
The number of values that are actually parsed is determined by a count operator which can specify a minimum, a maximum, boundaries, an exact number or all the remaining arguments. This parsing behaviour is also limited by the next recognized argument. See ValueCount for details.
Since
0.2.0
0.2.0
Type Constraints
CollectionType :Collection<ValueType> 
CollectionType :new() 

Constructor & Destructor Documentation

◆ CollectionArgument()

Joutsen.ArgumentsParsing.CollectionArgument< CollectionType, ValueType >.CollectionArgument ( string  name,
ValueCount  valueCount,
bool  required = true,
CollectionType  defaultValue = default(CollectionType),
string  destination = null,
string  help = null 
)

Creates a new instance of the argument.

Parameters
namethe name of the argument
valueCountthe operator that determines how any values to parse
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
destinationthe property name of the target instance which shall receive the parsed value. If this is null the name will be used instead.
helpa help text describing the parameter. It will be used to generate the description of the argument.

Member Function Documentation

◆ Create< TargetType, CollectionType, ValueType >()

static CollectionArgument<CollectionType, ValueType> Joutsen.ArgumentsParsing.CollectionArgument< CollectionType, ValueType >.Create< TargetType, CollectionType, ValueType > ( string  name,
ValueCount  valueCount,
bool  required = true,
CollectionType  defaultValue = default(CollectionType),
Expression< Func< TargetType, CollectionType >>  destination = null,
string  help = null 
)
static

Creates a new instance of the CollectionArgument.

Template Parameters
TargetTypethe type of the target object that will receive the parsed values.
CollectionTypethe type of the collection of the argument and the property on the target object
ValueTypethe type of the elements of the collection
Parameters
namethe name of the argument
valueCountthe operator that determines how any values to parse
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
destinationan expression describing the property of the target instance which shall recieve the parsed value. If this is null the target property will be found using the name of the argument.
helpa help text describing the parameter. It will be used to generate the description of the argument.
Type Constraints
CollectionType :Collection<ValueType> 
CollectionType :new() 

◆ Description()

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

◆ Usage()

override string Joutsen.ArgumentsParsing.CollectionArgument< CollectionType, ValueType >.Usage ( string  name = null)
virtual

Property Documentation

◆ KeepDelimiters

bool Joutsen.ArgumentsParsing.CollectionArgument< CollectionType, ValueType >.KeepDelimiters
getset

Determiens wether the delimiters are part of the resulting value or not.

◆ TypeConverter

SimpleTypeConverter<String,ValueType> Joutsen.ArgumentsParsing.CollectionArgument< CollectionType, ValueType >.TypeConverter
getset

◆ ValueEndDelimiter

String Joutsen.ArgumentsParsing.CollectionArgument< CollectionType, ValueType >.ValueEndDelimiter
getset

The delimiter indicating the end of the combined value.

◆ ValuePartsConnector

String Joutsen.ArgumentsParsing.CollectionArgument< CollectionType, ValueType >.ValuePartsConnector
getset

A term that is used to connect the values from the input list into a single parsed one.

◆ ValueStartDelimiter

String Joutsen.ArgumentsParsing.CollectionArgument< CollectionType, ValueType >.ValueStartDelimiter
getset

The delimiter indicating the start of the combined value.