insert overloads
Synopses
Declared in <bdljsn_json.h>
Insert the specified member into this JsonObject if the key (the first element) of the object referred to by member does not already exist in this JsonObject; otherwise, this method has no effect. Return a pair whose first member is an iterator referring to the (possibly newly inserted) member object in this JsonObject whose key is the equivalent to that of the object to be inserted, and whose second member is true if a new value was inserted, and false otherwise. The behavior is undefined unless member.first is valid UTF‐8 (see bdlde::Utf8Util::isValid).
Insert into this JsonObject members created (in order) from the specified members. List members having key values already contained in this object are ignored. Return a non‐`const` reference to this JsonObject. The behavior is undefined unless the keys of all Member objects inserted are valid UTF‐8 (see bdlde::Utf8Util::isValid).
JsonObject&
insert(std::initializer_list<JsonObject_MemberInitializer> memberInitializers);
Insert the specified member into this JsonObject if the key (the first element) of the object referred to by value does not already exist in this JsonObject; otherwise, this method has no effect. Return a pair whose first member is an iterator referring to the (possibly newly inserted) value_type object in this JsonObject whose key is equivalent to that of the object to be inserted, and whose second member is true if a new value was inserted, and false if a value having an equivalent key was already present. The behavior is undefined unless member.first is valid UTF‐8 (see bdlde::Utf8Util::isValid).
bsl::pair<JsonObject::Iterator, bool>
insert(Member const& member);
Create a Member object for each iterator in the range starting at the specified first iterator and ending immediately before the specified last iterator, by converting from the object referred to by each iterator. Insert into this JsonObject each such object whose key is not already contained. Return a non‐`const` reference to this JsonObject. The (template parameter) type t_INPUT_ITERATOR shall meet the requirements of an input iterator defined in the C++11 standard [24.2.3]providing access to values of a type convertible to Member. The behavior is undefined unless first and last refer to a sequence of value values where first is at a position at or before last. The behavior is undefined unless the keys of all Member objects inserted are valid UTF‐8 (see bdlde::Utf8Util::isValid).
template<class t_INPUT_ITERATOR>
JsonObject&
insert(
t_INPUT_ITERATOR first,
t_INPUT_ITERATOR last)
requires !bsl::is_convertible<t_INPUT_ITERATOR, bsl::string_view>::value;
Insert into this JsonObject a Member constructed from the specified key and the specified value, respectively, if key does not already exist in this JsonObject; otherwise, this method has no effect. Return a pair whose first member is an iterator referring to the (possibly newly inserted) Member object in this JsonObject whose key is the equivalent to that of the object to be inserted, and whose second member is true if a new value was inserted, and false otherwise. The behavior is undefined unless key is valid UTF‐8 (see bdlde::Utf8Util::isValid).
template<class t_VALUE>
bsl::pair<JsonObject::Iterator, bool>
insert(
std::string_view const& key,
t_VALUE&& value);
Created with MrDocs