rel:第一个初步可用版本。
This commit is contained in:
@@ -8,6 +8,7 @@ bool CXmlOpr::open(const std::string &xml_path)
|
||||
if (doc_.LoadFile(xml_path.c_str()) != tinyxml2::XML_SUCCESS) {
|
||||
return false;
|
||||
}
|
||||
xml_path_ = xml_path;
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -45,3 +46,12 @@ bool CXmlOpr::parse_xml(std::vector<tinyxml2::XMLElement*>& vec)
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CXmlOpr::save()
|
||||
{
|
||||
auto ret = doc_.SaveFile(xml_path_.c_str());
|
||||
if (ret != tinyxml2::XML_SUCCESS) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -16,10 +16,12 @@ public:
|
||||
bool open(const std::string& xml_path);
|
||||
void set_baseinfo(const OprBase& base);
|
||||
bool parse_xml(std::vector<tinyxml2::XMLElement*>& vec);
|
||||
bool save();
|
||||
|
||||
private:
|
||||
tinyxml2::XMLDocument doc_{};
|
||||
OprBase opr_base_{};
|
||||
std::string xml_path_{};
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user