Home
last modified time | relevance | path

Searched refs:defValue (Results 1 - 25 of 37) sorted by relevance

12

/foundation/systemabilitymgr/samgr/services/samgr/native/source/collect/
H A Ddevice_timed_collect_tool.cpp105 int64_t PreferencesUtil::ObtainLong(const std::string& key, int64_t defValue) in ObtainLong() argument
107 return Obtain(key, defValue); in ObtainLong()
110 string PreferencesUtil::ObtainString(const std::string& key, std::string defValue) in ObtainString() argument
112 return Obtain(key, defValue); in ObtainString()
116 T PreferencesUtil::Obtain(const std::string& key, const T& defValue) in Obtain() argument
120 return defValue; in Obtain()
122 return ObtainInner(ptr_, key, defValue); in Obtain()
126 std::shared_ptr<NativePreferences::Preferences> ptr, const std::string& key, const int64_t& defValue) in ObtainInner()
128 return ptr->GetLong(key, defValue); in ObtainInner()
132 std::shared_ptr<NativePreferences::Preferences> ptr, const std::string& key, const std::string& defValue) in ObtainInner()
125 ObtainInner( std::shared_ptr<NativePreferences::Preferences> ptr, const std::string& key, const int64_t& defValue) ObtainInner() argument
131 ObtainInner( std::shared_ptr<NativePreferences::Preferences> ptr, const std::string& key, const std::string& defValue) ObtainInner() argument
[all...]
/foundation/communication/netmanager_ext/services/netfirewallmanager/src/
H A Dnetfirewall_preference_helper.cpp99 int32_t NetFirewallPreferenceHelper::ObtainInt(const std::string &key, int32_t defValue) in ObtainInt() argument
101 return Obtain(key, defValue); in ObtainInt()
104 bool NetFirewallPreferenceHelper::ObtainBool(const std::string &key, bool defValue) in ObtainBool() argument
106 return Obtain(key, defValue); in ObtainBool()
109 template <typename T> T NetFirewallPreferenceHelper::Obtain(const std::string &key, const T &defValue) in Obtain() argument
113 return defValue; in Obtain()
115 return ObtainInner(ptr_, key, defValue); in Obtain()
119 const std::string &key, const int32_t &defValue) in ObtainInner()
121 return ptr->GetInt(key, defValue); in ObtainInner()
125 const std::string &key, const bool &defValue) in ObtainInner()
118 ObtainInner(std::shared_ptr<NativePreferences::Preferences> ptr, const std::string &key, const int32_t &defValue) ObtainInner() argument
124 ObtainInner(std::shared_ptr<NativePreferences::Preferences> ptr, const std::string &key, const bool &defValue) ObtainInner() argument
[all...]
/foundation/distributeddatamgr/preferences/frameworks/native/src/
H A Dpreferences_base.cpp43 PreferencesValue PreferencesBase::Get(const std::string &key, const PreferencesValue &defValue) in Get() argument
45 return defValue; in Get()
53 int PreferencesBase::GetInt(const std::string &key, const int &defValue = {}) in GetInt()
55 PreferencesValue preferencesValue = Get(key, defValue);
57 return defValue;
62 std::string PreferencesBase::GetString(const std::string &key, const std::string &defValue = {}) in GetString()
64 PreferencesValue preferencesValue = Get(key, defValue);
66 return defValue;
70 bool PreferencesBase::GetBool(const std::string &key, const bool &defValue = {}) in GetBool()
72 PreferencesValue preferencesValue = Get(key, defValue);
222 GetValue(const std::string &key, const PreferencesValue &defValue) GetValue() argument
[all...]
H A Dpreferences_enhance_impl.cpp60 PreferencesValue PreferencesEnhanceImpl::Get(const std::string &key, const PreferencesValue &defValue) in Get() argument
63 return defValue; in Get()
69 return defValue; in Get()
75 return defValue; in Get()
89 return defValue; in Get()
94 return defValue; in Get()
366 const PreferencesValue &defValue) in GetValue()
370 return std::make_pair(errCode, defValue); in GetValue()
376 return std::make_pair(E_ALREADY_CLOSED, defValue); in GetValue()
382 return std::make_pair(E_ERROR, defValue); in GetValue()
365 GetValue(const std::string &key, const PreferencesValue &defValue) GetValue() argument
[all...]
H A Dpreferences_impl.cpp188 PreferencesValue PreferencesImpl::Get(const std::string &key, const PreferencesValue &defValue) in Get() argument
191 return defValue; in Get()
200 return defValue; in Get()
522 std::pair<int, PreferencesValue> PreferencesImpl::GetValue(const std::string &key, const PreferencesValue &defValue) in GetValue() argument
526 return std::make_pair(errCode, defValue); in GetValue()
534 return std::make_pair(E_NO_DATA, defValue); in GetValue()
/foundation/barrierfree/accessibility/services/aams/test/mock/include/
H A Dmock_preferences.h28 PreferencesValue Get(const std::string &key, const PreferencesValue &defValue) override;
32 int GetInt(const std::string &key, const int &defValue = {}) override;
34 std::string GetString(const std::string &key, const std::string &defValue = {}) override;
36 bool GetBool(const std::string &key, const bool &defValue = {}) override;
38 float GetFloat(const std::string &key, const float &defValue = {}) override;
40 double GetDouble(const std::string &key, const double &defValue = {}) override;
42 int64_t GetLong(const std::string &key, const int64_t &defValue = {}) override;
/foundation/systemabilitymgr/samgr/services/samgr/native/include/collect/
H A Ddevice_timed_collect_tool.h33 int64_t ObtainLong(const std::string& key, int64_t defValue);
34 std::string ObtainString(const std::string& key, std::string defValue);
44 bool Save(const std::string& key, const T& defValue);
52 T Obtain(const std::string& key, const T& defValue);
55 std::shared_ptr<NativePreferences::Preferences> ptr, const std::string& key, const int64_t& defValue);
57 std::shared_ptr<NativePreferences::Preferences> ptr, const std::string& key, const std::string& defValue);
/foundation/communication/netmanager_ext/services/netfirewallmanager/include/
H A Dnetfirewall_preference_helper.h58 int32_t ObtainInt(const std::string &key, int32_t defValue);
64 * @param defValue Value
68 bool ObtainBool(const std::string &key, bool defValue);
93 template <typename T> bool Save(const std::string &key, const T &defValue);
99 template <typename T> T Obtain(const std::string &key, const T &defValue);
102 const int32_t &defValue);
104 bool ObtainInner(std::shared_ptr<NativePreferences::Preferences> ptr, const std::string &key, const bool &defValue);
/foundation/bundlemanager/app_domain_verify/test/unittest/mock/include/
H A Dmock_preferences.h29 MOCK_METHOD(std::string, GetString, (const std::string& key, const std::string& defValue), (override));
36 PreferencesValue Get(const std::string& key, const PreferencesValue& defValue) override
44 int GetInt(const std::string& key, const int& defValue = {}) override
49 bool GetBool(const std::string& key, const bool& defValue = {}) override
53 float GetFloat(const std::string& key, const float& defValue = {}) override
57 double GetDouble(const std::string& key, const double& defValue = {}) override
61 int64_t GetLong(const std::string& key, const int64_t& defValue = {}) override
/foundation/filemanagement/dfs_service/test/mock/
H A Dpreference_helper_mock.cpp25 MOCK_METHOD2(Get, PreferencesValue(const std::string &key, const PreferencesValue &defValue));
27 MOCK_METHOD2(GetInt, int(const std::string &key, const int &defValue));
28 MOCK_METHOD2(GetString, std::string(const std::string &key, const std::string &defValue));
29 MOCK_METHOD2(GetBool, bool(const std::string &key, const bool &defValue));
30 MOCK_METHOD2(GetFloat, float(const std::string &key, const float &defValue));
31 MOCK_METHOD2(GetDouble, double(const std::string &key, const double &defValue));
32 MOCK_METHOD2(GetLong, int64_t(const std::string &key, const int64_t &defValue));
/foundation/distributeddatamgr/preferences/frameworks/native/include/
H A Dpreferences_base.h48 PreferencesValue Get(const std::string &key, const PreferencesValue &defValue) override;
52 int GetInt(const std::string &key, const int &defValue) override;
54 std::string GetString(const std::string &key, const std::string &defValue) override;
56 bool GetBool(const std::string &key, const bool &defValue) override;
58 float GetFloat(const std::string &key, const float &defValue) override;
60 double GetDouble(const std::string &key, const double &defValue) override;
62 int64_t GetLong(const std::string &key, const int64_t &defValue) override;
104 std::pair<int, PreferencesValue> GetValue(const std::string &key, const PreferencesValue &defValue) override;
H A Dpreferences_impl.h43 PreferencesValue Get(const std::string &key, const PreferencesValue &defValue) override;
59 std::pair<int, PreferencesValue> GetValue(const std::string &key, const PreferencesValue &defValue) override;
H A Dpreferences_enhance_impl.h43 PreferencesValue Get(const std::string &key, const PreferencesValue &defValue) override;
57 std::pair<int, PreferencesValue> GetValue(const std::string &key, const PreferencesValue &defValue) override;
/foundation/distributeddatamgr/preferences/interfaces/inner_api/include/
H A Dpreferences.h84 * @param defValue Indicates the default value of the preferences.
88 virtual PreferencesValue Get(const std::string &key, const PreferencesValue &defValue) = 0;
108 * @param defValue Indicates the default value of the preferences.
112 virtual int GetInt(const std::string &key, const int &defValue = {}) = 0;
120 * @param defValue Indicates the default value of the preferences.
124 virtual std::string GetString(const std::string &key, const std::string &defValue = {}) = 0;
132 * @param defValue Indicates the default value of the preferences.
136 virtual bool GetBool(const std::string &key, const bool &defValue = {}) = 0;
144 * @param defValue Indicates the default value of the preferences.
148 virtual float GetFloat(const std::string &key, const float &defValue
407 GetValue(const std::string &key, const PreferencesValue &defValue) GetValue() argument
[all...]
/foundation/arkui/ace_engine/frameworks/bridge/codec/
H A Dcodec_data.h136 bool GetBoolValue(bool defValue = false) const in GetBoolValue()
138 return (type_ == BufferDataType::TYPE_TRUE) ? true : (type_ == BufferDataType::TYPE_FALSE) ? false : defValue; in GetBoolValue()
140 int32_t GetIntValue(int32_t defValue = 0) const in GetIntValue()
142 return IsInt() ? std::get<int32_t>(data_) : defValue; in GetIntValue()
144 int64_t GetLongValue(int64_t defValue = 0) const in GetLongValue()
146 return IsLong() ? std::get<int64_t>(data_) : IsInt() ? std::get<int32_t>(data_) : defValue; in GetLongValue()
148 double GetDoubleValue(double defValue = 0.0) const in GetDoubleValue()
151 : IsLong() ? std::get<int64_t>(data_) : IsInt() ? std::get<int32_t>(data_) : defValue; in GetDoubleValue()
179 int32_t GetFunctionValue(int32_t defValue = 0) const in GetFunctionValue()
181 return IsFunction() ? std::get<int32_t>(data_) : defValue; in GetFunctionValue()
[all...]
/foundation/distributeddatamgr/preferences/frameworks/js/napi/storage/src/
H A Dnapi_storage.cpp38 PreferencesValue defValue = PreferencesValue(static_cast<int>(0)); member
308 asyncContext->defValue = number; in ParseDefValue()
325 asyncContext->defValue = str; in ParseDefValue()
335 asyncContext->defValue = bValue; in ParseDefValue()
359 if (context->defValue.IsBool()) { in GetValue()
360 bool tmpValue = (bool)obj->value_->GetBool(context->key, context->defValue); in GetValue()
361 context->defValue = PreferencesValue(tmpValue); in GetValue()
362 } else if (context->defValue.IsString()) { in GetValue()
363 std::string tmpValue = obj->value_->GetString(context->key, context->defValue); in GetValue()
364 context->defValue in GetValue()
[all...]
/foundation/arkui/ace_engine/frameworks/core/components_v2/common/
H A Dcommon_def.h60 const std::unique_ptr<std::function<R(Args...)>>& (C::*getMethod)() const, R defValue, const Args&... args) in ResumeEventCallback()
63 return (funcPtr && (*funcPtr)) ? (*funcPtr)(args...) : defValue; in ResumeEventCallback()
59 ResumeEventCallback(const RefPtr<C>& component, const std::unique_ptr<std::function<R(Args...)>>& (C::*getMethod)() const, R defValue, const Args&... args) ResumeEventCallback() argument
/foundation/communication/netmanager_base/frameworks/js/napi/common/
H A Dnapi_common.h75 const std::string &defValue = "");
79 const int32_t &defValue = 0);
81 const int64_t &defValue = 0);
H A Dnapi_common.cpp143 napi_env env, napi_value napiValue, const std::string &name, const std::string &defValue) in GetNapiStringValue()
149 return defValue; in GetNapiStringValue()
177 napi_env env, napi_value napiValue, const std::string &name, const int32_t &defValue) in GetNapiInt32Value()
187 return defValue; in GetNapiInt32Value()
191 napi_env env, napi_value napiValue, const std::string &name, const int64_t &defValue) in GetNapiInt64Value()
201 return defValue; in GetNapiInt64Value()
142 GetNapiStringValue( napi_env env, napi_value napiValue, const std::string &name, const std::string &defValue) GetNapiStringValue() argument
176 GetNapiInt32Value( napi_env env, napi_value napiValue, const std::string &name, const int32_t &defValue) GetNapiInt32Value() argument
190 GetNapiInt64Value( napi_env env, napi_value napiValue, const std::string &name, const int64_t &defValue) GetNapiInt64Value() argument
/foundation/arkui/ace_engine/frameworks/core/components/common/layout/
H A Dscreen_system_manager.h122 ArrayByScreenType(const T& defValue) in ArrayByScreenType() argument
124 std::fill(values_.begin(), values_.end(), defValue); in ArrayByScreenType()
/foundation/distributeddatamgr/preferences/frameworks/cj/src/
H A Dpreferences_ffi.cpp53 ValueType FfiOHOSPreferencesGet(int64_t id, const char* key, ValueType defValue) in FfiOHOSPreferencesGet() argument
60 return instance->Get(key, defValue); in FfiOHOSPreferencesGet()
H A Dpreferences_ffi.h48 FFI_EXPORT ValueType FfiOHOSPreferencesGet(int64_t id, const char* key, ValueType defValue);
/foundation/filemanagement/dfs_service/test/unittests/utils/preference/
H A Dcloud_pref_impl_test.cpp33 MOCK_METHOD2(Get, PreferencesValue(const std::string &key, const PreferencesValue &defValue));
35 MOCK_METHOD2(GetInt, int(const std::string &key, const int &defValue));
36 MOCK_METHOD2(GetString, std::string(const std::string &key, const std::string &defValue));
37 MOCK_METHOD2(GetBool, bool(const std::string &key, const bool &defValue));
38 MOCK_METHOD2(GetFloat, float(const std::string &key, const float &defValue));
39 MOCK_METHOD2(GetDouble, double(const std::string &key, const double &defValue));
40 MOCK_METHOD2(GetLong, int64_t(const std::string &key, const int64_t &defValue));
/foundation/distributeddatamgr/preferences/test/native/unittest/
H A Dpreferences_test.cpp839 PreferencesValue defValue(static_cast<int64_t>(0)); in HWTEST_F()
840 PreferencesValue stringArrayRes = pref1->Get(KEY_TEST_STRING_ARRAY_ELEMENT, defValue); in HWTEST_F()
844 PreferencesValue boolArrayRes = pref1->Get(KEY_TEST_BOOL_ARRAY_ELEMENT, defValue); in HWTEST_F()
848 PreferencesValue doubleArrayRes = pref1->Get(KEY_TEST_DOUBLE_ARRAY_ELEMENT, defValue); in HWTEST_F()
852 PreferencesValue uint8ArrayRes = pref1->Get(KEY_TEST_UINT8_ARRAY_ELEMENT, defValue); in HWTEST_F()
980 PreferencesValue defValue(static_cast<int64_t>(0)); in HWTEST_F()
981 PreferencesValue res = pref1->Get(KEY_TEST_OBJECT_ELEMENT, defValue); in HWTEST_F()
/foundation/distributeddatamgr/preferences/frameworks/js/napi/sendable_preferences/src/
H A Dnapi_preferences.cpp40 PreferencesValue defValue = PreferencesValue(static_cast<int64_t>(0)); member
154 int32_t rc = Utils::ConvertFromSendable(env, jsVal, context->defValue.value_); in ParseDefValue()
224 context->defValue = instance->Get(context->key, context->defValue); in GetValue()
228 if (context->defValue.IsLong()) { in GetValue()
232 result = Utils::ConvertToSendable(env, context->defValue.value_); in GetValue()
261 return instance->Put(context->key, context->defValue); in SetValue()

Completed in 13 milliseconds

12