3#include <md/object.hpp>
15[[nodiscard]]
inline bool contains(
const Object& o,
const std::string_view key) {
16 return o.contains(key);
20[[nodiscard]]
inline Value* find_ptr(Object& o,
const std::string_view key) {
21 return o.find_ptr(key);
24[[nodiscard]]
inline const Value* find_ptr(
const Object& o,
const std::string_view key) {
25 return o.find_ptr(key);
29inline Value& require(Object& o,
const std::string_view key) {
30 return o.require(key);
33inline const Value& require(
const Object& o,
const std::string_view key) {
34 return o.require(key);
38inline std::string& require_string(Object& o,
const std::string_view key) {
39 return o.require_string(key);
42inline const std::string& require_string(
const Object& o,
const std::string_view key) {
43 return o.require_string(key);
47inline Array& require_array(Object& o,
const std::string_view key) {
48 return o.require_array(key);
51inline const Array& require_array(
const Object& o,
const std::string_view key) {
52 return o.require_array(key);
56inline Object& require_object(Object& o,
const std::string_view key) {
60inline const Object& require_object(
const Object& o,
const std::string_view key) {
65[[nodiscard]]
inline const std::string* get_string_if(
const Object& o,
const std::string_view key) {
66 return o.get_string_if(key);
69[[nodiscard]]
inline const Array* get_array_if(
const Object& o,
const std::string_view key) {
70 return o.get_array_if(key);
73[[nodiscard]]
inline const Object* get_object_if(
const Object& o,
const std::string_view key) {
78inline void merge(Object& dst,
const Object& src) {
const Object * get_object_if(const std::string_view key) const
Pointer to the nested object at key, or nullptr if absent or wrong type.
Definition object.hpp:295
Object & require_object(const std::string_view key)
Return the nested object at key; throws on missing key or type mismatch.
Definition object.hpp:264