C# Class Expl.Itinerary.Parser.TDLParser

Helper class for calling parser to generate an ISchedule object from TDL string.
Mostrar archivo Open project: spoulson/Itinerary Class Usage Examples

Public Methods

Method Description
IsValid ( string Text ) : bool

Validate TDL string for syntax.

IsValidDateTime ( string Text ) : bool

Validate Date/time string for syntax. See ParseDateTime() for valid syntax.

IsValidTimeSpan ( string Text ) : bool

Validate timespan string for syntax. See ParseTimeSpan() for valid syntax.

Parse ( string Text ) : ISchedule

Parse TDL string to ISchedule object.

ParseDateTime ( string Text ) : System.DateTime

Parse Date/time string from format: YYYY-MM-DD [hh:mm[:ss[.ffff]]] or hh:mm[:ss[.ffff]]] (omitting date parts assumes current UTC date).

ParseTimeSpan ( string Text ) : System.TimeSpan

Parse timespan string from format: T[[[DD.]hh:]mm:]ss[.ffff]

Private Methods

Method Description
GetParser ( string Text ) : TimeDefParser

Instantiate ANTLR-based TDL parser and parse TDL.

Method Details

IsValid() public static method

Validate TDL string for syntax.
public static IsValid ( string Text ) : bool
Text string TDL string.
return bool

IsValidDateTime() public static method

Validate Date/time string for syntax. See ParseDateTime() for valid syntax.
public static IsValidDateTime ( string Text ) : bool
Text string Date/time string.
return bool

IsValidTimeSpan() public static method

Validate timespan string for syntax. See ParseTimeSpan() for valid syntax.
public static IsValidTimeSpan ( string Text ) : bool
Text string Timespan string.
return bool

Parse() public static method

Parse TDL string to ISchedule object.
public static Parse ( string Text ) : ISchedule
Text string TDL string.
return ISchedule

ParseDateTime() public static method

Parse Date/time string from format: YYYY-MM-DD [hh:mm[:ss[.ffff]]] or hh:mm[:ss[.ffff]]] (omitting date parts assumes current UTC date).
public static ParseDateTime ( string Text ) : System.DateTime
Text string Date/time string.
return System.DateTime

ParseTimeSpan() public static method

Parse timespan string from format: T[[[DD.]hh:]mm:]ss[.ffff]
public static ParseTimeSpan ( string Text ) : System.TimeSpan
Text string Timespan string.
return System.TimeSpan