Struct YAMLParseOptions
Defined in File yaml_helpers.h
Struct Documentation
-
struct YAMLParseOptions
Options controlling which pre-processing steps
parse_yaml()runs.Pre-processing is performed in the following fixed order:
**
$include{path}** - replaced with the contents of the referenced YAML file (recursive; relative paths resolved againstincludesBasePath).**
$(cmd)** - replaced with the trimmed stdout of the shell commandcmd(exit code ≠ 0 throws).**
${VAR}** or **${VAR|default}** - replaced with the value of an environment variable, a customvariablesentry, or the built-inCURRENT_YAML_FILE_PATHtoken (falls back todefaultwhen given, otherwise throws if the variable is not defined).
Any of these steps can be individually disabled via the boolean flags below.
Public Members
-
bool doIncludes = {true}
If
true(default), process$include{path}directives.
-
bool doCmdRuns = {true}
If
true(default), process$(command)shell-run substitutions.
-
bool doEnvVars = {true}
If
true(default), process${VAR}/${VAR|default}variable substitutions from the environment,variables, and built-in tokens.
-
std::map<std::string, std::string> variables
User-defined variable bindings for
${name}substitutions.Entries in this map are checked after the real environment variables and the built-in
CURRENT_YAML_FILE_PATHtoken, but before the|defaultfallback syntax.
-
std::string includesBasePath
Base directory used to resolve relative
$include{}paths.When non-empty, any relative path inside a
$include{}expression is resolved relative to this directory.load_yaml_file()sets this automatically to the directory of the file being loaded.