2024-05-15 10:59:43 +08:00
|
|
|
#ifndef XML_OPERT_HEADER
|
|
|
|
#define XML_OPERT_HEADER
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
#include <tinyxml2.h>
|
|
|
|
#include <vector>
|
|
|
|
#include "../public_def.h"
|
|
|
|
|
|
|
|
class CXmlOpr
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CXmlOpr();
|
|
|
|
~CXmlOpr();
|
|
|
|
|
|
|
|
public:
|
|
|
|
bool open(const std::string& xml_path);
|
|
|
|
void set_baseinfo(const OprBase& base);
|
|
|
|
bool parse_xml(std::vector<tinyxml2::XMLElement*>& vec);
|
2024-05-15 13:17:24 +08:00
|
|
|
bool save();
|
2024-05-15 10:59:43 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
tinyxml2::XMLDocument doc_{};
|
|
|
|
OprBase opr_base_{};
|
2024-05-15 13:17:24 +08:00
|
|
|
std::string xml_path_{};
|
2024-05-15 10:59:43 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|