Lines Matching refs:jsonValue

33 bool JsonUtils::LoadJsonValueFromContent(nlohmann::json& jsonValue, const std::string& content)  in LoadJsonValueFromContent()  argument
39 jsonValue = nlohmann::json::parse(content, nullptr, false); in LoadJsonValueFromContent()
40 if (jsonValue.is_discarded()) { in LoadJsonValueFromContent()
44 if (!jsonValue.is_object()) { in LoadJsonValueFromContent()
51 bool JsonUtils::LoadJsonValueFromFile(nlohmann::json& jsonValue, const std::string& filePath) in LoadJsonValueFromFile() argument
62 jsonValue = nlohmann::json::parse(content, nullptr, false); in LoadJsonValueFromFile()
63 if (jsonValue.is_discarded()) { in LoadJsonValueFromFile()
67 if (!jsonValue.is_object()) { in LoadJsonValueFromFile()
74 bool JsonUtils::DumpJsonValueToFile(const nlohmann::json& jsonValue, const std::string& filePath) in DumpJsonValueToFile() argument
91 fout << jsonValue.dump(JSON_FORMAT).c_str() << std::endl; in DumpJsonValueToFile()
116 bool JsonUtils::GetInt32FromJsonValue(const nlohmann::json& jsonValue, const std::string& key, int3… in GetInt32FromJsonValue() argument
118 if (jsonValue.empty() || key.empty()) { in GetInt32FromJsonValue()
121 if (jsonValue.contains(key) == 0 || !jsonValue.at(key).is_number_integer()) { in GetInt32FromJsonValue()
124 value = jsonValue.at(key).get<int32_t>(); in GetInt32FromJsonValue()
128 bool JsonUtils::GetBoolFromJsonValue(const nlohmann::json& jsonValue, const std::string& key, bool&… in GetBoolFromJsonValue() argument
130 if (jsonValue.empty() || key.empty()) { in GetBoolFromJsonValue()
133 if (jsonValue.contains(key) == 0 || !jsonValue.at(key).is_boolean()) { in GetBoolFromJsonValue()
136 value = jsonValue.at(key).get<bool>(); in GetBoolFromJsonValue()
140 bool JsonUtils::GetStringFromJsonValue(const nlohmann::json& jsonValue, const std::string& key, std… in GetStringFromJsonValue() argument
142 if (jsonValue.empty() || key.empty()) { in GetStringFromJsonValue()
145 if (jsonValue.contains(key) == 0 || !jsonValue.at(key).is_string()) { in GetStringFromJsonValue()
148 value = jsonValue.at(key).get<std::string>(); in GetStringFromJsonValue()
152 bool JsonUtils::GetObjFromJsonValue(const nlohmann::json& jsonValue, const std::string& key, nlohma… in GetObjFromJsonValue() argument
154 if (jsonValue.empty() || key.empty()) { in GetObjFromJsonValue()
157 if (jsonValue.contains(key) == 0 || !jsonValue.at(key).is_object()) { in GetObjFromJsonValue()
160 value = jsonValue.at(key); in GetObjFromJsonValue()
164 bool JsonUtils::GetArrayFromJsonValue(const nlohmann::json& jsonValue, const std::string& key, nloh… in GetArrayFromJsonValue() argument
166 if (jsonValue.empty() || key.empty()) { in GetArrayFromJsonValue()
169 if (jsonValue.contains(key) == 0 || !jsonValue.at(key).is_array()) { in GetArrayFromJsonValue()
172 value = jsonValue.at(key); in GetArrayFromJsonValue()
176 bool JsonUtils::GetStrArrFromJsonValue(const nlohmann::json& jsonValue, const std::string& key, in GetStrArrFromJsonValue() argument
180 if (!JsonUtils::GetArrayFromJsonValue(jsonValue, key, strArrayValue)) { in GetStrArrFromJsonValue()