C# Class Bari.Core.Model.Loader.YamlParser

Helper methods for parsing YAML files, with support of goal-based filtering
Datei anzeigen Open project: vigoo/bari Class Usage Examples

Public Methods

Method Description
EnumerateNamedNodesOf ( YamlNode parent, string groupName ) : YamlNode>>.IEnumerable

Finds a child node by its name and enumerates its contents

EnumerateNodesOf ( YamlMappingNode mapping ) : YamlNode>>.IEnumerable

Enumerates the key-value pairs in a mapping node

EnumerateNodesOf ( YamlSequenceNode seq ) : IEnumerable

Enumerates the nodes in a sequence node while resolving the conditional expressions

GetOptionalScalarValue ( YamlNode parent, string key, string defaultValue ) : string

Gets an optional scalar value identified by its key

GetScalarValue ( YamlNode parent, string key, string errorMessage = null ) : string

Gets a scalar value identified by its key

SetActiveGoal ( Goal goal ) : void

Sets the active goal to be used for filtering the nodes

Method Details

EnumerateNamedNodesOf() public method

Finds a child node by its name and enumerates its contents
public EnumerateNamedNodesOf ( YamlNode parent, string groupName ) : YamlNode>>.IEnumerable
parent YamlDotNet.RepresentationModel.YamlNode Parent node
groupName string Name of the group to find
return YamlNode>>.IEnumerable

EnumerateNodesOf() public method

Enumerates the key-value pairs in a mapping node
public EnumerateNodesOf ( YamlMappingNode mapping ) : YamlNode>>.IEnumerable
mapping YamlMappingNode Mapping node to be enumerated
return YamlNode>>.IEnumerable

EnumerateNodesOf() public method

Enumerates the nodes in a sequence node while resolving the conditional expressions
public EnumerateNodesOf ( YamlSequenceNode seq ) : IEnumerable
seq YamlSequenceNode Sequence node to be enumerated
return IEnumerable

GetOptionalScalarValue() public method

Gets an optional scalar value identified by its key
public GetOptionalScalarValue ( YamlNode parent, string key, string defaultValue ) : string
parent YamlDotNet.RepresentationModel.YamlNode Parent node
key string Key of the value
defaultValue string Default value to be used if the key is not found in parent
return string

GetScalarValue() public method

Gets a scalar value identified by its key
public GetScalarValue ( YamlNode parent, string key, string errorMessage = null ) : string
parent YamlDotNet.RepresentationModel.YamlNode Parent node
key string Key of the value
errorMessage string Error message if the key does not exists
return string

SetActiveGoal() public method

Sets the active goal to be used for filtering the nodes
public SetActiveGoal ( Goal goal ) : void
goal Goal New active goal
return void