Free Electron
Public Member Functions | Private Member Functions | Private Attributes | List of all members
fe::ext::CatalogReaderYaml Class Reference

load catalog from yaml file More...

#include <CatalogReaderYaml.h>

Inherits fe::CatalogReaderBase.

Public Member Functions

virtual BWORD load (String a_filename, sp< Catalog > a_spCatalog)
 

Private Member Functions

BWORD loadWithVariables (String a_pathname, String a_filename, sp< Catalog > a_spCatalog, std::map< String, String > &a_variableMapIn, std::map< String, String > &a_variableMapOut)
 
void addEntry (sp< Catalog > a_spCatalog, String a_keyName, String a_propertyName, const YAML::Node a_keyNode)
 
void addState (sp< Catalog > a_spCatalog, const YAML::Node a_yamlNode)
 
void addImport (sp< Catalog > a_spCatalog, const YAML::Node a_yamlNode, String a_pathname, BWORD a_adoptVariables, std::map< String, String > &a_variableMapIn, std::map< String, String > &a_variableMapOut)
 
BWORD checkOnly (const YAML::Node a_yamlNode, std::map< String, String > &a_variableMap)
 

Private Attributes

String m_rootPath
 

Detailed Description

load catalog from yaml file

# Examples
# simple import (one liner)
- import: model/biplane.yaml
# simple import list
- import:
- model/biplane.yaml
- model/triplane.yaml
# conditional import of files, forcing variable values in imported files
- import:
files:
- model/high_wing.yaml
- model/low_wing.yaml
only:
variables:
- $ADD_MONOPLANES != 0
variables:
ENGINE_COUNT: 2
# import variable values (child values will replace local values)
- import:
adopt_variables: true
files:
- override.yaml
# conditional replacement of local variables
- variables:
only:
variables:
- $PLANE_INDEX == 2
PLANE_INDEX: 7
# catalog entries
- state:
planes.${PLANE_INDEX}.width: 10.0
planes.${PLANE_INDEX}.engine_count: ${ENGINE_COUNT}

The documentation for this class was generated from the following files: