C# Class YAML.Preprocessor

Implements a class that pre-processes a YAML file and handles pre-processor directives to include other files, set variables, and handle variable substitution. The pre-processor also strips comments from the contents fed back to the parser.
Inheritance: IDisposable
Afficher le fichier Open project: agardiner/hfmcmd Class Usage Examples

Protected Properties

Свойство Type Description
_files Stack
_lines Stack
_log ILog
_process Stack
_streams Stack
_variables object>.Dictionary

Méthodes publiques

Méthode Description
Dispose ( ) : void

Disposes of each open file.

Preprocessor ( string file, object>.Dictionary variables ) : System

Constructs a YAML Preprocessor instance.

ReadLine ( ) : string

Reads the next line of input from the YAML source.

Méthodes protégées

Méthode Description
HandleDirective ( string line ) : void

Handles a pre-processor directive (i.e. a line starting with %).

IncludeFile ( string file ) : void

Includes the specified file, pushing the new file onto the stack, so that lines come from the new file until it is completed.

SubstituteVariables ( string line, object>.Dictionary variables ) : string

Substitutes a value for any variables used in the supplied string. The variable values to be substituted are in the supplied dictionary.

Method Details

Dispose() public méthode

Disposes of each open file.
public Dispose ( ) : void
Résultat void

HandleDirective() protected méthode

Handles a pre-processor directive (i.e. a line starting with %).
protected HandleDirective ( string line ) : void
line string
Résultat void

IncludeFile() protected méthode

Includes the specified file, pushing the new file onto the stack, so that lines come from the new file until it is completed.
protected IncludeFile ( string file ) : void
file string
Résultat void

Preprocessor() public méthode

Constructs a YAML Preprocessor instance.
public Preprocessor ( string file, object>.Dictionary variables ) : System
file string The source file that will drive the YAML parsing /// process. Note that this file may include other files, but all this /// is transparent to the YAMLParser.
variables object>.Dictionary A Variables collection of variable names /// and values. The Variables collection may be modified by the /// Preprocessor in response to preprocessor directives to set/unset /// variables etc.
Résultat System

ReadLine() public méthode

Reads the next line of input from the YAML source.
public ReadLine ( ) : string
Résultat string

SubstituteVariables() protected méthode

Substitutes a value for any variables used in the supplied string. The variable values to be substituted are in the supplied dictionary.
protected SubstituteVariables ( string line, object>.Dictionary variables ) : string
line string
variables object>.Dictionary
Résultat string

Property Details

_files protected_oe property

protected Stack _files
Résultat Stack

_lines protected_oe property

protected Stack _lines
Résultat Stack

_log protected_oe static_oe property

protected static ILog _log
Résultat ILog

_process protected_oe property

protected Stack _process
Résultat Stack

_streams protected_oe property

protected Stack _streams
Résultat Stack

_variables protected_oe property

protected Dictionary _variables
Résultat object>.Dictionary