pans
2017-08-18 7572cd33f27b512691b6acf39cd0d78d35017a46
VisitFace/RtspNativeCodec/app/src/main/cpp/AppConfig.cpp
@@ -8,6 +8,11 @@
{
}
AppConfig::AppConfig(string path)
{
   loadConfig(path);
}
AppConfig::~AppConfig()
{
}
@@ -35,22 +40,26 @@
void AppConfig::loadConfig(string path)
{
   fstream fs(path);
   if (!fs.is_open()) {
   if (!fs.is_open())
   {
      save(path);
      return;
   }
   Json::CharReaderBuilder builder;
   auto reader = builder.newCharReader();
   JSONCPP_STRING doc;
   std::getline(fs, doc, (char)EOF);
   JSONCPP_STRING doc;
   std::getline(fs, doc, (char) EOF);
   reader->parse(doc.data(), doc.data() + doc.size(), &root, false);
}
void AppConfig::save(string path)
{
   ofstream ofs(path);
   ofs << root.toStyledString();
   ofs.close();
}
void AppConfig::clear(){
void AppConfig::clear()
{
   root.clear();
}