2022-05-04 09:22:06 +00:00
|
|
|
#pragma once
|
2023-04-01 03:18:41 +00:00
|
|
|
///@file
|
2022-05-04 09:22:06 +00:00
|
|
|
|
|
|
|
#include <nlohmann/json.hpp>
|
|
|
|
|
|
|
|
namespace nix {
|
|
|
|
|
|
|
|
const nlohmann::json * get(const nlohmann::json & map, const std::string & key)
|
|
|
|
{
|
|
|
|
auto i = map.find(key);
|
|
|
|
if (i == map.end()) return nullptr;
|
|
|
|
return &*i;
|
|
|
|
}
|
|
|
|
|
|
|
|
nlohmann::json * get(nlohmann::json & map, const std::string & key)
|
|
|
|
{
|
|
|
|
auto i = map.find(key);
|
|
|
|
if (i == map.end()) return nullptr;
|
|
|
|
return &*i;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|