C# Class Expl.Itinerary.Parser.TDLParser

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

Méthodes publiques

Méthode 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

Méthode Description
GetParser ( string Text ) : TimeDefParser

Instantiate ANTLR-based TDL parser and parse TDL.

Method Details

IsValid() public static méthode

Validate TDL string for syntax.
public static IsValid ( string Text ) : bool
Text string TDL string.
Résultat bool

IsValidDateTime() public static méthode

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

IsValidTimeSpan() public static méthode

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

Parse() public static méthode

Parse TDL string to ISchedule object.
public static Parse ( string Text ) : ISchedule
Text string TDL string.
Résultat ISchedule

ParseDateTime() public static méthode

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.
Résultat System.DateTime

ParseTimeSpan() public static méthode

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