[#BloombergLP-bdljsn-JsonObject] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdljsn.adoc[bdljsn]::JsonObject :relfileprefix: ../../ :mrdocs: This type is designed to replicate much of the standard associative container interface, eliding interfaces that are less relevant for a non‐generic container, like hasher and comparator access, emplacement, nodes, capacity management, etc. == Synopsis Declared in `<bdljsn_json.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- class JsonObject; ---- == Type Aliases [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bdljsn/JsonObject/ConstIterator.adoc[`ConstIterator`] | This `typedef` is an alias for `ConstIterator`. | xref:BloombergLP/bdljsn/JsonObject/Iterator-05.adoc[`Iterator`] | This `typedef` is an alias for `Iterator`. | xref:BloombergLP/bdljsn/JsonObject/IteratorAndStatus.adoc[`IteratorAndStatus`] | This `typedef` is an alias for `IteratorAndStatus`. | xref:BloombergLP/bdljsn/JsonObject/Member.adoc[`Member`] | This `typedef` is an alias for `Member`. | xref:BloombergLP/bdljsn/JsonObject/const_iterator.adoc[`const_iterator`] | This `typedef` is an alias for `const_iterator`. | xref:BloombergLP/bdljsn/JsonObject/const_reference.adoc[`const_reference`] | This `typedef` is an alias to `Container::const_reference`. | xref:BloombergLP/bdljsn/JsonObject/difference_type.adoc[`difference_type`] | This `typedef` is an alias to `Container::difference_type`. | xref:BloombergLP/bdljsn/JsonObject/iterator-08.adoc[`iterator`] | This `typedef` is an alias for `iterator`. | xref:BloombergLP/bdljsn/JsonObject/reference.adoc[`reference`] | This `typedef` is an alias for `reference`. | xref:BloombergLP/bdljsn/JsonObject/size_type.adoc[`size_type`] | This `typedef` is an alias for `size_type`. | xref:BloombergLP/bdljsn/JsonObject/value_type.adoc[`value_type`] | This `typedef` is an alias for `value_type`. |=== == Member Functions [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bdljsn/JsonObject/2constructor-01.adoc[`JsonObject`] [.small]#[constructor]# | Constructors | xref:BloombergLP/bdljsn/JsonObject/operator_assign-0d3.adoc[`operator=`] | Assignment operators | xref:BloombergLP/bdljsn/JsonObject/allocator.adoc[`allocator`] | Return the allocator used by this object to allocate memory. | xref:BloombergLP/bdljsn/JsonObject/begin-01.adoc[`begin`] | `begin` overloads | xref:BloombergLP/bdljsn/JsonObject/cbegin.adoc[`cbegin`] | Return an iterator providing non‐modifiable access to the first `Member` object in the sequence of `Member` objects maintained by this `JsonObject`, or the `end` iterator if this `JsonObject` is empty. | xref:BloombergLP/bdljsn/JsonObject/cend.adoc[`cend`] | Same as the related overload above for `cend`. | xref:BloombergLP/bdljsn/JsonObject/clear.adoc[`clear`] | Remove all entries from this `JsonObject`. Note that this `JsonObject` will be empty after calling this method, but allocated memory may be retained for future use. | xref:BloombergLP/bdljsn/JsonObject/contains.adoc[`contains`] | Return `true` if there is a `Member` object in this `JsonObject` with a key equivalent to the specified `key`, and return `false` otherwise. | xref:BloombergLP/bdljsn/JsonObject/empty.adoc[`empty`] | Return `true` if this `JsonObject` contains no elements, and `false` otherwise. | xref:BloombergLP/bdljsn/JsonObject/end-00.adoc[`end`] | `end` overloads | xref:BloombergLP/bdljsn/JsonObject/erase-03.adoc[`erase`] | `erase` overloads | xref:BloombergLP/bdljsn/JsonObject/find-0f.adoc[`find`] | `find` overloads | xref:BloombergLP/bdljsn/JsonObject/insert-032.adoc[`insert`] | `insert` overloads | xref:BloombergLP/bdljsn/JsonObject/operator_subs-00.adoc[`operator[]`] | Subscript operators | xref:BloombergLP/bdljsn/JsonObject/print.adoc[`print`] | Write the value of this object to the specified output `stream` in a human‐readable format, and return a reference to `stream`. Optionally specify an initial indentation `level`, whose absolute value is incremented recursively for nested objects. If `level` is specified, optionally specify `spacesPerLevel`, whose absolute value indicates the number of spaces per indentation level for this and all of its nested objects. If `level` is negative, suppress indentation of the first line. If `spacesPerLevel` is negative, format the entire output on one line, suppressing all but the initial indentation (as governed by `level`). If `stream` is not valid on entry, this operation has no effect. Note that this human‐readable format is not fully specified, and can change without notice. | xref:BloombergLP/bdljsn/JsonObject/size.adoc[`size`] | Return the number of elements in this `JsonObject`. | xref:BloombergLP/bdljsn/JsonObject/swap.adoc[`swap`] | Exchange the value of this object with that of the specified `other` object. If an exception is thrown, both objects are left in valid but unspecified states. This operation guarantees O[1]complexity. The behavior is undefined unless this object was created with the same allocator as `other`. | xref:BloombergLP/bdljsn/JsonObject/2conversion.adoc[`operator BloombergLP::bslmf::NestedTraitDeclaration<JsonObject, HasPrintMethod>`] | Process the specified `object` during visitation of a `bdljsn::Json` object. |=== == Friends [cols="1,4"] |=== | Name| Description | `xref:BloombergLP/bdljsn/swap-085.adoc[BloombergLP::bdljsn::swap]` | Exchange the value of the specified `a` `JsonObject` with that of the specified `b` `JsonObject`. This function provides the no‐throw exception‐safety guarantee. This operation has O[1]complexity if `a` was created with the same allocator as `b`; otherwise, it has O[n+m] complexity, where n and m are the number of elements in `a` and `b`, respectively. | `xref:BloombergLP/bdljsn/operator_not_eq-072.adoc[BloombergLP::bdljsn::operator!=]` | Return `false` if the specified `lhs` and `rhs` objects have the same value, and `true` otherwise. Two `JsonObject` objects have the same value if they have the same number of `Member` objects, and for each `Member` object that is contained in `lhs` there is a key‐value pair contained in `rhs` having the same value, and vice versa. | `xref:BloombergLP/bdljsn/operator_eq-0dd8.adoc[BloombergLP::bdljsn::operator==]` | Return `true` if the specified `lhs` and `rhs` objects have the same value, and `false` otherwise. Two `JsonObject` objects have the same value if they have the same number of `Member` objects, and for each `Member` object that is contained in `lhs` there is a key‐value pair contained in `rhs` having the same value, and vice versa. |=== == Non-Member Functions [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bdljsn/operator_not_eq-07b.adoc[`operator!=`] | Process the specified `object` during visitation of a `bdljsn::Json` object. | xref:BloombergLP/bdljsn/operator_eq-048a.adoc[`operator==`] | Process the specified `object` during visitation of a `bdljsn::Json` object. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#