#ifndef WRAPPER_LOAD_SAVE_H
#define WRAPPER_LOAD_SAVE_H
#include "../../my_type.h"
#include "../../project_lib.h"
#include "load.h"
#include "save.h"
#include "my_process.h"
#include "util.h"
#define global_load "ubconfig --default --source global get boot"
#define system_load "ubconfig --default --source system get boot"
#define global_save "ubconfig --target global --noexecute set boot "
#define system_save "ubconfig --target system set boot "
#define all_save "ubconfig set boot "
#define all_remove "ubconfig set/remove boot "
#define global_remove "ubconfig --target global --noexecute set/remove boot "
#define system_remove "ubconfig --target system --noexecute set/remove boot "



class Wrapper_load_save {
private:
    string str_cmd_error;
private:
    map_str_str* map_gui_cfg = NULL;
    map_str_str* map_global_cfg = NULL;
    map_str_str* map_system_cfg = NULL;
    vector<string> vec_param_names;
    My_Process::My_Process_system obj_process_system = My_Process::My_Process_system();
    My_Process::My_Process_call obj_process_call = My_Process::My_Process_call();
    Lib_save::Save obj_save = Lib_save::Save();
    Lib_Load::Load obj_load = Lib_Load::Load();
public:
    Wrapper_load_save(/* args */);
    ~Wrapper_load_save();
    int load_global_cfg();
    int load_system_cfg();
    int wrapper_save_system_cfg();
    int wrapper_save_global_cfg();
    int wrapper_save_all_cfg();
    int get_error_load();
    int get_error_save();
    void set_map_gui(map_str_str* map_gui_cfg);
    void set_map_global(map_str_str* map_global_cfg);
    void set_map_local(map_str_str* map_system_cfg);
    void set_vec_key(vector<string> vec_param_names);
private:
    void load_template(map_str_str* map_temp, string cmd);
    void init_dict(string flag_load);
    void set_data_cfg();
    bool save_template(string section, string flag_save);
    
};


#endif