Fix typos
[babeltrace.git] / src / cpp-common / bt2 / value.hpp
index 370206725762acefd7e10ddef350823b3cb1d23f..81c033673f8b70d72c056e7dc5c0c4ed2094d54e 100644 (file)
 
 #include "common/assert.h"
 #include "common/common.h"
-#include "cpp-common/optional.hpp"
-#include "cpp-common/string_view.hpp"
+#include "cpp-common/bt2c/c-string-view.hpp"
 
 #include "borrowed-object-iterator.hpp"
 #include "borrowed-object.hpp"
 #include "exc.hpp"
 #include "internal/utils.hpp"
+#include "optional-borrowed-object.hpp"
+#include "raw-value-proxy.hpp"
 #include "shared-object.hpp"
 
 namespace bt2 {
@@ -81,6 +82,31 @@ enum class ValueType
     MAP = BT_VALUE_TYPE_MAP,
 };
 
+template <typename ValueObjT>
+class CommonValueRawValueProxy final
+{
+public:
+    explicit CommonValueRawValueProxy(const ValueObjT obj) : _mObj {obj}
+    {
+    }
+
+    CommonValueRawValueProxy& operator=(bool rawVal) noexcept;
+    CommonValueRawValueProxy& operator=(std::int64_t rawVal) noexcept;
+    CommonValueRawValueProxy& operator=(std::uint64_t rawVal) noexcept;
+    CommonValueRawValueProxy& operator=(double rawVal) noexcept;
+    CommonValueRawValueProxy& operator=(const char *rawVal);
+    CommonValueRawValueProxy& operator=(const std::string& rawVal);
+    operator bool() const noexcept;
+    operator std::int64_t() const noexcept;
+    operator std::uint64_t() const noexcept;
+    operator double() const noexcept;
+    operator const char *() const noexcept;
+    operator bt2c::CStringView() const noexcept;
+
+private:
+    ValueObjT _mObj;
+};
+
 template <typename LibObjT>
 class CommonValue : public BorrowedObject<LibObjT>
 {
@@ -88,13 +114,13 @@ private:
     using typename BorrowedObject<LibObjT>::_ThisBorrowedObject;
 
 protected:
-    using typename BorrowedObject<LibObjT>::_LibObjPtr;
     using _ThisCommonValue = CommonValue<LibObjT>;
 
 public:
+    using typename BorrowedObject<LibObjT>::LibObjPtr;
     using Shared = SharedValue<CommonValue<LibObjT>, LibObjT>;
 
-    explicit CommonValue(const _LibObjPtr libObjPtr) noexcept : _ThisBorrowedObject {libObjPtr}
+    explicit CommonValue(const LibObjPtr libObjPtr) noexcept : _ThisBorrowedObject {libObjPtr}
     {
     }
 
@@ -104,7 +130,7 @@ public:
     }
 
     template <typename OtherLibObjT>
-    _ThisCommonValue& operator=(const CommonValue<OtherLibObjT> val) noexcept
+    _ThisCommonValue operator=(const CommonValue<OtherLibObjT> val) noexcept
     {
         _ThisBorrowedObject::operator=(val);
         return *this;
@@ -177,6 +203,68 @@ public:
         return !(*this == other);
     }
 
