C# Класс 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.
Наследование: IDisposable
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
_files Stack
_lines Stack
_log ILog
_process Stack
_streams Stack
_variables object>.Dictionary

Открытые методы

Метод Описание
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.

Защищенные методы

Метод Описание
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.

Описание методов

Dispose() публичный Метод

Disposes of each open file.
public Dispose ( ) : void
Результат void

HandleDirective() защищенный Метод

Handles a pre-processor directive (i.e. a line starting with %).
protected HandleDirective ( string line ) : void
line string
Результат void

IncludeFile() защищенный Метод

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
Результат void

Preprocessor() публичный Метод

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.
Результат System

ReadLine() публичный Метод

Reads the next line of input from the YAML source.
public ReadLine ( ) : string
Результат string

SubstituteVariables() защищенный Метод

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
Результат string

Описание свойств

_files защищенное свойство

protected Stack _files
Результат Stack

_lines защищенное свойство

protected Stack _lines
Результат Stack

_log защищенное статическое свойство

protected static ILog _log
Результат ILog

_process защищенное свойство

protected Stack _process
Результат Stack

_streams защищенное свойство

protected Stack _streams
Результат Stack

_variables защищенное свойство

protected Dictionary _variables
Результат object>.Dictionary