Constructors

Synopses

Declared in <bdljsn_json.h>

Create an empty JsonObject. Optionally specify the basicAllocator used to supply memory. If basicAllocator is not specified, the currently installed default allocator is used to supply memory.

Create a JsonObject having the same value as the specified original object by moving (in constant time) the contents of original to the new JsonObject. The allocator associated with original is propagated for use in the newly‐created JsonObject. original is left in a valid but unspecified state.

Create an empty JsonObject that uses the specified basicAllocator to supply memory.

explicit
JsonObject(bslma::Allocator* basicAllocator);

Create a JsonObject having the same value as the specified original. Use the specified basicAllocator to supply memory. If basicAllocator == original.allocator() the value of original will be moved (in constant time) to the newly‐created JsonObject, and original will be left in a valid but unspecified state. Otherwise, original is copied, and basicAllocator used to supply memory.

Create a JsonObject having members created (in order) from the specified memberInitializers. Member initializers having key values that were previously inserted into the new object are ignored. Optionally specify a basicAllocator used to supply memory. If basicAllocator is not specified, the currently installed default allocator is used. The behavior is undefined unless the key of each member initializer in memberInitializers is valid UTF‐8 (see bdlde::Utf8Util::isValid).

JsonObject(
    std::initializer_list<JsonObject_MemberInitializer> memberInitializers,
    bslma::Allocator* basicAllocator = 0);

Create a JsonObject having the same value as the specified original. Optionally specify the basicAllocator used to supply memory. If basicAllocator is not specified, the currently installed default allocator is used to supply memory.

JsonObject(
    JsonObject const& original,
    bslma::Allocator* basicAllocator = 0);

Create an empty JsonObject, and then create a Json 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, ignoring those having a key that appears earlier in the sequence. Optionally specify a basicAllocator used to supply memory. If basicAllocator is not supplied, the currently installed default allocator is used to supply memory. 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 valid values where first is at a position at or before last, and all keys of all Member objects inserted are valid UTF‐8 (see bdlde::Utf8Util::isValid).

template<class t_INPUT_ITERATOR>
JsonObject(
    t_INPUT_ITERATOR first,
    t_INPUT_ITERATOR last,
    bslma::Allocator* basicAllocator = 0);

Created with MrDocs