+    CommonValueRawValueProxy<CommonValue> operator*() const noexcept
+    {
+        return CommonValueRawValueProxy<CommonValue> {*this};
+    }
+
+    std::uint64_t arrayLength() const noexcept
+    {
+        return this->asArray().length();
+    }
+
+    bool arrayIsEmpty() const noexcept
+    {
+        return this->asArray().isEmpty();
+    }
+
+    CommonValue<LibObjT> operator[](const std::uint64_t index) const noexcept
+    {
+        return this->asArray()[index];
+    }
+
+    template <typename T>
+    void append(T&& elem) const
+    {
+        this->asArray().append(std::forward<T>(elem));
+    }
+
+    CommonArrayValue<bt_value> appendEmptyArray() const;
+    CommonMapValue<bt_value> appendEmptyMap() const;
+
+    std::uint64_t mapLength() const noexcept
+    {
+        return this->asMap().length();
+    }
+
+    bool mapIsEmpty() const noexcept
+    {
+        return this->asMap().isEmpty();
+    }
+
+    template <typename KeyT>
+    OptionalBorrowedObject<CommonValue<LibObjT>> operator[](KeyT&& key) const noexcept
+    {
+        return this->asMap()[std::forward<KeyT>(key)];
+    }
+
+    template <typename KeyT>
+    bool hasEntry(KeyT&& key) const noexcept
+    {
+        return this->asMap().hasEntry(std::forward<KeyT>(key));
+    }
+
+    template <typename KeyT, typename ValT>
+    void insert(KeyT&& key, ValT&& val) const
+    {
+        this->asMap().insert(std::forward<KeyT>(key), std::forward<ValT>(val));
+    }
+
+    CommonArrayValue<bt_value> insertEmptyArray(const char *key) const;
+    CommonArrayValue<bt_value> insertEmptyArray(const std::string& key) const;
+    CommonMapValue<bt_value> insertEmptyMap(const char *key) const;
+    CommonMapValue<bt_value> insertEmptyMap(const std::string& key) const;
+
     Shared shared() const noexcept
     {
         return Shared::createWithRef(*this);
@@ -207,6 +295,90 @@ protected:
 using Value = CommonValue<bt_value>;
 using ConstValue = CommonValue<const bt_value>;
 
+template <typename ValueObjT>
+CommonValueRawValueProxy<ValueObjT>&
+CommonValueRawValueProxy<ValueObjT>::operator=(const bool rawVal) noexcept
+{
+    _mObj.asBool().value(rawVal);
+    return *this;
+}
+
+template <typename ValueObjT>
+CommonValueRawValueProxy<ValueObjT>&
+CommonValueRawValueProxy<ValueObjT>::operator=(const std::int64_t rawVal) noexcept
+{
+    _mObj.asSignedInteger().value(rawVal);
+    return *this;
+}
+
+template <typename ValueObjT>
+CommonValueRawValueProxy<ValueObjT>&
+CommonValueRawValueProxy<ValueObjT>::operator=(const std::uint64_t rawVal) noexcept
+{
+    _mObj.asUnsignedInteger().value(rawVal);
+    return *this;
+}
+
+template <typename ValueObjT>
+CommonValueRawValueProxy<ValueObjT>&
+CommonValueRawValueProxy<ValueObjT>::operator=(const double rawVal) noexcept
+{
+    _mObj.asReal().value(rawVal);
+    return *this;
+}
+
+template <typename ValueObjT>
+CommonValueRawValueProxy<ValueObjT>&
+CommonValueRawValueProxy<ValueObjT>::operator=(const char * const rawVal)
+{
+    _mObj.asString().value(rawVal);
+    return *this;
+}
+
+template <typename ValueObjT>
+CommonValueRawValueProxy<ValueObjT>&
+CommonValueRawValueProxy<ValueObjT>::operator=(const std::string& rawVal)
+{
+    _mObj.asString().value(rawVal);
+    return *this;
+}
+
+template <typename ValueObjT>
+CommonValueRawValueProxy<ValueObjT>::operator bool() const noexcept
+{
+    return _mObj.asBool().value();
+}
+
+template <typename ValueObjT>
+CommonValueRawValueProxy<ValueObjT>::operator std::int64_t() const noexcept
+{
+    return _mObj.asSignedInteger().value();
+}
+
+template <typename ValueObjT>
+CommonValueRawValueProxy<ValueObjT>::operator std::uint64_t() const noexcept
+{
+    return _mObj.asUnsignedInteger().value();
+}
+
+template <typename ValueObjT>
+CommonValueRawValueProxy<ValueObjT>::operator double() const noexcept
+{
+    return _mObj.asReal().value();
+}
+
+template <typename ValueObjT>
+CommonValueRawValueProxy<ValueObjT>::operator const char *() const noexcept
+{
+    return _mObj.asString().value();
+}
+
+template <typename ValueObjT>
+CommonValueRawValueProxy<ValueObjT>::operator bt2c::CStringView() const noexcept
+{
+    return _mObj.asString().value();
+}
+
 namespace internal {
 
 struct ValueTypeDescr
@@ -246,7 +418,7 @@ public:
     }
 
     template <typename OtherLibObjT>
-    CommonNullValue<LibObjT>& operator=(const CommonNullValue<OtherLibObjT> val) noexcept
+    CommonNullValue<LibObjT> operator=(const CommonNullValue<OtherLibObjT> val) noexcept
     {
         _ThisCommonValue::operator=(val);
         return *this;
@@ -290,14 +462,14 @@ template <typename LibObjT>
 class CommonBoolValue final : public CommonValue<LibObjT>
 {
 private:
-    using typename CommonValue<LibObjT>::_LibObjPtr;
     using typename CommonValue<LibObjT>::_ThisCommonValue;
 
 public:
+    using typename CommonValue<LibObjT>::LibObjPtr;
     using Shared = SharedValue<CommonBoolValue<LibObjT>, LibObjT>;
     using Value = bool;
 
-    explicit CommonBoolValue(const _LibObjPtr libObjPtr) noexcept : _ThisCommonValue {libObjPtr}
+    explicit CommonBoolValue(const LibObjPtr libObjPtr) noexcept : _ThisCommonValue {libObjPtr}
     {
         BT_ASSERT_DBG(this->isBool());
     }
@@ -316,7 +488,7 @@ public:
     }
 
     template <typename OtherLibObjT>
-    CommonBoolValue<LibObjT>& operator=(const CommonBoolValue<OtherLibObjT> val) noexcept
+    CommonBoolValue<LibObjT> operator=(const CommonBoolValue<OtherLibObjT> val) noexcept
     {
         _ThisCommonValue::operator=(val);
         return *this;
@@ -327,12 +499,9 @@ public:
         return CommonBoolValue<const bt_value> {*this};
     }
 
-    CommonBoolValue<LibObjT> operator=(const Value rawVal) const noexcept
+    RawValueProxy<CommonBoolValue> operator*() const noexcept
     {
-        static_assert(!std::is_const<LibObjT>::value, "Not available with `bt2::ConstBoolValue`.");
-
-        bt_value_bool_set(this->libObjPtr(), static_cast<bt_bool>(rawVal));
-        return *this;
+        return RawValueProxy<CommonBoolValue> {*this};
     }
 
     Value value() const noexcept
@@ -340,9 +509,11 @@ public:
         return static_cast<Value>(bt_value_bool_get(this->libObjPtr()));
     }
 
-    operator Value() const noexcept
+    void value(const Value val) const noexcept
     {
-        return this->value();
+        static_assert(!std::is_const<LibObjT>::value, "Not available with `bt2::ConstBoolValue`.");
+
+        bt_value_bool_set(this->libObjPtr(), static_cast<bt_bool>(val));
     }
 
     Shared shared() const noexcept
@@ -378,14 +549,14 @@ template <typename LibObjT>
 class CommonUnsignedIntegerValue final : public CommonValue<LibObjT>
 {
 private:
-    using typename CommonValue<LibObjT>::_LibObjPtr;
     using typename CommonValue<LibObjT>::_ThisCommonValue;
 
 public:
+    using typename CommonValue<LibObjT>::LibObjPtr;
     using Shared = SharedValue<CommonUnsignedIntegerValue<LibObjT>, LibObjT>;
     using Value = std::uint64_t;
 
-    explicit CommonUnsignedIntegerValue(const _LibObjPtr libObjPtr) noexcept :
+    explicit CommonUnsignedIntegerValue(const LibObjPtr libObjPtr) noexcept :
         _ThisCommonValue {libObjPtr}
     {
         BT_ASSERT_DBG(this->isUnsignedInteger());
@@ -406,12 +577,9 @@ public:
     }
 
     template <typename OtherLibObjT>
-    CommonUnsignedIntegerValue<LibObjT>&
+    CommonUnsignedIntegerValue<LibObjT>
     operator=(const CommonUnsignedIntegerValue<OtherLibObjT> val) noexcept
     {
-        static_assert(!std::is_const<LibObjT>::value,
-                      "Not available with `bt2::ConstUnsignedIntegerValue`.");
-
         _ThisCommonValue::operator=(val);
         return *this;
     }
@@ -421,20 +589,22 @@ public:
         return CommonUnsignedIntegerValue<const bt_value> {*this};
     }
 
-    CommonUnsignedIntegerValue<LibObjT> operator=(const Value rawVal) const noexcept
+    RawValueProxy<CommonUnsignedIntegerValue> operator*() const noexcept
     {
-        bt_value_integer_unsigned_set(this->libObjPtr(), rawVal);
-        return *this;
+        return RawValueProxy<CommonUnsignedIntegerValue> {*this};
     }
 
-    Value value() const noexcept
+    void value(const Value val) const noexcept
     {
-        return bt_value_integer_unsigned_get(this->libObjPtr());
+        static_assert(!std::is_const<LibObjT>::value,
+                      "Not available with `bt2::ConstUnsignedIntegerValue`.");
+
+        bt_value_integer_unsigned_set(this->libObjPtr(), val);
     }
 
-    operator Value() const noexcept
+    Value value() const noexcept
     {
-        return this->value();
+        return bt_value_integer_unsigned_get(this->libObjPtr());
     }
 
     Shared shared() const noexcept
@@ -470,14 +640,14 @@ template <typename LibObjT>
 class CommonSignedIntegerValue final : public CommonValue<LibObjT>
 {
 private:
-    using typename CommonValue<LibObjT>::_LibObjPtr;
     using typename CommonValue<LibObjT>::_ThisCommonValue;
 
 public:
+    using typename CommonValue<LibObjT>::LibObjPtr;
     using Shared = SharedValue<CommonSignedIntegerValue<LibObjT>, LibObjT>;
     using Value = std::int64_t;
 
-    explicit CommonSignedIntegerValue(const _LibObjPtr libObjPtr) noexcept :
+    explicit CommonSignedIntegerValue(const LibObjPtr libObjPtr) noexcept :
         _ThisCommonValue {libObjPtr}
     {
         BT_ASSERT_DBG(this->isSignedInteger());
@@ -510,13 +680,17 @@ public:
         return CommonSignedIntegerValue<const bt_value> {*this};
     }
 
-    CommonSignedIntegerValue<LibObjT> operator=(const Value rawVal) const noexcept
+    RawValueProxy<CommonSignedIntegerValue> operator*() const noexcept
+    {
+        return RawValueProxy<CommonSignedIntegerValue> {*this};
+    }
+
+    void value(const Value val) const noexcept
     {
         static_assert(!std::is_const<LibObjT>::value,
                       "Not available with `bt2::ConstSignedIntegerValue`.");
 
-        bt_value_integer_signed_set(this->libObjPtr(), rawVal);
-        return *this;
+        bt_value_integer_signed_set(this->libObjPtr(), val);
     }
 
     Value value() const noexcept
@@ -524,11 +698,6 @@ public:
         return bt_value_integer_signed_get(this->libObjPtr());
     }
 
-    operator Value() const noexcept
-    {
-        return this->value();
-    }
-
     Shared shared() const noexcept
     {
         return Shared::createWithRef(*this);
@@ -562,14 +731,14 @@ template <typename LibObjT>
 class CommonRealValue final : public CommonValue<LibObjT>
 {
 private:
-    using typename CommonValue<LibObjT>::_LibObjPtr;
     using typename CommonValue<LibObjT>::_ThisCommonValue;
 
 public:
+    using typename CommonValue<LibObjT>::LibObjPtr;
     using Shared = SharedValue<CommonRealValue<LibObjT>, LibObjT>;
     using Value = double;
 
-    explicit CommonRealValue(const _LibObjPtr libObjPtr) noexcept : _ThisCommonValue {libObjPtr}
+    explicit CommonRealValue(const LibObjPtr libObjPtr) noexcept : _ThisCommonValue {libObjPtr}
     {
         BT_ASSERT_DBG(this->isReal());
     }
@@ -588,7 +757,7 @@ public:
     }
 
     template <typename OtherLibObjT>
-    CommonRealValue<LibObjT>& operator=(const CommonRealValue<OtherLibObjT> val) noexcept
+    CommonRealValue<LibObjT> operator=(const CommonRealValue<OtherLibObjT> val) noexcept
     {
         _ThisCommonValue::operator=(val);
         return *this;
@@ -599,12 +768,16 @@ public:
         return CommonRealValue<const bt_value> {*this};
     }
 
-    CommonRealValue<LibObjT> operator=(const Value rawVal) const noexcept
+    RawValueProxy<CommonRealValue> operator*() const noexcept
+    {
+        return RawValueProxy<CommonRealValue> {*this};
+    }
+
+    void value(const Value val) const noexcept
     {
         static_assert(!std::is_const<LibObjT>::value, "Not available with `bt2::ConstRealValue`.");
 
-        bt_value_real_set(this->libObjPtr(), rawVal);
-        return *this;
+        bt_value_real_set(this->libObjPtr(), val);
     }
 
     Value value() const noexcept
@@ -612,11 +785,6 @@ public:
         return bt_value_real_get(this->libObjPtr());
     }
 
-    operator Value() const noexcept
-    {
-        return this->value();
-    }
-
     Shared shared() const noexcept
     {
         return Shared::createWithRef(*this);
@@ -650,13 +818,14 @@ template <typename LibObjT>
 class CommonStringValue final : public CommonValue<LibObjT>
 {
 private:
-    using typename CommonValue<LibObjT>::_LibObjPtr;
     using typename CommonValue<LibObjT>::_ThisCommonValue;
 
 public:
+    using typename CommonValue<LibObjT>::LibObjPtr;
     using Shared = SharedValue<CommonStringValue<LibObjT>, LibObjT>;
+    using Value = bt2c::CStringView;
 
-    explicit CommonStringValue(const _LibObjPtr libObjPtr) noexcept : _ThisCommonValue {libObjPtr}
+    explicit CommonStringValue(const LibObjPtr libObjPtr) noexcept : _ThisCommonValue {libObjPtr}
     {
         BT_ASSERT_DBG(this->isString());
     }
@@ -680,7 +849,7 @@ public:
     }
 
     template <typename OtherLibObjT>
-    CommonStringValue<LibObjT>& operator=(const CommonStringValue<OtherLibObjT> val) noexcept
+    CommonStringValue<LibObjT> operator=(const CommonStringValue<OtherLibObjT> val) noexcept
     {
         _ThisCommonValue::operator=(val);
         return *this;
@@ -691,26 +860,34 @@ public:
         return CommonStringValue<const bt_value> {*this};
     }
 
-    CommonStringValue<LibObjT> operator=(const char * const rawVal) const
+    RawStringValueProxy<CommonStringValue> operator*() const noexcept
+    {
+        return RawStringValueProxy<CommonStringValue> {*this};
+    }
+
+    void value(const Value val) const
     {
         static_assert(!std::is_const<LibObjT>::value,
                       "Not available with `bt2::ConstStringValue`.");
 
-        const auto status = bt_value_string_set(this->libObjPtr(), rawVal);
+        const auto status = bt_value_string_set(this->libObjPtr(), *val);
 
         if (status == BT_VALUE_STRING_SET_STATUS_MEMORY_ERROR) {
             throw MemoryError {};
         }
+    }
 
-        return *this;
+    void value(const char * const val) const
+    {
+        this->value(bt2c::CStringView {val});
     }
 
-    CommonStringValue<LibObjT> operator=(const std::string& rawVal) const noexcept
+    void value(const std::string& val) const
     {
-        return *this = rawVal.data();
+        this->value(bt2c::CStringView {val.data()});
     }
 
-    bpstd::string_view value() const noexcept
+    Value value() const noexcept
     {
         return bt_value_string_get(this->libObjPtr());
     }
@@ -772,14 +949,14 @@ template <typename LibObjT>
 class CommonArrayValue final : public CommonValue<LibObjT>
 {
 private:
-    using typename CommonValue<LibObjT>::_LibObjPtr;
     using typename CommonValue<LibObjT>::_ThisCommonValue;
 
 public:
+    using typename CommonValue<LibObjT>::LibObjPtr;
     using Shared = SharedValue<CommonArrayValue<LibObjT>, LibObjT>;
     using Iterator = BorrowedObjectIterator<CommonArrayValue<LibObjT>>;
 
-    explicit CommonArrayValue(const _LibObjPtr libObjPtr) noexcept : _ThisCommonValue {libObjPtr}
+    explicit CommonArrayValue(const LibObjPtr libObjPtr) noexcept : _ThisCommonValue {libObjPtr}
     {
         BT_ASSERT_DBG(this->isArray());
     }
@@ -798,7 +975,7 @@ public:
     }
 
     template <typename OtherLibObjT>
-    CommonArrayValue<LibObjT>& operator=(const CommonArrayValue<OtherLibObjT> val) noexcept
+    CommonArrayValue<LibObjT> operator=(const CommonArrayValue<OtherLibObjT> val) noexcept
     {
         _ThisCommonValue::operator=(val);
         return *this;
@@ -975,7 +1152,7 @@ struct TypeDescr<ConstArrayValue> : public ArrayValueTypeDescr
  * First argument is the entry's key, second is its value.
  */
 template <typename ObjT>
-using CommonMapValueForEachUserFunc = std::function<void(const bpstd::string_view&, ObjT)>;
+using CommonMapValueForEachUserFunc = std::function<void(bt2c::CStringView, ObjT)>;
 
 /*
  * Template of a function to be passed to bt_value_map_foreach_entry()
@@ -985,7 +1162,7 @@ using CommonMapValueForEachUserFunc = std::function<void(const bpstd::string_vie
  * `CommonMapValueForEachUserFunc<ObjT>` (the user function to call).
  *
  * This function catches any exception which the user function throws
- * and returns the `ErrorStatus` value. If there's no execption, this
+ * and returns the `ErrorStatus` value. If there's no exception, this
  * function returns the `OkStatus` value.
  */
 template <typename ObjT, typename LibObjT, typename LibStatusT, int OkStatus, int ErrorStatus>
@@ -1076,13 +1253,13 @@ template <typename LibObjT>
 class CommonMapValue final : public CommonValue<LibObjT>
 {
 private:
-    using typename CommonValue<LibObjT>::_LibObjPtr;
     using typename CommonValue<LibObjT>::_ThisCommonValue;
 
 public:
+    using typename CommonValue<LibObjT>::LibObjPtr;
     using Shared = SharedValue<CommonMapValue<LibObjT>, LibObjT>;
 
-    explicit CommonMapValue(const _LibObjPtr libObjPtr) noexcept : _ThisCommonValue {libObjPtr}
+    explicit CommonMapValue(const LibObjPtr libObjPtr) noexcept : _ThisCommonValue {libObjPtr}
     {
         BT_ASSERT_DBG(this->isMap());
     }
@@ -1101,7 +1278,7 @@ public:
     }
 
     template <typename OtherLibObjT>
-    CommonMapValue<LibObjT>& operator=(const CommonMapValue<OtherLibObjT> val) noexcept
+    CommonMapValue<LibObjT> operator=(const CommonMapValue<OtherLibObjT> val) noexcept
     {
         _ThisCommonValue::operator=(val);
         return *this;
@@ -1122,19 +1299,12 @@ public:
         return this->length() == 0;
     }
 
-    nonstd::optional<CommonValue<LibObjT>> operator[](const char * const key) const noexcept
+    OptionalBorrowedObject<CommonValue<LibObjT>> operator[](const char * const key) const noexcept
     {
-        const auto libObjPtr =
-            internal::CommonMapValueSpec<LibObjT>::entryByKey(this->libObjPtr(), key);
-
-        if (!libObjPtr) {
-            return nonstd::nullopt;
-        }
-
-        return CommonValue<LibObjT> {libObjPtr};
+        return internal::CommonMapValueSpec<LibObjT>::entryByKey(this->libObjPtr(), key);
     }
 
-    nonstd::optional<CommonValue<LibObjT>> operator[](const std::string& key) const noexcept
+    OptionalBorrowedObject<CommonValue<LibObjT>> operator[](const std::string& key) const noexcept
     {
         return (*this)[key.data()];
     }
@@ -1293,6 +1463,42 @@ struct TypeDescr<ConstMapValue> : public MapValueTypeDescr
 
 } /* namespace internal */
 
+template <typename LibObjT>
+ArrayValue CommonValue<LibObjT>::appendEmptyArray() const
+{
+    return this->asArray().appendEmptyArray();
+}
+
+template <typename LibObjT>
+MapValue CommonValue<LibObjT>::appendEmptyMap() const
+{
+    return this->asArray().appendEmptyMap();
+}
+
+template <typename LibObjT>
+ArrayValue CommonValue<LibObjT>::insertEmptyArray(const char * const key) const
+{
+    return this->asMap().insertEmptyArray(key);
+}
+
+template <typename LibObjT>
+ArrayValue CommonValue<LibObjT>::insertEmptyArray(const std::string& key) const
+{
+    return this->asMap().insertEmptyArray(key);
+}
+
+template <typename LibObjT>
+MapValue CommonValue<LibObjT>::insertEmptyMap(const char * const key) const
+{
+    return this->asMap().insertEmptyMap(key);
+}
+
+template <typename LibObjT>
+MapValue CommonValue<LibObjT>::insertEmptyMap(const std::string& key) const
+{
+    return this->asMap().insertEmptyMap(key);
+}
+
 template <typename LibObjT>
 CommonNullValue<LibObjT> CommonValue<LibObjT>::asNull() const noexcept
 {
This page took 0.032885 seconds and 4 git commands to generate.