#include "load.h" namespace Lib_Load{ void Load::set_sections(vector vec_sections){ this->vec_sections = vec_sections; } map& Load::get_load_data(std::map &map_temp, string str_flag_load) { string cmd = ""; string response = ""; string key = ""; string value = ""; for (const string §ion: this->vec_sections) { cmd = "ubconfig --default --source " + str_flag_load + " get " + section; response = process.call_all_sections(cmd); vector vec_str_key_value = Utils::split(response, '\n'); for (const string ¶m: vec_str_key_value) { if ((param.find("(null)") == std::string::npos) && (param.length() != 0 )) { if (param.find("=") != std::string::npos) { size_t index = param.find("="); key = param.substr(0, index); value = param.substr(index + 1, param.length()); Utils::str_replace_all(value, " \"",""); Utils::str_replace_all(value, "\"",""); map_temp[key] = value; } } } } return map_temp; } }