"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";
+const std::string HS_Config::key_after = "after";
+std::string HS_Config::root_dir = "";
/**
* read configuration file to memory
*/
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;
else {
info.visibility = false;
}
+ if(json_object_object_get_ex(info_obj, key_after.c_str(), &value_obj)) {
+ info.after = json_object_get_string(value_obj);
+ }
+ else {
+ info.after.clear();
+ }
v_app_info.push_back(info);
}