Go to the documentation of this file.
12 #include "yaml-cpp/yaml.h"
50 config.
addError(
"While reading key '" + key +
"': Could not resolve: " + s_error.
str());
55 if (s_resolved.
empty())
92 for(YAML::const_iterator it = node.begin(); it != node.end(); ++it)
95 const YAML::Node& n = it->second;
99 case YAML::NodeType::Scalar:
105 case YAML::NodeType::Sequence:
115 const YAML::Node& n2 = n[i];
116 if (n2.Type() != YAML::NodeType::Map)
133 case YAML::NodeType::Map:
138 case YAML::NodeType::Undefined:
139 case YAML::NodeType::Null:
154 YAML::Node doc = YAML::Load(stream);
156 if (doc.Type() != YAML::NodeType::Map)
165 catch(YAML::Exception& e)
void setSource(const std::string &source)
setSource set the source file of the data in this object
const std::string & source() const
source get the source file of the data in this object
bool endArrayItem()
endArrayItem go back to the array level
bool strToBool(std::string s, bool &rhs)
strToBool Converts a string to a boolean of matches one of the following: y, n, yes,...
bool writeArray(const std::string &name)
writeArray starts writing an array. Or start extending it, if it already exists.
bool writeGroup(const std::string &name)
writeGroup starts writing a group. Or start extending it, if it already exists.
bool addArrayItem()
addArrayItem create a new item in the array
bool loadFromYAMLString(const std::string &string, ReaderWriter &config, const ResolveConfig &resolve_config=ResolveConfig::defaultConfig())
loadFromYAMLString loads a yaml string into a ReaderWriter class
bool loadFromYAMLFile(const std::string &filename, ReaderWriter &config, const ResolveConfig &resolve_config=ResolveConfig::defaultConfig())
loadFromYAMLFile loads a yaml file into a ReaderWriter class
bool endGroup()
endGroup go to the parrent of current group, wrapping end() for readbility
bool resolve(const std::string &str, const std::string &source, std::string &result, std::stringstream &error, const ResolveConfig &config)
bool loadFromYAMLStream(std::istream &stream, ReaderWriter &config, const ResolveConfig &resolve_config=ResolveConfig::defaultConfig())
loadFromYAMLStream loads a yaml stream into a ReaderWriter class
bool loadFromYAMLNode(const YAML::Node &node, ReaderWriter &config, const ResolveConfig &resolve_config)
bool endArray()
endArray go to parrent of current array, wrapping end() for readibility
void addError(const std::string &msg)
void setValue(const std::string &name, const T &value)
setValue set child value with key 'name' and value 'value'
bool yamlScalarToVariant(const std::string &key, const YAML::Node &n, ReaderWriter &config, const ResolveConfig &resolve_config)
const std::string & string() const
Class to config the resolve behaviour of a loader.
Path join(const Path &path) const
tue::config::ReaderWriter config