From 142117991fae65646bc5dd59d96c4a5c5e8559ca Mon Sep 17 00:00:00 2001
From: houxiao <houxiao@454eff88-639b-444f-9e54-f578c98de674>
Date: 星期四, 10 八月 2017 14:54:25 +0800
Subject: [PATCH] bug fix
---
VisitFace/RtspNativeCodec/app/src/main/cpp/AppConfig.cpp | 12 ++++++++----
1 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/VisitFace/RtspNativeCodec/app/src/main/cpp/AppConfig.cpp b/VisitFace/RtspNativeCodec/app/src/main/cpp/AppConfig.cpp
index 9724375..8530024 100644
--- a/VisitFace/RtspNativeCodec/app/src/main/cpp/AppConfig.cpp
+++ b/VisitFace/RtspNativeCodec/app/src/main/cpp/AppConfig.cpp
@@ -35,22 +35,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();
}
--
Gitblit v1.8.0