C# Class Expl.Auxiliary.IntSpec

Shorthand input string to represent lists and ranges of integers.
Acceptable IntSpec operator syntax in order of precedence: n/i !n n-m n,m,o Index values much be greater than zero. Throw exception on invalid format or number range. TODO: Consider converting IntSpec parser to ANTLR parser?
Mostra file Open project: spoulson/Itinerary

Public Methods

Method Description
IsValidIntSpec ( string SpecString ) : bool

Check if string is valid IntSpec syntax.

Parse ( string SpecString ) : IEnumerable

Parse IntSpec and generate enumeration of integers.

Parse ( string SpecString, int MinValue, int MaxValue ) : IEnumerable

Parse IntSpec string and clip ranges by min/max values.

Private Methods

Method Description
ParseTerm ( string SpecString, int MinValue, int MaxValue ) : IEnumerable

Parse single term of a comma-separated series.

Method Details

IsValidIntSpec() public static method

Check if string is valid IntSpec syntax.
public static IsValidIntSpec ( string SpecString ) : bool
SpecString string IntSpec string.
return bool

Parse() public static method

Parse IntSpec and generate enumeration of integers.
public static Parse ( string SpecString ) : IEnumerable
SpecString string IntSpec string.
return IEnumerable

Parse() public static method

Parse IntSpec string and clip ranges by min/max values.
public static Parse ( string SpecString, int MinValue, int MaxValue ) : IEnumerable
SpecString string IntSpec string.
MinValue int Minimum inclusive range.
MaxValue int Maximum inclusive range.
return IEnumerable