Joutsen.ArgumentsParsing  v0.2.1
Classes | Public Member Functions | Static Public Member Functions | Protected Member Functions | Properties | List of all members
Joutsen.ArgumentsParsing.ValueCount Class Referenceabstract

An operator determining the number of values to consume to create a list of parsed values from the input list. More...

Public Member Functions

abstract bool Reached (ArgumentsIterator arguments, int numberParsedArguments, int readPosition, IEnumerable< String > argumentPrefixes=null)
 Checks if the value count has been reached. More...
 
abstract String ToString (String name)
 Creates a string representation of the instance including the argument name. More...
 
override String ToString ()
 Creates a string representation of the instance. More...
 

Static Public Member Functions

static ValueCount Exactly (uint count)
 Creates a ValueCount that matches exactly count values. More...
 
static ValueCount AtLeast (uint count)
 Creates a ValueCount that matches count values or more. More...
 
static ValueCount Remainder ()
 Creates a ValueCount that matches all values that remain in the input list. More...
 
static ValueCount AtMost (uint count)
 Creates a ValueCount that matches count values or less. More...
 
static ValueCount Between (uint minCount, uint maxCount)
 Creates a ValueCount that matches at least minCount and at most maxCount values. More...
 

Protected Member Functions

bool HasMoreUnparsedArguments (ArgumentsIterator arguments, IEnumerable< String > argumentPrefixes, int skipCount)
 Checks if the input list contains more values that can be parsed. More...
 

Properties

bool RequiresValues [get, protected set]
 Determines if the value count requires at least one value to be consumed. More...
 

Detailed Description

An operator determining the number of values to consume to create a list of parsed values from the input list.

Since
0.1.0

Member Function Documentation

◆ AtLeast()

static ValueCount Joutsen.ArgumentsParsing.ValueCount.AtLeast ( uint  count)
static

Creates a ValueCount that matches count values or more.

◆ AtMost()

static ValueCount Joutsen.ArgumentsParsing.ValueCount.AtMost ( uint  count)
static

Creates a ValueCount that matches count values or less.

◆ Between()

static ValueCount Joutsen.ArgumentsParsing.ValueCount.Between ( uint  minCount,
uint  maxCount 
)
static

Creates a ValueCount that matches at least minCount and at most maxCount values.

◆ Exactly()

static ValueCount Joutsen.ArgumentsParsing.ValueCount.Exactly ( uint  count)
static

Creates a ValueCount that matches exactly count values.

◆ HasMoreUnparsedArguments()

bool Joutsen.ArgumentsParsing.ValueCount.HasMoreUnparsedArguments ( ArgumentsIterator  arguments,
IEnumerable< String >  argumentPrefixes,
int  skipCount 
)
protected

Checks if the input list contains more values that can be parsed.

Parameters
argumentsthe iterator of the input list
argumentPrefixesthe possible prefixes of arguments identified by thier names
skipCountthe number of values to skip as a look ahead when checking for more values
Returns
true if additional values can be parsed, otherwise false

◆ Reached()

abstract bool Joutsen.ArgumentsParsing.ValueCount.Reached ( ArgumentsIterator  arguments,
int  numberParsedArguments,
int  readPosition,
IEnumerable< String >  argumentPrefixes = null 
)
pure virtual

Checks if the value count has been reached.

Template Parameters
Ttype of the parsed arguments
Parameters
argumentsthe iterator of the input list
parsedArgumentsthe values that have already been consumed/parsed
argumentPrefixesthe possible prefixes of arguments identified by thier names
Returns
true if enough values have been consumed to satisfy the value count and there are no more input values to consume, otherwise false

◆ Remainder()

static ValueCount Joutsen.ArgumentsParsing.ValueCount.Remainder ( )
static

Creates a ValueCount that matches all values that remain in the input list.

◆ ToString() [1/2]

abstract String Joutsen.ArgumentsParsing.ValueCount.ToString ( String  name)
pure virtual

Creates a string representation of the instance including the argument name.

◆ ToString() [2/2]

override String Joutsen.ArgumentsParsing.ValueCount.ToString ( )

Creates a string representation of the instance.

Property Documentation

◆ RequiresValues

bool Joutsen.ArgumentsParsing.ValueCount.RequiresValues
getprotected set

Determines if the value count requires at least one value to be consumed.