This commit is contained in:
aozhiwei 2019-03-26 15:25:23 +08:00
parent 923b076d57
commit 64b7d5ad26
2 changed files with 8 additions and 0 deletions

View File

@ -298,6 +298,13 @@ namespace a8
return ReadFromJsonString(sl.Text());
}
bool XObject::ReadFromJsonFile(const std::string& filename)
{
a8::StringList sl;
sl.LoadFromFile(filename.c_str());
return ReadFromJsonString(sl.Text());
}
bool XObject::ReadFromJsonString(const std::string& json_data)
{
Json::Reader reader;

View File

@ -44,6 +44,7 @@ namespace a8
a8::XObject& Move(a8::XObject& a);
bool ReadFromFile(const std::string& filename);
bool ReadFromJsonFile(const std::string& filename);
bool ReadFromJsonString(const std::string& jsondata);
bool ReadFromXmlFile(const std::string& filename);
bool ReadFromXmlString(const std::string& xmldata);