Lines Matching refs:filePath
51 bool JsonUtils::LoadJsonValueFromFile(nlohmann::json& jsonValue, const std::string& filePath)
54 if (!GetFileContent(filePath, content)) {
55 STANDBYSERVICE_LOGE("failed to load content from %{public}s", filePath.c_str());
59 STANDBYSERVICE_LOGE("content of %{public}s is empty", filePath.c_str());
64 STANDBYSERVICE_LOGE("failed to parse content from %{public}s", filePath.c_str());
68 STANDBYSERVICE_LOGE("the content of %{public}s is not an object ", filePath.c_str());
74 bool JsonUtils::DumpJsonValueToFile(const nlohmann::json& jsonValue, const std::string& filePath)
76 if (!CreateNodeFile(filePath)) {
82 if (!GetRealPath(filePath, realPath)) {
83 STANDBYSERVICE_LOGE("get real file path: %{public}s failed", filePath.c_str());
88 STANDBYSERVICE_LOGE("open file: %{public}s failed.", filePath.c_str());
96 bool JsonUtils::CreateNodeFile(const std::string &filePath)
98 if (access(filePath.c_str(), F_OK) == ERR_OK) {
99 STANDBYSERVICE_LOGD("the standby service config file: %{public}s already exists.", filePath.c_str());
103 if (!GetRealPath(filePath, fullpath)) {
104 STANDBYSERVICE_LOGD("the standby service config file: %{public}s not exists.", filePath.c_str());
105 fullpath = filePath;
193 bool JsonUtils::GetFileContent(const std::string& filePath, std::string& content)
196 if (!GetRealPath(filePath, fullPath)) {