/ohos5.0/foundation/distributeddatamgr/preferences/test/native/unittest/ |
H A D | preferences_test.cpp | 72 pref = nullptr; in TearDownTestCase() 84 if (pref) { in TearDown() 85 pref->Clear(); in TearDown() 194 pref->FlushSync(); 221 pref->FlushSync(); 240 pref->FlushSync(); 262 pref->FlushSync(); 288 pref->FlushSync(); 314 pref->FlushSync(); 340 pref->FlushSync(); [all …]
|
H A D | preferences_file_test.cpp | 58 pref->PutInt(intKey, intValue); in PreferencesPutValue() 59 pref->PutString(strKey, strValue); in PreferencesPutValue() 60 int ret = pref->FlushSync(); in PreferencesPutValue() 99 pref = nullptr; 129 pref = nullptr; 157 pref = nullptr; 176 pref = nullptr; 187 pref = nullptr; 217 pref = nullptr; 238 pref = nullptr; [all …]
|
H A D | preferences_helper_test.cpp | 70 pref->PutInt("key1", 2); 71 pref->PutString("key2", "test"); 72 int ret = pref->FlushSync(); 75 pref = nullptr; 95 pref = PreferencesHelper::GetPreferences("data/test/test_helper", errCode); 102 pref = PreferencesHelper::GetPreferences(path, errCode); 120 pref = PreferencesHelper::GetPreferences("data/test/test_helper", errCode); 131 int pref = PreferencesHelper::DeletePreferences(""); variable 132 EXPECT_EQ(pref, E_EMPTY_FILE_PATH); 134 pref = PreferencesHelper::RemovePreferencesFromCache(""); [all …]
|
H A D | preferences_xml_utils_test.cpp | 169 std::shared_ptr<Preferences> pref = PreferencesHelper::GetPreferences(file, errCode); variable 171 std::string retString = pref->GetString("stringKey", ""); 207 std::shared_ptr<Preferences> pref = PreferencesHelper::GetPreferences(file, errCode); variable 210 auto retStringArray = pref->Get("stringArrayKey", ""); 247 std::shared_ptr<Preferences> pref = PreferencesHelper::GetPreferences(file, errCode); variable 250 auto retDoubleArray = pref->Get("doubleArrayKey", 10.0); 290 auto retBoolArray = pref->Get("boolArrayKey", false); 320 auto retBoolArray = pref->Get("boolArrayKey", false); 352 auto retStringArray = pref->Get("stringArrayKey", false); 384 auto retDoubleArray = pref->Get("doubleArrayKey", 0); [all …]
|
/ohos5.0/foundation/distributeddatamgr/preferences/test/ndk/unittest/ |
H A D | preferences_ndk_test.cpp | 210 SetAllValuesWithCheck(pref); 238 SetAllValuesWithCheck(pref); 269 SetAllValuesWithCheck(pref); 326 SetAllValuesWithCheck(pref); 352 SetAllValuesWithCheck(pref); 381 SetAllValuesWithCheck(pref); 412 SetAllValuesWithCheck(pref); 441 SetAllValuesWithCheck(pref); 513 RegisterObsInFunc(pref); 515 SetAllValuesWithCheck(pref); [all …]
|
H A D | preferences_ndk_value_test.cpp | 113 errCode = OH_Preferences_SetInt(pref, "", value); 115 errCode = OH_Preferences_GetInt(pref, "", &res); 118 errCode = OH_Preferences_SetInt(pref, nullptr, value); 120 errCode = OH_Preferences_GetInt(pref, nullptr, &res); 154 errCode = OH_Preferences_SetString(pref, "", "test"); 169 EXPECT_EQ(PreferencesFlush(pref), PREFERENCES_OK); 173 pref = OH_Preferences_Open(option, &errCode); 205 errCode = OH_Preferences_SetBool(pref, "", false); 215 errCode = OH_Preferences_SetBool(pref, " ", true); 244 errCode = OH_Preferences_Delete(pref, ""); [all …]
|
/ohos5.0/foundation/communication/nfc/services/src/external_deps/ |
H A D | nfc_preferences.cpp | 46 if (!pref) { in SetString() 52 pref->Flush(); in SetString() 58 if (!pref) { in GetString() 69 if (!pref) { in SetInt() 75 pref->Flush(); in SetInt() 81 if (!pref) { in GetInt() 92 if (!pref) { in Clear() 96 pref->Clear(); in Clear() 104 if (!pref) { in Delete() 109 pref->Delete(key); in Delete() [all …]
|
/ohos5.0/foundation/arkui/ace_engine/adapter/ohos/capability/preference/ |
H A D | storage_impl.cpp | 28 return pref; in GetPreference() 34 CHECK_NULL_VOID(pref); in SetString() 37 pref->PutString(key, value); in SetString() 38 pref->Flush(); in SetString() 44 CHECK_NULL_RETURN(pref, ""); in GetString() 46 return pref->GetString(key, ""); in GetString() 52 CHECK_NULL_VOID(pref); in Clear() 53 pref->Clear(); in Clear() 62 CHECK_NULL_VOID(pref); in Delete() 64 pref->Delete(key); in Delete() [all …]
|
/ohos5.0/foundation/window/window_manager/utils/src/ |
H A D | persistent_storage.cpp | 38 if (!pref) { in HasKey() 42 res = pref->HasKey(key); in HasKey() 51 if (!pref) { in Delete() 55 pref->Delete(key); in Delete() 56 pref->Flush(); in Delete() 70 return pref; in GetPreference() 77 if (!pref) { in Insert() 89 pref->PutInt(key, value); in Insert() 97 pref->Flush(); in Insert() 104 if (!pref) { in Get() [all …]
|
/ohos5.0/foundation/window/window_manager/window_scene/session/host/src/ |
H A D | scene_persistent_storage.cpp | 29 auto pref = GetPreference(storageType); in HasKey() local 30 if (!pref) { in HasKey() 34 res = pref->HasKey(key); in HasKey() 42 auto pref = GetPreference(storageType); in Delete() local 43 if (!pref) { in Delete() 47 pref->Delete(key); in Delete() 48 pref->Flush(); in Delete() 60 auto pref = NativePreferences::PreferencesHelper::GetPreferences(fileName, errCode); in GetPreference() local 62 return pref; in GetPreference()
|
/ohos5.0/foundation/distributeddatamgr/preferences/test/js/unittest/preferences/src/ |
H A D | PreferencesTaskpoolJsunit.test.js | 118 let pref = await data_preferences.getPreferences(context, NAME); 121 await pref.delete(KEY_TEST_STRING_ELEMENT + index.toString()); 122 await pref.flush(); 123 await pref.put(KEY_TEST_STRING_ELEMENT + index.toString(), "test"); 124 await pref.flush(); 158 let pref = await data_preferences.getPreferences(context, NAME); 161 pref.deleteSync(KEY_TEST_STRING_ELEMENT + index.toString()); 162 await pref.flush(); 163 pref.putSync(KEY_TEST_STRING_ELEMENT + index.toString(), "test"); 164 await pref.flush(); [all …]
|
H A D | PreferencesHelperJsunit.test.js | 62 await promise.then(async (pref) => { 63 await pref.put('test', 2); 155 await promise.then((pref) => { 200 await promise.then((pref) => {
|
/ohos5.0/foundation/window/window_manager/window_scene/session/host/include/ |
H A D | scene_persistent_storage.h | 44 auto pref = GetPreference(storageType); in Insert() local 45 if (!pref) { in Insert() 51 pref->PutFloat(key, value); in Insert() 57 pref->PutInt(key, value); in Insert() 65 pref->Flush(); in Insert() 71 auto pref = GetPreference(storageType); in Get() local 72 if (!pref) { in Get() 78 value = pref->GetFloat(key); in Get() 84 value = pref->GetInt(key); in Get()
|
/ohos5.0/foundation/distributeddatamgr/preferences/test/js/performance/preferences/src/ |
H A D | PreferencesInstanceCallBackJsPref.test.js | 57 const pref = await dataPreferences.getPreferences(context, `${NAME}${index}`); 58 pref.putSync(KEY_TEST_FLOAT_ELEMENT, 123456789.00001); 59 pref.putSync(KEY_TEST_BOOLEAN_ELEMENT, true); 60 … pref.putSync(KEY_TEST_STRING_ELEMENT + '1', "01234567890123456789012345678901234567890123456789"); 61 … pref.putSync(KEY_TEST_STRING_ELEMENT + '2', "01234567890123456789012345678901234567890123456789"); 62 … pref.putSync(KEY_TEST_STRING_ELEMENT + '3', "01234567890123456789012345678901234567890123456789"); 65 await pref.flush(); 118 let pref = await dataPreferences.getPreferences(context, NAME); 123 pref.flush(function () { 141 let pref = await dataPreferences.getPreferences(context, NAME); [all …]
|
H A D | PreferencesInstancePromiseJsPref.test.js | 57 const pref = await dataPreferences.getPreferences(context, `${NAME}${index}`); 58 pref.putSync(KEY_TEST_FLOAT_ELEMENT, 123456789.00001); 59 pref.putSync(KEY_TEST_BOOLEAN_ELEMENT, true); 60 … pref.putSync(KEY_TEST_STRING_ELEMENT + '1', "01234567890123456789012345678901234567890123456789"); 61 … pref.putSync(KEY_TEST_STRING_ELEMENT + '2', "01234567890123456789012345678901234567890123456789"); 62 … pref.putSync(KEY_TEST_STRING_ELEMENT + '3', "01234567890123456789012345678901234567890123456789"); 63 … pref.putSync(KEY_TEST_STRING_ELEMENT + '4', "01234567890123456789012345678901234567890123456789"); 64 … pref.putSync(KEY_TEST_STRING_ELEMENT + '5', "01234567890123456789012345678901234567890123456789"); 65 await pref.flush(); 102 let pref = await dataPreferences.getPreferences(context, NAME); [all …]
|
/ohos5.0/foundation/distributeddatamgr/preferences/frameworks/native/src/ |
H A D | preferences_helper.cpp | 172 std::shared_ptr<Preferences> pref = nullptr; in GetPreferences() local 177 pref = PreferencesEnhanceImpl::GetPreferences(options); in GetPreferences() 181 pref = PreferencesImpl::GetPreferences(options); in GetPreferences() 185 pref = PreferencesImpl::GetPreferences(options); in GetPreferences() 192 return pref; in GetPreferences() 208 auto pref = it->second.first; in DeletePreferences() local 209 if (pref != nullptr) { in DeletePreferences() 211 dataGroupId = pref->GetGroupId(); in DeletePreferences() 212 errCode = pref->CloseDb(); in DeletePreferences() 218 pref = nullptr; in DeletePreferences() [all …]
|
H A D | preferences_impl.cpp | 152 ExecutorPool::Task task = [pref = shared_from_this()] { PreferencesImpl::LoadFromDisk(pref); }; in StartLoadFromDisk() 159 if (pref->loaded_.load()) { in LoadFromDisk() 163 if (!pref->loaded_.load()) { in LoadFromDisk() 168 pref->loaded_.store(true); in LoadFromDisk() 169 pref->cond_.notify_all(); in LoadFromDisk() 297 if (!PreferencesXmlUtils::ReadSettingXml(pref->options_.filePath, pref->options_.bundleName, in ReadSettingXml() 298 pref->options_.dataGroupId, settings)) { in ReadSettingXml() 306 pref->valuesCache_ = std::move(values); in ReadSettingXml() 463 pref->valuesCache_.DoActionWhenClone( in WriteToDiskFile() 465 if (!pref->modifiedKeys_.empty()) { in WriteToDiskFile() [all …]
|
H A D | preferences_enhance_impl.cpp | 136 ExecutorPool::Task task = [pref = shared_from_this(), key, value] { in Put() 137 PreferencesEnhanceImpl::NotifyPreferencesObserver(pref, key, value); in Put() 163 ExecutorPool::Task task = [pref = shared_from_this(), key, value] { in Delete() 164 PreferencesEnhanceImpl::NotifyPreferencesObserver(pref, key, value); in Delete() 207 std::shared_lock<std::shared_mutex> readLock(pref->mapSharedMutex_); in NotifyPreferencesObserver() 208 LOG_DEBUG("notify observer size:%{public}zu", pref->dataObserversMap_.size()); in NotifyPreferencesObserver() 209 for (const auto &[weakPrt, keys] : pref->dataObserversMap_) { in NotifyPreferencesObserver() 221 for (auto it = pref->localObservers_.begin(); it != pref->localObservers_.end(); ++it) { in NotifyPreferencesObserver() 228 dataObsMgrClient->NotifyChange(pref->MakeUri(key)); in NotifyPreferencesObserver() 236 NotifyPreferencesObserver(pref, key, value); in NotifyPreferencesObserverBatchKeys() [all …]
|
/ohos5.0/foundation/multimodalinput/input/service/module_loader/src/ |
H A D | multimodal_input_preferences_manager.cpp | 185 std::shared_ptr<NativePreferences::Preferences> pref = in SetIntValue() local 187 CHKPR(pref, errno); in SetIntValue() 188 int32_t ret = pref->PutInt(key, setValue); in SetIntValue() 193 ret = pref->FlushSync(); in SetIntValue() 223 CHKPR(pref, errno); in SetBoolValue() 224 int32_t ret = pref->PutBool(key, setValue); in SetBoolValue() 229 ret = pref->FlushSync(); in SetBoolValue() 244 CHKPR(pref, errno); in GetShortKeyDuration() 265 CHKPR(pref, errno); in SetShortKeyDuration() 266 int32_t ret = pref->PutInt(key, setValue); in SetShortKeyDuration() [all …]
|
/ohos5.0/foundation/distributeddatamgr/preferences/frameworks/js/napi/system_storage/src/ |
H A D | napi_system_storage.cpp | 241 auto pref = PreferencesHelper::GetPreferences(context->prefName, context->output); in NapiGet() local 242 context->val = pref->GetString(context->key, context->def); in NapiGet() 259 auto pref = PreferencesHelper::GetPreferences(context->prefName, context->output); in NapiSet() local 263 context->output = pref->PutString(context->key, context->val); in NapiSet() 264 pref->FlushSync(); in NapiSet() 277 auto pref = PreferencesHelper::GetPreferences(context->prefName, context->output); in NapiDelete() local 281 context->output = pref->Delete(context->key); in NapiDelete() 282 pref->FlushSync(); in NapiDelete() 290 auto pref = PreferencesHelper::GetPreferences(context->prefName, context->output); in NapiClear() local 294 context->output = pref->Clear(); in NapiClear() [all …]
|
/ohos5.0/foundation/distributeddatamgr/preferences/test/js/unittest/storage/src/ |
H A D | StorageHelperJsunit.test.js | 59 await promise.then((pref) => { 60 pref.putSync('test', 2); 95 await promise.then((pref) => { 129 await promise.then((pref) => {
|
/ohos5.0/foundation/distributeddatamgr/datamgr_service/services/distributeddataservice/rust/extension/ |
H A D | asset_loader_impl.cpp | 37 std::string pref; in Download() local 40 pref = *pre; in Download() 47 .prefix = reinterpret_cast<const unsigned char *>(pref.c_str()), in Download() 48 .prefixLen = pref.size() in Download()
|
/ohos5.0/foundation/distributeddatamgr/preferences/frameworks/native/include/ |
H A D | preferences_impl.h | 70 static void LoadFromDisk(std::shared_ptr<PreferencesImpl> pref); 73 static int WriteToDiskFile(std::shared_ptr<PreferencesImpl> pref); 74 static bool ReadSettingXml(std::shared_ptr<PreferencesImpl> pref);
|
H A D | preferences_enhance_impl.h | 62 …static void NotifyPreferencesObserver(std::shared_ptr<PreferencesEnhanceImpl> pref, const std::str… 64 static void NotifyPreferencesObserverBatchKeys(std::shared_ptr<PreferencesEnhanceImpl> pref,
|
/ohos5.0/foundation/filemanagement/dfs_service/test/mock/ |
H A D | preference_helper_mock.cpp | 59 std::shared_ptr<PreferencesHelperMock> pref = std::make_shared<PreferencesHelperMock>(); in GetPreferences() local 60 return pref; in GetPreferences()
|