diff --git a/include/core/yaml/parser_yaml.hpp b/include/core/yaml/parser_yaml.hpp index ffda58f9160a537f047c5432edced449b7a305da..643d5d1fdbdc25246001d3c041aa3f49c06b8d2c 100644 --- a/include/core/yaml/parser_yaml.hpp +++ b/include/core/yaml/parser_yaml.hpp @@ -248,7 +248,8 @@ public: std::vector<std::array<std::string, 3>> getCallbacks(); std::vector<std::array<std::string, 2>> getProblem(); std::map<std::string,std::string> getParams(); - void parse(bool); + void parse(); + void parse_freely(); }; std::string ParserYAML::generatePath(std::string path){ std::regex r("^/.*"); @@ -439,27 +440,28 @@ std::map<std::string,std::string> ParserYAML::getParams(){ std::map<std::string,std::string> rtn = _params; return rtn; } -void ParserYAML::parse(bool freely_parse = false){ +void ParserYAML::parse(){ this->_parsing_file.push(generatePath(this->_file)); - if(not freely_parse){ - this->parseFirstLevel(this->_file); + this->parseFirstLevel(this->_file); if(this->problem.Type() != YAML::NodeType::Undefined){ - std::vector<std::string> tags = std::vector<std::string>(); - this->walkTreeR(this->problem, tags , "problem"); + std::vector<std::string> tags = std::vector<std::string>(); + this->walkTreeR(this->problem, tags , "problem"); } for(auto it : _paramsSens){ - std::vector<std::string> tags = std::vector<std::string>(); - this->walkTreeR(it.n , tags , it._name); + std::vector<std::string> tags = std::vector<std::string>(); + this->walkTreeR(it.n , tags , it._name); } for(auto it : _paramsProc){ - std::vector<std::string> tags = std::vector<std::string>(); - this->walkTreeR(it.n , tags , it._name); - } - }else{ std::vector<std::string> tags = std::vector<std::string>(); - this->walkTreeR(loadYAML(this->_file), tags, ""); + this->walkTreeR(it.n , tags , it._name); } this->_parsing_file.pop(); } +void ParserYAML::parse_freely(){ + this->_parsing_file.push(generatePath(this->_file)); + std::vector<std::string> tags = std::vector<std::string>(); + this->walkTreeR(loadYAML(this->_file), tags, ""); + this->_parsing_file.pop(); +} #endif