aboutsummaryrefslogtreecommitdiffstats
path: root/src/hs-config.cpp
diff options
context:
space:
mode:
authorwang_zhiqiang <wang_zhiqiang@dl.cn.nexty-ele.com>2019-04-22 17:38:59 +0800
committerwang_zhiqiang <wang_zhiqiang@dl.cn.nexty-ele.com>2019-04-23 19:23:14 +0800
commit95c8f8ac2526acc5f7467704532ea235532b1876 (patch)
treefe26cc3b6953f998935b878b7f9e224412ece96b /src/hs-config.cpp
parentc393aaa4ae541f1f925981a6f8ae20d46626e8b6 (diff)
add lastmode function
Change-Id: I4b7ca96d1333d170c211b420d79ea9a4d3e1272a
Diffstat (limited to 'src/hs-config.cpp')
-rw-r--r--src/hs-config.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/hs-config.cpp b/src/hs-config.cpp
index b8f9f5b..c0d6942 100644
--- a/src/hs-config.cpp
+++ b/src/hs-config.cpp
@@ -22,6 +22,10 @@ const std::array<std::string, 3> HS_Config::keys_recover_type = { // based on
"default-lastmode",
"normal-apps"
};
+const std::string HS_Config::lastmode_json = "lastmode.json";
+const std::string HS_Config::key_appid = "appid";
+const std::string HS_Config::key_visibility = "visibility";
+std::string HS_Config::root_dir = "";
/**
* read configuration file to memory
@@ -35,14 +39,14 @@ const std::array<std::string, 3> HS_Config::keys_recover_type = { // based on
*/
int HS_Config::readConfig(void)
{
- auto rootdir = std::string(getenv("AFM_APP_INSTALL_DIR"));
- auto path = rootdir + "/etc/" + hs_conf_json;
+ root_dir = std::string(getenv("AFM_APP_INSTALL_DIR"));
+ auto path = root_dir + "/etc/" + hs_conf_json;
if(readJsonFile(path.c_str(), &m_hs_conf) < 0) {
AFB_ERROR("read %s failed.", hs_conf_json.c_str());
return -1;
}
- path = rootdir + "/etc/" + lastmode_json;
+ path = root_dir + "/etc/" + lastmode_json;
if(readJsonFile(path.c_str(), &m_lastmode) < 0) {
AFB_ERROR("read %s failed.", lastmode_json.c_str());
m_lastmode = nullptr;