Home
last modified time | relevance | path

Searched refs:Utils (Results 1 – 25 of 113) sorted by relevance

12345

/base/update/updater/test/unittest/utils/
Dutils_unittest.cpp46 string emptyStr = Utils::Trim("");
48 emptyStr = Utils::Trim(" ");
50 emptyStr = Utils::Trim("aa ");
58 string newStr = Utils::ConvertSha256Hex(a, 1);
65 vector<string> newStr = Utils::SplitString(str, "\n");
73 EXPECT_EQ(Utils::MkdirRecursive(path, S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH), -1);
75 EXPECT_EQ(Utils::MkdirRecursive(path, S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH), 0);
81 int output = Utils::String2Int<int>(input, 10);
84 output = Utils::String2Int<int>(input, 10);
92 EXPECT_EQ(Utils::GetFilesFromDirectory(path, files, true), -1);
[all …]
/base/global/resource_management_lite/frameworks/resmgr_lite/src/utils/
Dutils.cpp26 bool Utils::IsAlphaString(const char *s, int32_t len) in IsAlphaString()
41 bool Utils::IsNumericString(const char *s, int32_t len) in IsNumericString()
67 void Utils::DecodeScript(uint32_t encodeScript, char *outValue) in DecodeScript()
78 bool Utils::IsStrEmpty(const char *s) in IsStrEmpty()
83 size_t Utils::StrLen(const char *s) in StrLen()
91 uint16_t Utils::EncodeLanguage(const char *language) in EncodeLanguage()
93 if (Utils::IsStrEmpty(language)) { in EncodeLanguage()
96 return Utils::EncodeLanguageOrRegion(language, 'a'); in EncodeLanguage()
110 uint64_t Utils::EncodeLocale(const char *language, in EncodeLocale()
114 uint16_t languageData = Utils::EncodeLanguage(language); in EncodeLocale()
[all …]
/base/security/access_token/services/accesstokenmanager/main/cpp/src/permission/
Dpermission_definition_cache.cpp47 Utils::UniqueWriteGuard<Utils::RWLock> cacheGuard(this->cacheLock_); in Insert()
61 Utils::UniqueWriteGuard<Utils::RWLock> cacheGuard(this->cacheLock_); in Update()
68 Utils::UniqueWriteGuard<Utils::RWLock> cacheGuard(this->cacheLock_); in DeleteByBundleName()
81 Utils::UniqueReadGuard<Utils::RWLock> cacheGuard(this->cacheLock_); in FindByPermissionName()
94 Utils::UniqueReadGuard<Utils::RWLock> cacheGuard(this->cacheLock_); in IsSystemGrantedPermission()
100 Utils::UniqueReadGuard<Utils::RWLock> cacheGuard(this->cacheLock_); in IsUserGrantedPermission()
115 Utils::UniqueReadGuard<Utils::RWLock> cacheGuard(this->cacheLock_); in HasDefinition()
121 Utils::UniqueReadGuard<Utils::RWLock> cacheGuard(this->cacheLock_); in IsPermissionDefEmpty()
127 Utils::UniqueReadGuard<Utils::RWLock> cacheGuard(this->cacheLock_); in StorePermissionDef()
141 Utils::UniqueReadGuard<Utils::RWLock> cacheGuard(this->cacheLock_); in GetDefPermissionsByTokenId()
Dpermission_policy_set.cpp64 Utils::UniqueWriteGuard<Utils::RWLock> infoGuard(this->permPolicySetLock_); in Update()
140 Utils::UniqueReadGuard<Utils::RWLock> infoGuard(this->permPolicySetLock_); in StorePermissionPolicySet()
146 Utils::UniqueReadGuard<Utils::RWLock> infoGuard(this->permPolicySetLock_); in VerifyPermissStatus()
166 Utils::UniqueReadGuard<Utils::RWLock> infoGuard(this->permPolicySetLock_); in GetPermissionStateFulls()
172 Utils::UniqueReadGuard<Utils::RWLock> infoGuard(this->permPolicySetLock_); in QueryPermissionFlag()
193 Utils::UniqueWriteGuard<Utils::RWLock> infoGuard(this->permPolicySetLock_); in UpdatePermissionStatus()
219 Utils::UniqueWriteGuard<Utils::RWLock> infoGuard(this->permPolicySetLock_); in ResetUserGrantPermissionStatus()
241 Utils::UniqueReadGuard<Utils::RWLock> infoGuard(this->permPolicySetLock_); in GetPermissionStateList()
305 Utils::UniqueReadGuard<Utils::RWLock> infoGuard(this->permPolicySetLock_); in ToString()
352 Utils::UniqueReadGuard<Utils::RWLock> infoGuard(this->permPolicySetLock_); in PermStateToString()
/base/global/resource_management/frameworks/resmgr/src/
Dlocale_matcher.cpp30 uint64_t LocaleMatcher::EN_US_ENCODE = Utils::EncodeLocale("en", nullptr, "US");
31 uint64_t LocaleMatcher::EN_GB_ENCODE = Utils::EncodeLocale("en", nullptr, "GB");
32 uint64_t LocaleMatcher::EN_QAAG_ENCODE = Utils::EncodeLocale("en", "Qaag", nullptr);
33 uint64_t LocaleMatcher::ZH_HANT_MO_ENCODE = Utils::EncodeLocale("zh", "Hant", "MO");
34 uint64_t LocaleMatcher::ZH_HK_ENCODE = Utils::EncodeLocale("zh", nullptr, "HK");
35 uint32_t LocaleMatcher::HANT_ENCODE = Utils::EncodeScript("Hant");
62 if (Utils::EncodeScriptByResLocale(request) == LocaleMatcher::HANT_ENCODE) { in SearchParentLocale()
134 uint64_t encodedLocale = Utils::EncodeLocale(language, script, region); in IsDefaultLocale()
136 encodedLocale = Utils::EncodeLocale("en", "Latn", region); in IsDefaultLocale()
158 uint64_t encodedLocale = Utils::EncodeLocale(language, nullptr, region); in FindDefaultScriptEncode()
[all …]
Dres_locale.cpp139 return this->Init(other->getLanguage(), Utils::StrLen(other->getLanguage()), other->getScript(), in CopyFromLocaleInfo()
140 Utils::StrLen(other->getScript()), other->getCountry(), Utils::StrLen(other->getCountry())); in CopyFromLocaleInfo()
149 return this->Init(other->GetLanguage(), Utils::StrLen(other->GetLanguage()), other->GetScript(), in Copy()
150 Utils::StrLen(other->GetScript()), other->GetRegion(), Utils::StrLen(other->GetRegion())); in Copy()
269 size_t strLen = Utils::StrLen(str); in BuildFromString()
281 size_t len = Utils::StrLen(language); in BuildFromParts()
301 len = Utils::StrLen(script); in BuildFromParts()
311 len = Utils::StrLen(region); in BuildFromParts()
395 size_t len = Utils::StrLen(language); in BuildFromParts()
405 len = Utils::StrLen(script); in BuildFromParts()
[all …]
/base/global/resource_management_lite/frameworks/resmgr_lite/src/
Dlocale_matcher.cpp30 uint64_t LocaleMatcher::EN_US_ENCODE = Utils::EncodeLocale("en", nullptr, "US");
31 uint64_t LocaleMatcher::EN_GB_ENCODE = Utils::EncodeLocale("en", nullptr, "GB");
32 uint64_t LocaleMatcher::EN_QAAG_ENCODE = Utils::EncodeLocale("en", "Qaag", nullptr);
33 uint64_t LocaleMatcher::ZH_HANT_MO_ENCODE = Utils::EncodeLocale("zh", "Hant", "MO");
34 uint64_t LocaleMatcher::ZH_HK_ENCODE = Utils::EncodeLocale("zh", nullptr, "HK");
35 uint32_t LocaleMatcher::HANT_ENCODE = Utils::EncodeScript("Hant");
62 if (Utils::EncodeScriptByResLocale(request) == LocaleMatcher::HANT_ENCODE) { in SearchParentLocale()
134 uint64_t encodedLocale = Utils::EncodeLocale(language, script, region); in IsDefaultLocale()
136 encodedLocale = Utils::EncodeLocale("en", "Latn", region); in IsDefaultLocale()
158 uint64_t encodedLocale = Utils::EncodeLocale(language, nullptr, region); in FindDefaultScriptEncode()
[all …]
Dres_locale.cpp134 return this->Init(other->GetLanguage(), Utils::StrLen(other->GetLanguage()), other->GetScript(), in CopyFromLocaleInfo()
135 Utils::StrLen(other->GetScript()), other->GetRegion(), Utils::StrLen(other->GetRegion())); in CopyFromLocaleInfo()
143 return this->Init(other->GetLanguage(), Utils::StrLen(other->GetLanguage()), other->GetScript(), in Copy()
144 Utils::StrLen(other->GetScript()), other->GetRegion(), Utils::StrLen(other->GetRegion())); in Copy()
263 size_t strLen = Utils::StrLen(str); in BuildFromString()
275 size_t len = Utils::StrLen(language); in BuildFromParts()
295 len = Utils::StrLen(script); in BuildFromParts()
305 len = Utils::StrLen(region); in BuildFromParts()
383 size_t len = Utils::StrLen(language); in BuildFromParts()
393 len = Utils::StrLen(script); in BuildFromParts()
[all …]
/base/global/resource_management/frameworks/resmgr/src/utils/
Dutils.cpp34 const std::set<std::string> Utils::tailSet {
47 std::unique_ptr<uint8_t[]> Utils::LoadResourceFile(const std::string &path, int &len) in LoadResourceFile()
64 RState Utils::EncodeBase64(std::unique_ptr<uint8_t[]> &data, int srcLen, in EncodeBase64()
103 bool Utils::IsAlphaString(const char *s, int32_t len) in IsAlphaString()
118 bool Utils::IsNumericString(const char *s, int32_t len) in IsNumericString()
144 void Utils::DecodeScript(uint32_t encodeScript, char *outValue) in DecodeScript()
155 bool Utils::IsStrEmpty(const char *s) in IsStrEmpty()
160 size_t Utils::StrLen(const char *s) in StrLen()
168 uint16_t Utils::EncodeLanguage(const char *language) in EncodeLanguage()
170 if (Utils::IsStrEmpty(language)) { in EncodeLanguage()
[all …]
/base/security/access_token/services/accesstokenmanager/main/cpp/src/token/
Dtoken_modify_notifier.cpp42 Utils::UniqueWriteGuard<Utils::RWLock> infoGuard(this->Notifylock_); in AddHapTokenObservation()
50 Utils::UniqueWriteGuard<Utils::RWLock> infoGuard(this->Notifylock_); in NotifyTokenDelete()
62 Utils::UniqueWriteGuard<Utils::RWLock> infoGuard(this->Notifylock_); in NotifyTokenModify()
76 Utils::UniqueWriteGuard<Utils::RWLock> infoGuard(instance.initLock_); in GetInstance()
88 Utils::UniqueWriteGuard<Utils::RWLock> infoGuard(this->Notifylock_); in NotifyTokenSyncTask()
Daccesstoken_id_manager.cpp43 Utils::UniqueReadGuard<Utils::RWLock> idGuard(this->tokenIdLock_); in GetTokenIdType()
58 Utils::UniqueWriteGuard<Utils::RWLock> idGuard(this->tokenIdLock_); in RegisterTokenId()
115 Utils::UniqueWriteGuard<Utils::RWLock> idGuard(this->tokenIdLock_); in ReleaseTokenId()
Daccesstoken_remote_token_manager.cpp59 Utils::UniqueWriteGuard<Utils::RWLock> infoGuard(this->remoteDeviceLock_); in MapRemoteDeviceTokenToLocal()
96 Utils::UniqueReadGuard<Utils::RWLock> infoGuard(this->remoteDeviceLock_); in GetDeviceAllRemoteTokenID()
120 Utils::UniqueReadGuard<Utils::RWLock> infoGuard(this->remoteDeviceLock_); in GetDeviceMappingTokenID()
140 Utils::UniqueWriteGuard<Utils::RWLock> infoGuard(this->remoteDeviceLock_); in RemoveDeviceMappingTokenID()
Daccesstoken_info_manager.cpp63 OHOS::Utils::UniqueWriteGuard<OHOS::Utils::RWLock> lk(this->managerLock_); in Init()
195 Utils::UniqueWriteGuard<Utils::RWLock> infoGuard(this->hapTokenInfoLock_); in AddHapTokenInfo()
226 Utils::UniqueWriteGuard<Utils::RWLock> infoGuard(this->nativeTokenInfoLock_); in AddNativeTokenInfo()
249 Utils::UniqueReadGuard<Utils::RWLock> infoGuard(this->hapTokenInfoLock_); in GetHapTokenInfoInner()
259 Utils::UniqueReadGuard<Utils::RWLock> infoGuard(this->hapTokenInfoLock_); in IsTokenIdExist()
288 Utils::UniqueReadGuard<Utils::RWLock> infoGuard(this->nativeTokenInfoLock_); in GetNativeTokenInfoInner()
333 Utils::UniqueWriteGuard<Utils::RWLock> infoGuard(this->hapTokenInfoLock_); in RemoveHapTokenInfo()
375 Utils::UniqueWriteGuard<Utils::RWLock> infoGuard(this->nativeTokenInfoLock_); in RemoveNativeTokenInfo()
491 Utils::UniqueReadGuard<Utils::RWLock> infoGuard(this->hapTokenInfoLock_); in GetHapTokenID()
506 Utils::UniqueWriteGuard<Utils::RWLock> infoGuard(this->nativeTokenInfoLock_); in TryUpdateExistNativeToken()
[all …]
/base/update/updater/utils/
Dupdater_reboot.cpp24 if (argc > Updater::Utils::ARGC_TWO_NUMS) { in main()
30 Updater::Utils::DoReboot(""); in main()
34 Updater::Utils::DoReboot(argv[1]); in main()
36 Updater::Utils::DoReboot(argv[1]); in main()
38 Updater::Utils::DoReboot("flashd", argv[1] + strlen("flashd:")); in main()
/base/update/updater/services/ui/
Dupdater_ui.cpp93 Utils::UsSleep(minSleepMs); in DoProgress()
95 Utils::UsSleep(maxSleepMs); in DoProgress()
108 Utils::DoReboot(""); in OnRebootEvt()
132 Utils::UsSleep(CALLBACK_DELAY); in OnLabelSDCardEvt()
136 Utils::UsSleep(DISPLAY_TIME); in OnLabelSDCardEvt()
142 Utils::DoReboot(""); in OnLabelSDCardEvt()
156 Utils::UsSleep(CALLBACK_DELAY); in OnLabelSDCardNoDelayEvt()
160 Utils::UsSleep(FAIL_DELAY); in OnLabelSDCardNoDelayEvt()
166 Utils::UsSleep(SUCCESS_DELAY); in OnLabelSDCardNoDelayEvt()
168 Utils::DoReboot(""); in OnLabelSDCardNoDelayEvt()
[all …]
/base/update/updater/services/applypatch/
Dtransfer_manager.cpp25 using namespace Updater::Utils;
58 globalParams->version = Utils::String2Int<size_t>(*ct++, Utils::N_DEC); in CommandsParser()
59 globalParams->blockCount = Utils::String2Int<size_t>(*ct++, Utils::N_DEC); in CommandsParser()
60 globalParams->maxEntries = Utils::String2Int<size_t>(*ct++, Utils::N_DEC); in CommandsParser()
61 globalParams->maxBlocks = Utils::String2Int<size_t>(*ct++, Utils::N_DEC); in CommandsParser()
124 bool ret = Utils::WriteStringToFile(fd, cmd); in RegisterForRetry()
143 if (!Utils::ReadFileToString(fd, cmd)) { in ReloadForRetry()
Dblock_set.cpp32 using namespace Updater::Utils;
162 if (!Utils::ReadFully(fd, buffer.data() + pos, size)) { in ReadDataFromBlock()
192 if (Utils::WriteFully(fd, buffer.data() + pos, writeSize) == false) { in WriteDataToBlock()
219 std::string hexdigest = Utils::ConvertSha256Hex(digest, SHA256_DIGEST_LENGTH); in VerifySha256()
366 if (Utils::WriteFully(fd, buffer.data(), H_BLOCK_SIZE)) { in WriteZeroToBlock()
384 size_t offset = Utils::String2Int<size_t>(cmd.GetArgumentByPos(pos++), Utils::N_DEC); in WriteDiffToBlock()
385 size_t length = Utils::String2Int<size_t>(cmd.GetArgumentByPos(pos++), Utils::N_DEC); in WriteDiffToBlock()
/base/security/access_token/services/privacymanager/src/record/
Dpermission_used_record_cache.cpp53 Utils::UniqueWriteGuard<Utils::RWLock> lock1(this->cacheLock1_); in AddRecordToBuffer()
101 Utils::UniqueWriteGuard<Utils::RWLock> lock2(this->cacheLock2_); in AddToPersistQueue()
132 Utils::UniqueReadGuard<Utils::RWLock> lock2(this->cacheLock2_); in PersistPendingRecords()
139 Utils::UniqueWriteGuard<Utils::RWLock> lock2(this->cacheLock2_); in PersistPendingRecords()
158 Utils::UniqueReadGuard<Utils::RWLock> lock2(this->cacheLock2_); in PersistPendingRecords()
163 Utils::UniqueReadGuard<Utils::RWLock> lock2(this->cacheLock2_); in PersistPendingRecords()
181 Utils::UniqueWriteGuard<Utils::RWLock> lock1(this->cacheLock1_); in RemoveRecords()
215 Utils::UniqueWriteGuard<Utils::RWLock> lock2(this->cacheLock2_); in RemoveFromPersistQueueAndDatabase()
246 Utils::UniqueWriteGuard<Utils::RWLock> lock1(this->cacheLock1_); in GetRecords()
281 Utils::UniqueWriteGuard<Utils::RWLock> lock2(this->cacheLock2_); in GetFromPersistQueueAndDatabase()
[all …]
/base/security/access_token/services/privacymanager/src/database/
Dpermission_used_record_db.cpp78 OHOS::Utils::UniqueWriteGuard<OHOS::Utils::RWLock> lock(this->rwLock_); in Add()
107 OHOS::Utils::UniqueWriteGuard<OHOS::Utils::RWLock> lock(this->rwLock_); in Remove()
121 OHOS::Utils::UniqueWriteGuard<OHOS::Utils::RWLock> lock(this->rwLock_); in Modify()
139 OHOS::Utils::UniqueWriteGuard<OHOS::Utils::RWLock> lock(this->rwLock_); in FindByConditions()
171 OHOS::Utils::UniqueWriteGuard<OHOS::Utils::RWLock> lock(this->rwLock_); in GetDistinctValue()
191 OHOS::Utils::UniqueWriteGuard<OHOS::Utils::RWLock> lock(this->rwLock_); in Count()
203 OHOS::Utils::UniqueWriteGuard<OHOS::Utils::RWLock> lock(this->rwLock_); in DeleteExpireRecords()
220 OHOS::Utils::UniqueWriteGuard<OHOS::Utils::RWLock> lock(this->rwLock_); in DeleteExcessiveRecords()
/base/update/updater/services/updater_binary/
Dmain.cpp30 if (Utils::IsUpdaterMode()) { in main()
47 return ProcessUpdater(retry, pipeFd, packagePath, Utils::GetCertName()); in main()
/base/security/access_token/services/accesstokenmanager/main/cpp/include/token/
Dtoken_modify_notifier.h45 OHOS::Utils::RWLock initLock_;
46 OHOS::Utils::RWLock Notifylock_;
/base/security/access_token/frameworks/common/src/
Drandom_mbedtls.cpp42 Utils::UniqueWriteGuard<Utils::RWLock> infoGuard(this->randomLock_); in GenerateRandomArray()
/base/telephony/core_service/services/ims_service_interaction/src/
Dims_core_service_client.cpp89 Utils::UniqueWriteGuard<Utils::RWLock> guard(rwClientLock_); in GetImsCoreServiceProxy()
181 Utils::UniqueWriteGuard<Utils::RWLock> guard(rwClientLock_); in Clean()
/base/update/updater/test/unittest/applypatch_test/
Dall_cmd_unittest.cpp43 std::vector<std::string> headInfos = Updater::Utils::SplitString(headerBuffer); in FillTransferHeader()
72 bool rc = Updater::Utils::ReadFileToString(fd, contents); in GetTransferContents()
118 std::vector<std::string> transferLines = Updater::Utils::SplitString(transferContents, "\n");
176Utils::MkdirRecursive(TransferManager::GetTransferManagerInstance()->GetGlobalParams()->storeBase,…
199Utils::MkdirRecursive(TransferManager::GetTransferManagerInstance()->GetGlobalParams()->storeBase,…
/base/security/access_token/services/accesstokenmanager/main/cpp/src/database/
Dsqlite_storage.cpp105 OHOS::Utils::UniqueWriteGuard<OHOS::Utils::RWLock> lock(this->rwLock_); in Add()
134 OHOS::Utils::UniqueWriteGuard<OHOS::Utils::RWLock> lock(this->rwLock_); in Remove()
147 OHOS::Utils::UniqueWriteGuard<OHOS::Utils::RWLock> lock(this->rwLock_); in Modify()
164 OHOS::Utils::UniqueWriteGuard<OHOS::Utils::RWLock> lock(this->rwLock_); in Find()
180 OHOS::Utils::UniqueWriteGuard<OHOS::Utils::RWLock> lock(this->rwLock_); in RefreshAll()

12345