lib_config
YAMLConfiguration.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #include "Configuration.hpp"
4 #include <yaml-cpp/yaml.h>
5 
6 namespace libConfig
7 {
9  bool parseAndInsert(const std::string& configName, const std::string& ymlString, const std::string &pathStr, std::map< std::string, Configuration >& subConfigs);
10 public:
11  void displayMap(const YAML::Node &map, int level = 0);
12 
13  void printNode(const YAML::Node &node, int level = 0);
14 
15  std::shared_ptr<ConfigValue> getConfigValue(const YAML::Node &node);
16  std::shared_ptr<ConfigValue> getConfigValue(const std::string &ymlString);
17  std::shared_ptr<ComplexConfigValue> getMap(const YAML::Node &map);
18 
19  bool insetMapIntoArray(const YAML::Node &map, ArrayConfigValue &array);
20  bool insetMapIntoArray(const YAML::Node &map, ComplexConfigValue &complex);
21  bool insetMapIntoArray(const YAML::Node &map, Configuration &conf);
22 
23  bool loadConfigFile(const std::string &path, std::map<std::string, Configuration> &subConfigs);
24 
25  bool parseYAML(Configuration &curConfig, const std::string &yamlBuffer);
26 
38  static std::string applyStringVariableInsertions(const std::string &val);
39 
40 
41 private:
42 
43 
44 };
45 }
Definition: Configuration.hpp:67
static std::string applyStringVariableInsertions(const std::string &val)
Definition: YAMLConfiguration.cpp:296
Definition: Configuration.hpp:54
bool loadConfigFile(const std::string &path, std::map< std::string, Configuration > &subConfigs)
Definition: YAMLConfiguration.cpp:203
Definition: Configuration.hpp:80
void displayMap(const YAML::Node &map, int level=0)
Definition: YAMLConfiguration.cpp:169
Definition: YAMLConfiguration.hpp:8
bool insetMapIntoArray(const YAML::Node &map, ArrayConfigValue &array)
Definition: YAMLConfiguration.cpp:59
std::shared_ptr< ConfigValue > getConfigValue(const YAML::Node &node)
Definition: YAMLConfiguration.cpp:102
std::shared_ptr< ComplexConfigValue > getMap(const YAML::Node &map)
Definition: YAMLConfiguration.cpp:158
bool parseYAML(Configuration &curConfig, const std::string &yamlBuffer)
Definition: YAMLConfiguration.cpp:272
void printNode(const YAML::Node &node, int level=0)
Definition: YAMLConfiguration.cpp:10