Lines Matching defs:json
24 #include "nlohmann/json.hpp"
37 // The json value of accessibilityAbility type
45 // The json value of capabilities
60 static bool GetStringFromJson(const nlohmann::json &json, const std::string &key, std::string &value)
63 if (!json.is_object()) {
64 HILOG_ERROR("json is not object.");
67 if (json.find(key) != json.end() && json.at(key).is_string()) {
69 value = json.at(key).get<std::string>();
74 static bool GetStringVecFromJson(const nlohmann::json &json, const std::string &key,
78 if (!json.is_object()) {
79 HILOG_ERROR("json is not object.");
82 if (json.find(key) != json.end() && json.at(key).is_array()) {
84 value = json.at(key).get<std::vector<std::string>>();
89 static bool GetBoolFromJson(const nlohmann::json &json, const std::string &key, bool &value)
92 if (!json.is_object()) {
93 HILOG_ERROR("json is not object.");
96 if (json.find(key) != json.end() && json.at(key).is_boolean()) {
98 value = json.at(key).get<bool>();
187 if (!nlohmann::json::accept(profileInfos[0])) {
188 HILOG_ERROR("profileInfos is not json format.");
191 nlohmann::json sourceJson = nlohmann::json::parse(profileInfos[0]);
196 HILOG_ERROR("Get accessibilityCapabilities from json failed.");
204 HILOG_ERROR("Get accessibilityAbilityTypes from json failed.");
211 HILOG_ERROR("Get accessibilityCapabilityRationale from json failed.");
217 HILOG_ERROR("Get settingsAbility from json failed.");
223 HILOG_ERROR("Get isImportant from json failed.");
229 HILOG_ERROR("Get needHide from json failed.");