Lines Matching defs:content
33 bool JsonUtils::LoadJsonValueFromContent(nlohmann::json& jsonValue, const std::string& content)
35 if (content.empty()) {
36 STANDBYSERVICE_LOGE("content is empty");
39 jsonValue = nlohmann::json::parse(content, nullptr, false);
41 STANDBYSERVICE_LOGE("failed to parse content");
45 STANDBYSERVICE_LOGE("the content is not an object");
53 std::string content;
54 if (!GetFileContent(filePath, content)) {
55 STANDBYSERVICE_LOGE("failed to load content from %{public}s", filePath.c_str());
58 if (content.empty()) {
59 STANDBYSERVICE_LOGE("content of %{public}s is empty", filePath.c_str());
62 jsonValue = nlohmann::json::parse(content, nullptr, false);
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());
193 bool JsonUtils::GetFileContent(const std::string& filePath, std::string& content)
206 content = ss.str();