|
Joutsen.ArgumentsParsing
v0.2.1
|
A reader that processes a value from the input literals allowing only a limited number of resulting values. More...
Public Member Functions | |
| ChoiceArgumentReader (Set< ValueType > choices) | |
| Creates a new instance of the reader for a number of allowed result values which implement the IConvertible interface. More... | |
| ChoiceArgumentReader (Set< ValueType > choices, SimpleTypeConverter< string, ValueType > converter) | |
| Creates a new instance of the reader for a number of allowed result values which can be converted by a custom converter. More... | |
| override ArgumentReadResult< ValueType > | Read (ArgumentsIterator args, string name, int offset=0) |
| Reads literals from the input to create a resulting value. More... | |
Public Member Functions inherited from Joutsen.ArgumentsParsing.ValueArgumentReader< ValueType > | |
| ValueArgumentReader () | |
| Creates a new instance for resulting types which implement the IConvertible interface. More... | |
| ValueArgumentReader (SimpleTypeConverter< string, ValueType > converter) | |
| Creates a new instance using a custom converter to produce the result value. More... | |
| ValueArgumentReader (SimpleTypeConverter< string, ValueType > converter, String startDelimiter, String endDelimiter, String partConnector, bool keepDelimiters) | |
| Creates a new instance using a custom converter for delimited values to produce the result value. More... | |
Properties | |
| Set< ValueType > | Choices [get] |
| The allowed values for the read result. More... | |
Properties inherited from Joutsen.ArgumentsParsing.ValueArgumentReader< ValueType > | |
| virtual String | ValueStartDelimiter [get, set] |
| The delimiter that determines the start of a delimited value. More... | |
| virtual String | ValueEndDelimiter [get, set] |
| The delimiter that determines the end of a delimited value. More... | |
| virtual String | ValuePartsConnector [get, set] |
| The value that is added between the different literals read from the input when reading a delimited value. More... | |
| virtual bool | KeepDelimiters [get, set] |
| Determines if the resulting value should contain the delimiters or not. More... | |
| Set< String > | ArgumentPrefixes [set] |
| virtual SimpleTypeConverter< string, ValueType > | TypeConverter [get, set] |
| The converter used to change the read literals into a different type. More... | |
Properties inherited from Joutsen.ArgumentsParsing.ArgumentReader< ValueType > | |
| Set< String > | ArgumentPrefixes [set] |
| The prefixes of the arguments used by the parser. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from Joutsen.ArgumentsParsing.ValueArgumentReader< ValueType > | |
| virtual ArgumentReadResult< ValueType > | ReadToEndDelimiter (ArgumentsIterator arguments, string name, int offset) |
| Reads multiple literals from the input until the end delimiter is found. More... | |
| virtual ValueType | GetParsedValue (StringBuilder fullArgument, String name) |
| Combines multiple literals into a single result value. More... | |
| virtual ValueType | GetParsedValue (string value, string argumentName) |
| Converts a read value into the target type. More... | |
Protected Attributes inherited from Joutsen.ArgumentsParsing.ValueArgumentReader< ValueType > | |
| SimpleTypeConverter< string, ValueType > | _converter |
| The converter used to change the read literals into a different type. More... | |
A reader that processes a value from the input literals allowing only a limited number of resulting values.
| Joutsen.ArgumentsParsing.ChoiceArgumentReader< ValueType >.ChoiceArgumentReader | ( | Set< ValueType > | choices | ) |
Creates a new instance of the reader for a number of allowed result values which implement the IConvertible interface.
| Joutsen.ArgumentsParsing.ChoiceArgumentReader< ValueType >.ChoiceArgumentReader | ( | Set< ValueType > | choices, |
| SimpleTypeConverter< string, ValueType > | converter | ||
| ) |
Creates a new instance of the reader for a number of allowed result values which can be converted by a custom converter.
|
virtual |
Reads literals from the input to create a resulting value.
| args | the input list of literal values represented by an iterator |
| name | the name of the argument whose values to read as found in the input |
| offset | an optional additional offset of literals where to start reading from the input |
| ArgumentParseException | if a value cannot be converted to the ValueType, if a delimited value is not 'closed' correctly or if the resulting value does not match one of the allowed values |
Reimplemented from Joutsen.ArgumentsParsing.ValueArgumentReader< ValueType >.
|
get |
The allowed values for the read result.
1.8.13