MCPcopy Create free account
hub / github.com/baidu/openrasp / write_map_to_array

Method write_map_to_array

agent/php7/utils/json_reader.cc:243–256  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

241}
242
243void JsonReader::write_map_to_array(const std::vector<std::string> &keys, const std::string fkey, const std::string skey,
244 const std::map<std::string, std::string> &value)
245{
246 json::json_pointer ptr = json::json_pointer(to_json_pointer(keys));
247 json array = json::array();
248 for (auto iter : value)
249 {
250 json item;
251 item[fkey] = iter.first;
252 item[skey] = iter.second;
253 array.push_back(item);
254 }
255 j[ptr] = array;
256}
257
258size_t JsonReader::get_array_size(const std::vector<std::string> &keys)
259{

Callers 3

logMethod · 0.45
openrasp_errorFunction · 0.45
get_multipart_strMethod · 0.45

Calls 1

to_json_pointerFunction · 0.70

Tested by

no test coverage detected