49 lines
797 B
C++
49 lines
797 B
C++
#ifndef CONIFG_HEADER
|
|
#define CONIFG_HEADER
|
|
|
|
#include <SimpleIni.h>
|
|
|
|
#include <string>
|
|
#include <vector>
|
|
/*
|
|
|
|
[Basic]
|
|
oper_node=IODEF/ITEMS
|
|
|
|
*/
|
|
|
|
using StrVec_t = std::vector<std::string>;
|
|
struct OneGroupIni {
|
|
std::string name;
|
|
std::string main_nodes;
|
|
std::string relative_nodes;
|
|
std::string item_key;
|
|
std::string propertis;
|
|
long max_col_len{1000};
|
|
long max_blank_add{60};
|
|
bool is_same;
|
|
};
|
|
|
|
class CGroupIni
|
|
{
|
|
public:
|
|
CGroupIni();
|
|
|
|
public:
|
|
bool load_ini();
|
|
void get_all_node(StrVec_t& vec);
|
|
bool add_item(const OneGroupIni& group);
|
|
bool get_item(OneGroupIni& group);
|
|
bool del_item(const std::string& key);
|
|
|
|
private:
|
|
void default_set();
|
|
|
|
private:
|
|
std::string work_dir_{};
|
|
std::string work_file_{};
|
|
CSimpleIniA ini_{};
|
|
};
|
|
|
|
#endif
|