Go to the source code of this file.
Functions | |
const nlohmann::json * | nix::get (const nlohmann::json &map, const std::string &key) |
nlohmann::json * | nix::get (nlohmann::json &map, const std::string &key) |
const nlohmann::json & | nix::valueAt (const nlohmann::json::object_t &map, const std::string &key) |
std::optional< nlohmann::json > | nix::optionalValueAt (const nlohmann::json::object_t &map, const std::string &key) |
const nlohmann::json * | nix::getNullable (const nlohmann::json &value) |
const nlohmann::json::object_t & | nix::getObject (const nlohmann::json &value) |
const nlohmann::json::array_t & | nix::getArray (const nlohmann::json &value) |
const nlohmann::json::string_t & | nix::getString (const nlohmann::json &value) |
const nlohmann::json::number_integer_t & | nix::getInteger (const nlohmann::json &value) |
const nlohmann::json::boolean_t & | nix::getBoolean (const nlohmann::json &value) |
Strings | nix::getStringList (const nlohmann::json &value) |
StringMap | nix::getStringMap (const nlohmann::json &value) |
StringSet | nix::getStringSet (const nlohmann::json &value) |
const nlohmann::json * nix::getNullable | ( | const nlohmann::json & | value | ) |
Downcast the json object, failing with a nice error if the conversion fails. See https://json.nlohmann.me/features/types/
const nlohmann::json & nix::valueAt | ( | const nlohmann::json::object_t & | map, |
const std::string & | key ) |
Get the value of a json object at a key safely, failing with a nice error if the key does not exist.
Use instead of nlohmann::json::at() to avoid ugly exceptions.