/base/powermgr/power_manager/utils/param/src/ |
H A D | sysparam.cpp | 39 int32_t SysParam::GetIntValue(const std::string& key, int32_t def) in GetIntValue() argument 42 int32_t ret = GetParameter(key.c_str(), std::to_string(def).c_str(), value, VALUE_MAX_LEN); in GetIntValue() 44 POWER_HILOGW(COMP_UTILS, "GetParameter failed, return default value, ret=%{public}d, def=%{public}d", ret, def); in GetIntValue() 45 return def; in GetIntValue() 47 int32_t intValue = def; in GetIntValue() 49 POWER_HILOGW(COMP_UTILS, "StrToInt failed, return default def, value=%{public}s, def=%{public}d", value, def); in GetIntValue() 50 return def; in GetIntValue() [all...] |
/base/startup/appspawn/test/mock/ |
H A D | app_spawn_stub.cpp | 54 bool GetIntParameter(const std::string &key, bool def, bool arg1 = false, bool arg2 = false)
in GetIntParameter() argument 56 return def;
in GetIntParameter() 59 bool GetBoolParameter(const std::string &key, bool def)
in GetBoolParameter() argument 61 return def;
in GetBoolParameter() 121 int GetParameter(const char *key, const char *def, char *value, uint32_t len)
in GetParameter() argument 129 const char *tmp = def;
in GetParameter() 143 return strcpy_s(value, len, def) == 0 ? strlen(def) : -1;
in GetParameter()
|
/base/startup/init/interfaces/innerkits/syspara/ |
H A D | param_wrapper.cpp | 68 std::string GetParameter(const std::string& key, const std::string& def) in GetParameter() argument 79 if (IsValidParamValue(def.c_str(), MAX_VALUE_LEN) == 1) { in GetParameter() 80 return std::string(def); in GetParameter() 85 bool GetBoolParameter(const std::string& key, bool def) in GetBoolParameter() argument 100 return def; in GetBoolParameter() 103 int GetStringParameter(const std::string &key, std::string &value, const std::string def) in GetStringParameter() argument 115 if (IsValidParamValue(def.c_str(), MAX_VALUE_LEN) == 1) { in GetStringParameter() 116 value = std::string(def); in GetStringParameter() 123 T GetIntParameter(const std::string& key, T def, T min, T max) in GetIntParameter() argument 126 return def; in GetIntParameter() 142 GetUintParameter(const std::string& key, T def, T max) GetUintParameter() argument 180 GetIntParameter(const std::string &key, int def) GetIntParameter() argument [all...] |
H A D | parameter.c | 83 int GetParameter(const char *key, const char *def, char *value, uint32_t len) in GetParameter() argument 88 int ret = GetParameter_(key, def, value, len); in GetParameter() 333 int32_t GetIntParameter(const char *key, int32_t def) in GetIntParameter() argument 339 return def; in GetIntParameter() 344 return def; in GetIntParameter() 347 return def; in GetIntParameter() 352 uint32_t GetUintParameter(const char *key, uint32_t def) in GetUintParameter() argument 358 return def; in GetUintParameter() 363 return def; in GetUintParameter() 366 return def; in GetUintParameter() [all...] |
H A D | param_comm.c | 69 INIT_LOCAL_API int GetParameter_(const char *key, const char *def, char *value, uint32_t len)
in GetParameter_() argument 77 if (def == NULL) {
in GetParameter_() 80 if (strlen(def) > len) {
in GetParameter_() 83 ret = strcpy_s(value, len, def);
in GetParameter_()
|
H A D | param_comm.h | 37 INIT_LOCAL_API int GetParameter_(const char *key, const char *def, char *value, uint32_t len);
|
/base/startup/appspawn/util/include/ |
H A D | json_utils.h | 44 __attribute__((always_inline)) inline bool GetBoolValueFromJsonObj(const cJSON *json, const char *key, bool def) in GetBoolValueFromJsonObj() argument 47 APPSPAWN_CHECK_ONLY_EXPER(value != NULL, return def); in GetBoolValueFromJsonObj() 55 __attribute__((always_inline)) inline uint32_t GetIntValueFromJsonObj(const cJSON *json, const char *key, uint32_t def) in GetIntValueFromJsonObj() argument 57 APPSPAWN_CHECK(json != NULL, return def, "Invalid json"); in GetIntValueFromJsonObj() 58 APPSPAWN_CHECK(cJSON_IsObject(json), return def, "json is not object."); in GetIntValueFromJsonObj()
|
/base/startup/init/interfaces/innerkits/include/syspara/ |
H A D | parameters.h | 26 * If the parameter is empty or doesn't exist, `def` will be returned. 28 std::string GetParameter(const std::string& key, const std::string& def); 32 * false for "0", "n", "no", "off", or "false", or `def` otherwise. 34 bool GetBoolParameter(const std::string& key, bool def); 39 * the optional bounds, returns `def`. 42 T GetIntParameter(const std::string& key, T def, T min = std::numeric_limits<T>::min(), 48 * the optional bound, returns `def`. 51 T GetUintParameter(const std::string& key, T def, T max = std::numeric_limits<T>::max());
|
H A D | param_wrapper.h | 23 int GetStringParameter(const std::string &key, std::string &value, const std::string def = "");
24 int GetIntParameter(const std::string &key, int def);
|
H A D | parameter.h | 37 * If no system parameter is found, the <b>def</b> parameter will be returned.\n 42 * @param def Indicates the default value to return when no query result is found. 52 int GetParameter(const char *key, const char *def, char *value, uint32_t len); 184 int32_t GetIntParameter(const char *key, int32_t def); 185 uint32_t GetUintParameter(const char *key, uint32_t def);
|
/base/startup/init/test/fuzztest/getparametercpp_fuzzer/ |
H A D | getparametercpp_fuzzer.cpp | 24 const std::string def = ""; in FuzzGetParameter() local 26 if (system::GetParameter(key, def) != def) { in FuzzGetParameter()
|
/base/security/asset/services/db_operator/src/test/ |
H A D | test_database.rs | 62 let mut def = DbMap::from(DB_DATA); in open_db_and_insert_data() variables 63 add_bytes_column(&mut def); in open_db_and_insert_data() 68 let count = db.insert_datas(&def).unwrap(); in open_db_and_insert_data() 138 let mut def = DbMap::from(DB_DATA); in insert_data_with_different_alias() variables 139 add_bytes_column(&mut def); in insert_data_with_different_alias() 145 let count = db.insert_datas(&def).unwrap(); in insert_data_with_different_alias() 148 def.insert(column::ALIAS, Value::Bytes(b"Alias2".to_vec())); in insert_data_with_different_alias() 149 let count = db.insert_datas(&def).unwrap(); in insert_data_with_different_alias() 212 let mut def = DbMap::from(DB_DATA); in query_ordered_data() variables 213 add_bytes_column(&mut def); in query_ordered_data() 276 let mut def = DbMap::from(DB_DATA); backup_and_restore() variables 288 let mut def = DbMap::from(DB_DATA); insert_duplicated_data() variables [all...] |
/base/startup/init/interfaces/kits/cj/src_enhance/ |
H A D | system_parameter_ffi.cpp | 64 RetDataCString FfiOHOSSysTemParameterGet(const char* key, const char* def) in FfiOHOSSysTemParameterGet() argument 68 int status = GetParameter(key, (strlen(def) == 0) ? nullptr : def, value.data(), MAX_VALUE_LENGTH); in FfiOHOSSysTemParameterGet()
|
H A D | system_parameter_ffi.h | 24 FFI_EXPORT RetDataCString FfiOHOSSysTemParameterGet(const char* key, const char* def);
|
/base/update/updateservice/services/core/ability/adapter/src/ |
H A D | device_adapter.cpp | 43 std::string DeviceAdapter::GetParameter(const std::string &key, const std::string &def) in GetParameter() argument 54 if (IsValidParamValue(def.c_str(), MAX_PARAM_VALUE_LEN)) { in GetParameter() 55 return std::string(def); in GetParameter()
|
/base/startup/init/simulator/parameter/src/ |
H A D | parameter_common.c | 59 int GetParameter(const char *key, const char *def, char *value, unsigned int len)
in GetParameter() argument 71 if ((ret < 0) && IsValidValue(def, len)) {
in GetParameter() 72 if (strncpy_s(value, len, def, len - 1) != 0) {
in GetParameter() 75 ret = (int)strlen(def);
in GetParameter()
|
/base/powermgr/power_manager/utils/param/include/ |
H A D | sysparam.h | 30 static int32_t GetIntValue(const std::string& key, int32_t def);
|
/base/update/updateservice/services/core/ability/adapter/include/ |
H A D | device_adapter.h | 26 static std::string GetParameter(const std::string &key, const std::string &def);
|
/base/security/access_token/services/accesstokenmanager/main/cpp/src/permission/ |
H A D | permission_definition_cache.cpp | 195 PermissionDef def; in RestorePermDefInfo() local 197 int32_t ret = DataTranslator::TranslationIntoPermissionDef(defValue, def); in RestorePermDefInfo() 202 Insert(def, tokenId); in RestorePermDefInfo()
|
H A D | permission_policy_set.cpp | 590 void PermissionPolicySet::PermDefToString(const PermissionDef& def, std::string& info) const in PermDefToString() argument 594 info.append(R"( "permissionName": ")" + def.permissionName + R"(")" + ",\n"); in PermDefToString() 595 info.append(R"( "bundleName": ")" + def.bundleName + R"(")" + ",\n"); in PermDefToString() 596 info.append(R"( "grantMode": )" + std::to_string(def.grantMode) + ",\n"); in PermDefToString() 597 info.append(R"( "availableLevel": )" + std::to_string(def.availableLevel) + ",\n"); in PermDefToString() 598 info.append(R"( "provisionEnable": )" + std::to_string(def.provisionEnable) + ",\n"); in PermDefToString() 599 info.append(R"( "distributedSceneEnable": )" + std::to_string(def.distributedSceneEnable) + ",\n"); in PermDefToString() 600 info.append(R"( "label": ")" + def.label + R"(")" + ",\n"); in PermDefToString() 601 info.append(R"( "labelId": )" + std::to_string(def.labelId) + ",\n"); in PermDefToString() 602 info.append(R"( "description": ")" + def in PermDefToString() [all...] |
/base/startup/appspawn/util/src/ |
H A D | appspawn_utils.c | 411 uint32_t GetSpawnTimeout(uint32_t def) in GetSpawnTimeout() argument 413 uint32_t value = def; in GetSpawnTimeout() 419 return (errno != 0) ? def : ((value < def) ? def : value); in GetSpawnTimeout()
|
/base/customization/config_policy/frameworks/config_policy/src/ |
H A D | config_policy_utils.c | 80 static char *ExpandStr(char *src, const char *def, QueryFunc queryFunc); 332 static char *ExpandStr(char *src, const char *def, QueryFunc queryFunc) in ExpandStr() argument 357 if (value || defVal || def) { in ExpandStr() 358 ok = ok && AppendStr(&sh, value ? value : (defVal ? defVal : def)); in ExpandStr()
|
/base/startup/init/test/moduletest/ |
H A D | syspara_moduleTest.cpp | 90 static void GetParameterTestReInt(const char *key, const char *def, char *value, uint32_t len) in GetParameterTestReInt() argument 92 int ret = GetParameter(key, def, value, len); in GetParameterTestReInt() 97 static void GetParameterTestFuncReStr(string key, string def) in GetParameterTestFuncReStr() argument 99 string ret = system::GetParameter(key, def); in GetParameterTestFuncReStr() 262 // set value type not bool,the result get form def in HWTEST_F()
|
/base/startup/appspawn/modules/sandbox/ |
H A D | sandbox_load.c | 122 APPSPAWN_STATIC unsigned long GetMountModeFromConfig(const cJSON *config, const char *key, unsigned long def) in GetMountModeFromConfig() argument 126 return def; in GetMountModeFromConfig() 132 return def; in GetMountModeFromConfig() 135 static uint32_t GetNameGroupTypeFromConfig(const cJSON *config, const char *key, unsigned long def) in GetNameGroupTypeFromConfig() argument 139 return def; in GetNameGroupTypeFromConfig() 145 return def; in GetNameGroupTypeFromConfig()
|
/base/startup/appspawn/interfaces/innerkits/client/ |
H A D | appspawn_client.c | 41 static uint32_t GetDefaultTimeout(uint32_t def) in GetDefaultTimeout() argument 43 uint32_t value = def; in GetDefaultTimeout() 49 return (errno != 0) ? def : value; in GetDefaultTimeout()
|