Home
last modified time | relevance | path

Searched refs:filePath (Results 1 – 25 of 163) sorted by relevance

1234567

/base/sensors/miscdevice/utils/src/
Dfile_utils.cpp33 std::string ReadJsonFile(const std::string &filePath) in ReadJsonFile() argument
35 if (filePath.empty()) { in ReadJsonFile()
40 if (realpath(filePath.c_str(), realPath) == nullptr) { in ReadJsonFile()
52 if (!IsFileExists(filePath)) { in ReadJsonFile()
56 if (!CheckFileSize(filePath)) { in ReadJsonFile()
63 int32_t GetFileSize(const std::string& filePath) in GetFileSize() argument
66 if (stat(filePath.c_str(), &statbuf) != 0) { in GetFileSize()
73 bool CheckFileDir(const std::string& filePath, const std::string& dir) in CheckFileDir() argument
75 if (filePath.compare(0, CONFIG_DIR.size(), CONFIG_DIR) != 0) { in CheckFileDir()
82 bool CheckFileSize(const std::string& filePath) in CheckFileSize() argument
[all …]
/base/customization/config_policy/test/unittest/
Dconfig_policy_utils_test.cpp32 char *filePath = nullptr; in TestGetCfgFile() local
34 filePath = cfgFiles->paths[i]; in TestGetCfgFile()
35 if (filePath && *filePath != '\0') { in TestGetCfgFile()
36 std::cout << "type: " << type << ", filePath: " << filePath << std::endl; in TestGetCfgFile()
42 filePath = GetOneCfgFileEx(testPathSuffix, buf, MAX_PATH_LEN, type, extra); in TestGetCfgFile()
43 if (filePath && *filePath != '\0') { in TestGetCfgFile()
44 std::cout << "type: " << type << ", one filePath: " << filePath << std::endl; in TestGetCfgFile()
110 char *filePath = cfgDir->paths[i]; variable
111 if (filePath && *filePath != '\0') {
112 std::cout << "filePath: " << filePath << std::endl;
/base/sensors/miscdevice/utils/include/
Dfile_utils.h24 std::string ReadJsonFile(const std::string &filePath);
25 std::string ReadFile(const std::string &filePath);
26 bool CheckFileDir(const std::string& filePath, const std::string& dir);
27 bool CheckFileExtendName(const std::string& filePath, const std::string& checkExtension);
28 bool CheckFileSize(const std::string& filePath);
30 int32_t GetFileSize(const std::string& filePath);
/base/msdp/device_status/libs/src/
Ddevicestatus_data_parse.cpp86 std::string DeviceStatusDataParse::ReadJsonFile(const std::string &filePath) in ReadJsonFile() argument
88 if (filePath.empty()) { in ReadJsonFile()
93 if (realpath(filePath.c_str(), realPath) == nullptr) { in ReadJsonFile()
105 if (!IsFileExists(filePath)) { in ReadJsonFile()
109 if (CheckFileSize(filePath) == INVALID_FILE_SIZE) { in ReadJsonFile()
116 int32_t DeviceStatusDataParse::GetFileSize(const std::string& filePath) in GetFileSize() argument
119 if (stat(filePath.c_str(), &statbuf) != 0) { in GetFileSize()
126 bool DeviceStatusDataParse::CheckFileDir(const std::string& filePath, const std::string& dir) in CheckFileDir() argument
128 if (filePath.compare(0, MSDP_DATA_DIR.size(), MSDP_DATA_DIR) != 0) { in CheckFileDir()
135 int32_t DeviceStatusDataParse::CheckFileSize(const std::string& filePath) in CheckFileSize() argument
[all …]
/base/msdp/device_status/libs/include/
Ddevicestatus_data_parse.h52 int32_t GetFileSize(const std::string& filePath);
53 bool CheckFileDir(const std::string& filePath, const std::string& dir);
54 int32_t CheckFileSize(const std::string& filePath);
55 bool CheckFileExtendName(const std::string& filePath, const std::string& checkExtension);
57 std::string ReadFile(const std::string &filePath);
58 std::string ReadJsonFile(const std::string &filePath);
/base/security/huks/test/unittest/huks_standard_test/interface_inner_test/sdk_test/src/
Dhks_test_file_operator.c95 char filePath[PATH_MAX + 1] = {0}; in FileRead() local
96 (void)realpath(fileName, filePath); in FileRead()
97 if (strstr(filePath, "../") != NULL) { in FileRead()
98 HKS_TEST_LOG_E("invalid filePath, path %s", filePath); in FileRead()
102 FILE *fp = fopen(filePath, "rb"); in FileRead()
136 char filePath[PATH_MAX + 1] = {0}; in FileWrite() local
137 if (memcpy_s(filePath, sizeof(filePath) - 1, fileName, strlen(fileName)) != EOK) { in FileWrite()
140 (void)realpath(fileName, filePath); in FileWrite()
141 if (strstr(filePath, "../") != NULL) { in FileWrite()
142 HKS_TEST_LOG_E("invalid filePath, path %s", filePath); in FileWrite()
[all …]
/base/hiviewdfx/faultloggerd/test/systemtest/include/
Dfaultloggerd_system_test.h63 … static int CheckKeywords(std::string& filePath, std::string *keywords, int length, int minRegIdx);
64 static int CheckCountNum(std::string& filePath, std::string& pid, std::string& errorCMD);
65 static int CheckCountNumAbort(std::string& filePath, std::string& pid);
66 static int CheckCountNumPCZero(std::string& filePath, std::string& pid);
67 static int CheckStacktraceCountNum(std::string& filePath, std::string& pid);
68 static int CheckCountNumMultiThread(std::string& filePath, std::string& pid);
69 static int CheckCountNumOverStack(std::string& filePath, std::string& pid);
70 … static int CheckCountNumStackTop(std::string& filePath, std::string& pid, std::string& ErrorCMD);
72 static int CheckCountNumKill11(std::string& filePath, std::string& pid);
/base/request/request/test/unittest/common/napi/requestTest/
DRequestJsunit.test.js60 filePath: `/data/storage/el2/base/haps/entry/files/`, property
65 downloadConfig.filePath += 'SUB_REQUEST_DOWNLOAD_API_DOWNLOADTASK_ON_0001.txt'
111 filePath: `/data/storage/el2/base/haps/entry/files/`, property
116 downloadConfig.filePath += 'SUB_REQUEST_DOWNLOAD_API_DOWNLOADTASK_ON_0002.txt'
155 filePath: `/data/storage/el2/base/haps/entry/files/`, property
160 downloadConfig.filePath += 'SUB_REQUEST_DOWNLOAD_API_DOWNLOADTASK_ON_0003.txt'
205 filePath: `/data/storage/el2/base/haps/entry/files/`, property
210 downloadConfig.filePath += 'SUB_REQUEST_DOWNLOAD_API_DOWNLOADTASK_ON_0004.txt'
254 filePath: `/data/storage/el2/base/haps/entry/files/`, property
259 downloadConfig.filePath += 'SUB_REQUEST_DOWNLOAD_API_DOWNLOADTASK_ON_0005.txt'
[all …]
/base/request/request/upload/frameworks/libs/src/
Dobtain_file.cpp93 bool ObtainFile::IsValidPath(const std::string &filePath) in IsValidPath() argument
96 if (filePath.length() > PATH_MAX || realpath(filePath.c_str(), resolvedPath) == nullptr || in IsValidPath()
97 strncmp(resolvedPath, filePath.c_str(), filePath.length()) != 0) { in IsValidPath()
123 std::string filePath = fileAdapter_->InternalGetFilePath(context); in GetInternalFile() local
124 if (filePath.empty()) { in GetInternalFile()
128 filePath += "/" + fileName; in GetInternalFile()
129 if (!IsValidPath(filePath)) { in GetInternalFile()
132 FILE *filePtr = fopen(filePath.c_str(), "r"); in GetInternalFile()
/base/hiviewdfx/faultloggerd/test/systemtest/src/
Dfaultloggerd_system_test.cpp231 std::string filePath; in GetLogFileName() local
236 filePath = file; in GetLogFileName()
239 return filePath; in GetLogFileName()
250 std::string filePath = GetLogFileName(prefix); in GetfileNamePrefix() local
251 return filePath + " " + pid; in GetfileNamePrefix()
262 std::string filePath = GetLogFileName(prefix); in GetstackfileNamePrefix() local
263 return filePath + " " + pid; in GetstackfileNamePrefix()
266 int FaultLoggerdSystemTest::CheckKeywords(std::string& filePath, std::string *keywords, int length,… in CheckKeywords() argument
269 file.open(filePath.c_str(), ios::in); in CheckKeywords()
270 long lines = FaultLoggerdSystemTest::CountLines(filePath); in CheckKeywords()
[all …]
/base/hiviewdfx/blackbox/
Dblackbox_detector.c18 int UploadEventByFile(const char *filePath) in UploadEventByFile() argument
20 if (filePath == NULL) { in UploadEventByFile()
21 BBOX_PRINT_ERR("filePath: %p\n", filePath); in UploadEventByFile()
/base/hiviewdfx/hiappevent/frameworks/native/libhiappevent/utility/
Dfile_util.cpp91 std::string filePath = GetFilePathByDir(dir, dirInfo->d_name); in ForceRemoveDirectory() local
92 if (!ForceRemoveDirectory(filePath)) { in ForceRemoveDirectory()
119 std::string filePath = GetFilePathByDir(dir, ent->d_name); in GetDirFiles() local
120 if (IsFile(filePath)) { // do not process subdirectory in GetDirFiles()
121 files.push_back(filePath); in GetDirFiles()
177 std::string filePath = dir; in GetFilePathByDir() local
178 if (filePath.back() != '/') { in GetFilePathByDir()
179 filePath.push_back(PATH_DELIMITER); in GetFilePathByDir()
181 filePath.append(fileName); in GetFilePathByDir()
182 return filePath; in GetFilePathByDir()
/base/security/huks/test/unittest/huks_lite_test/common/
Dhks_test_file_operator.c105 char filePath[PATH_MAX + 1] = {0}; in FileRead() local
106 (void)realpath(fileName, filePath); in FileRead()
107 if (strstr(filePath, "../") != NULL) { in FileRead()
108 HKS_TEST_LOG_E("invalid filePath, path %s", filePath); in FileRead()
112 FILE *fp = fopen(filePath, "rb"); in FileRead()
146 char filePath[PATH_MAX + 1] = {0}; in FileWrite() local
147 if (memcpy_s(filePath, sizeof(filePath) - 1, fileName, strlen(fileName)) != EOK) { in FileWrite()
150 (void)realpath(fileName, filePath); in FileWrite()
151 if (strstr(filePath, "../") != NULL) { in FileWrite()
152 HKS_TEST_LOG_E("invalid filePath, path %s", filePath); in FileWrite()
[all …]
/base/security/appverify/interfaces/innerkits/appverify/test/unittest/src/
Drandom_access_file_test.cpp71 std::string filePath = "./test_hapverify.zip"; variable
73 int sumLen = CreatTestZipFile(filePath, si0);
75 bool initRet = hapTestFile1.Init(filePath);
88 filePath = "./test_hapverify1.zip";
90 initRet = nullTestFile.Init(filePath);
/base/security/appverify/interfaces/innerkits/appverify/src/interfaces/
Dhap_verify.cpp78 int HapVerify(const std::string& filePath, HapVerifyResult& hapVerifyResult) in HapVerify() argument
84 return hapVerifyV2.Verify(filePath, hapVerifyResult); in HapVerify()
87 int ParseHapProfile(const std::string& filePath, HapVerifyResult& hapVerifyV1Result) in ParseHapProfile() argument
90 return hapVerifyV2.ParseHapProfile(filePath, hapVerifyV1Result); in ParseHapProfile()
/base/update/updater/test/fuzztest/UpdaterStartUpdaterProc_fuzzer/
DUpdaterStartUpdaterProc_fuzzer.cpp107 std::string filePath; in CreatePackageZip() local
111 filePath = TEST_PATH_TO; in CreatePackageZip()
112 filePath += fstabFile[i].c_str(); in CreatePackageZip()
113 comp[i].filePath = strdup(filePath.c_str()); in CreatePackageZip()
116 ret = BuildFileDigest(*comp[i].digest, sizeof(comp[i].digest), filePath); in CreatePackageZip()
117 comp[i].size = GetFileSize(filePath); in CreatePackageZip()
123 filePath.clear(); in CreatePackageZip()
134 free(comp[i].filePath); in CreatePackageZip()
/base/hiviewdfx/hiview/adapter/utility/
Dfile_util.cpp40 bool LoadStringFromFile(const string& filePath, string& content) in LoadStringFromFile() argument
42 ifstream file(filePath.c_str()); in LoadStringFromFile()
59 bool LoadBufferFromNodeFile(const string& filePath, vector<char>& content) in LoadBufferFromNodeFile() argument
62 if (!PathToRealPath(filePath, realPath)) { in LoadBufferFromNodeFile()
91 bool LoadBufferFromFile(const std::string& filePath, std::vector<char>& content) in LoadBufferFromFile() argument
94 file.open(filePath.c_str(), ios::in | ios::binary); in LoadBufferFromFile()
107 return LoadBufferFromNodeFile(filePath, content); in LoadBufferFromFile()
125 bool SaveStringToFile(const std::string& filePath, const std::string& content, bool truncated) in SaveStringToFile() argument
133 file.open(filePath.c_str(), ios::out | ios::trunc); in SaveStringToFile()
135 file.open(filePath.c_str(), ios::out | ios::app); in SaveStringToFile()
[all …]
/base/hiviewdfx/hidumper_lite/
Dhidumper.c52 char filePath[PATH_MAX_LEN]; member
178 if (strncpy_s(param.filePath, sizeof(param.filePath), in ParameterMatching()
179 argv[TWO_OF_ARGC_PARAMETERS], sizeof(param.filePath) - 1) != EOK) { in ParameterMatching()
193 if (strncpy_s(param.filePath, sizeof(param.filePath), in ParameterMatching()
194 argv[FOUR_OF_ARGC_PARAMETERS], sizeof(param.filePath) - 1) != EOK) { in ParameterMatching()
/base/hiviewdfx/hiview/utility/common_utils/
Dcalc_fingerprint.cpp59 int CalcFingerprint::CalcFileSha(const string& filePath, char *hash, size_t len) in CalcFileSha() argument
61 if (filePath.empty() || hash == nullptr || !FileUtil::IsLegalPath(filePath)) { in CalcFileSha()
65 fp = fopen(filePath.c_str(), "rb"); in CalcFileSha()
/base/security/appverify/interfaces/innerkits/appverify_lite/src/
Dapp_file.c29 int InitVerify(FileRead *file, const char *filePath, int *handle) in InitVerify() argument
31 if (handle == NULL || file == NULL || filePath == NULL) { in InitVerify()
41 if ((strlen(filePath) > PATH_MAX) || (NULL == realpath(filePath, path))) { in InitVerify()
/base/update/updater/test/unittest/updater_binary/
Dupdater_binary_unittest.cpp149 free(comp[i].filePath); in CreatePackageBin()
182 std::string filePath = TEST_PATH_FROM; in BuildCompnentInfo() local
187 filePath += scriptPath; in BuildCompnentInfo()
188 comp.filePath = strdup(filePath.c_str()); in BuildCompnentInfo()
190 auto ret = BuildFileDigest(*comp.digest, sizeof(comp.digest), filePath); in BuildCompnentInfo()
192 comp.size = GetFileSize(filePath); in BuildCompnentInfo()
198 filePath.clear(); in BuildCompnentInfo()
/base/location/services/location_locator/locator/source/
Dlocation_config_manager.cpp95 … std::string filePath = LOCATION_DIR + SWITCH_CONFIG_NAME + "_" + std::to_string(userId) + ".conf"; in GetLocationSwitchConfigPath() local
96 return filePath; in GetLocationSwitchConfigPath()
106 std::string filePath; in GetPrivacyTypeConfigPath() local
109 filePath = "others_"; in GetPrivacyTypeConfigPath()
113 filePath = "startup_"; in GetPrivacyTypeConfigPath()
117 filePath = "core_location_"; in GetPrivacyTypeConfigPath()
121 filePath = ""; in GetPrivacyTypeConfigPath()
125 return LOCATION_DIR + PRIVACY_CONFIG_NAME + "_" + filePath + std::to_string(userId) + ".conf"; in GetPrivacyTypeConfigPath()
/base/security/appverify/interfaces/innerkits/appverify/include/interfaces/
Dhap_verify.h28 DLL_EXPORT int HapVerify(const std::string& filePath, HapVerifyResult& hapVerifyResult);
29 DLL_EXPORT int ParseHapProfile(const std::string& filePath, HapVerifyResult& hapVerifyV1Result);
/base/hiviewdfx/hiappevent/frameworks/native/libhiappevent/
Dhiappevent_write.cpp62 bool WriteEventToFile(const std::string& filePath, const std::string& event) in WriteEventToFile() argument
65 return FileUtil::SaveStringToFile(filePath, event); in WriteEventToFile()
106 std::string filePath = FileUtil::GetFilePathByDir(dirPath, GetStorageFileName()); in WriteEvent() local
108 if (WriteEventToFile(filePath, event)) { in WriteEvent()
/base/hiviewdfx/faultloggerd/utils/
Dfile_ex.cpp33 bool LoadStringFromFile(const string& filePath, string& content) in LoadStringFromFile() argument
35 ifstream file(filePath.c_str()); in LoadStringFromFile()

1234567