Lines Matching defs:key

59 void EmplaceSafeString(llvm::json::Object &obj, llvm::StringRef key,
62 obj.try_emplace(key, str.str());
64 obj.try_emplace(key, llvm::json::fixUTF8(str));
73 // Gets a string from a JSON object using the key, or returns an empty string.
74 llvm::StringRef GetString(const llvm::json::Object &obj, llvm::StringRef key,
76 if (std::optional<llvm::StringRef> value = obj.getString(key))
81 llvm::StringRef GetString(const llvm::json::Object *obj, llvm::StringRef key,
85 return GetString(*obj, key, defaultValue);
88 // Gets an unsigned integer from a JSON object using the key, or returns the
90 uint64_t GetUnsigned(const llvm::json::Object &obj, llvm::StringRef key,
92 if (auto value = obj.getInteger(key))
97 uint64_t GetUnsigned(const llvm::json::Object *obj, llvm::StringRef key,
101 return GetUnsigned(*obj, key, fail_value);
104 bool GetBoolean(const llvm::json::Object &obj, llvm::StringRef key,
106 if (auto value = obj.getBoolean(key))
108 if (auto value = obj.getInteger(key))
113 bool GetBoolean(const llvm::json::Object *obj, llvm::StringRef key,
117 return GetBoolean(*obj, key, fail_value);
120 int64_t GetSigned(const llvm::json::Object &obj, llvm::StringRef key,
122 if (auto value = obj.getInteger(key))
127 int64_t GetSigned(const llvm::json::Object *obj, llvm::StringRef key,
131 return GetSigned(*obj, key, fail_value);
134 bool ObjectContainsKey(const llvm::json::Object &obj, llvm::StringRef key) {
135 return obj.find(key) != obj.end();
155 llvm::StringRef key) {
157 const auto *json_array = obj->getArray(key);
179 GetStringMap(const llvm::json::Object &obj, llvm::StringRef key) {
181 const auto *const json_object = obj.getObject(key);
185 for (const auto &[key, value] : *json_object) {
188 strs.emplace(key.str(), value.getAsString()->str());
192 strs.emplace(key.str(), llvm::to_string(value));
1462 llvm::StringRef key = envs.GetNameAtIndex(index);
1465 if (!key.empty())
1466 env_json.try_emplace(key, value);
1476 // Array and dictionary value will return as <key, JSON string> pairs
1478 const char *key, llvm::json::Object &out) {
1479 lldb::SBStructuredData value = data.GetValueForKey(key);
1480 std::string key_utf8 = llvm::json::fixUTF8(key);
1481 if (llvm::StringRef(key) == "modules")
1532 const char *key = keys.GetStringAtIndex(i);
1533 FilterAndGetValueForKey(statistics, key, stats_body);