[#BloombergLP-bdljsn-Json] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdljsn.adoc[bdljsn]::Json :relfileprefix: ../../ :mrdocs: This type is designed to be a thin wrapper around a variant of the possible JSON types, using a BDE‐style variant interface. == Synopsis Declared in `<bdljsn_json.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- class Json; ---- == Member Functions [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bdljsn/Json/2constructor-0b3.adoc[`Json`] [.small]#[constructor]# | Constructors | xref:BloombergLP/bdljsn/Json/operator_assign-06.adoc[`operator=`] | Assignment operators | xref:BloombergLP/bdljsn/Json/allocator.adoc[`allocator`] | Return the allocator used by this object to allocate memory. | xref:BloombergLP/bdljsn/Json/asDecimal64.adoc[`asDecimal64`] | Return the closest `Decimal64` representation of this number. | xref:BloombergLP/bdljsn/Json/asDecimal64Exact.adoc[`asDecimal64Exact`] | Load `result` with the closest Decimal64 representation of this number. | xref:BloombergLP/bdljsn/Json/asDouble.adoc[`asDouble`] | Return the closest `double` representation of this number. | xref:BloombergLP/bdljsn/Json/asFloat.adoc[`asFloat`] | Return the closest `float` representation of this number. | xref:BloombergLP/bdljsn/Json/asInt.adoc[`asInt`] | Same as the related overload above for `asInt`. | xref:BloombergLP/bdljsn/Json/asInt64.adoc[`asInt64`] | Same as the related overload above for `asInt64`. | xref:BloombergLP/bdljsn/Json/asLong.adoc[`asLong`] | Same as the related overload above for `asLong`. | xref:BloombergLP/bdljsn/Json/asLonglong.adoc[`asLonglong`] | Same as the related overload above for `asLonglong`. | xref:BloombergLP/bdljsn/Json/asShort.adoc[`asShort`] | Load `result` with the integer value of this number. | xref:BloombergLP/bdljsn/Json/asUint.adoc[`asUint`] | Same as the related overload above for `asUint`. | xref:BloombergLP/bdljsn/Json/asUint64.adoc[`asUint64`] | Same as the related overload above for `asUint64`. | xref:BloombergLP/bdljsn/Json/asUlong.adoc[`asUlong`] | Same as the related overload above for `asUlong`. | xref:BloombergLP/bdljsn/Json/asUlonglong.adoc[`asUlonglong`] | Same as the related overload above for `asUlonglong`. | xref:BloombergLP/bdljsn/Json/asUshort.adoc[`asUshort`] | Same as the related overload above for `asUshort`. | xref:BloombergLP/bdljsn/Json/contains.adoc[`contains`] | Return whether the held object contains a member with `key`. | xref:BloombergLP/bdljsn/Json/insert-09.adoc[`insert`] | `insert` overloads | xref:BloombergLP/bdljsn/Json/isArray.adoc[`isArray`] | Return true if the value held by this object is of type `JsonArray`, and false otherwise. | xref:BloombergLP/bdljsn/Json/isBoolean.adoc[`isBoolean`] | Return true if the value held by this object is of type `bool`, and false otherwise. | xref:BloombergLP/bdljsn/Json/isNull.adoc[`isNull`] | Return true if the value held by this object is of type `JsonNull`, and false otherwise. | xref:BloombergLP/bdljsn/Json/isNumber.adoc[`isNumber`] | Return true if the value held by this object is of type `JsonNumber`, and false otherwise. | xref:BloombergLP/bdljsn/Json/isObject.adoc[`isObject`] | Return true if the value held by this object is of type `JsonObject`, and false otherwise. | xref:BloombergLP/bdljsn/Json/isString.adoc[`isString`] | Return true if the value held by this object is of type `bsl::string`, and false otherwise. | xref:BloombergLP/bdljsn/Json/makeArray-01.adoc[`makeArray`] | `makeArray` overloads | xref:BloombergLP/bdljsn/Json/makeBoolean-0e.adoc[`makeBoolean`] | `makeBoolean` overloads | xref:BloombergLP/bdljsn/Json/makeNull.adoc[`makeNull`] | Create an instance of type `JsonNull` in this object. This method first destroys the current value held by this object. | xref:BloombergLP/bdljsn/Json/makeNumber-0c.adoc[`makeNumber`] | `makeNumber` overloads | xref:BloombergLP/bdljsn/Json/makeObject-01.adoc[`makeObject`] | `makeObject` overloads | xref:BloombergLP/bdljsn/Json/makeString-02.adoc[`makeString`] | `makeString` overloads | xref:BloombergLP/bdljsn/Json/operator_subs-0f.adoc[`operator[]`] | Subscript operators | xref:BloombergLP/bdljsn/Json/print.adoc[`print`] | Write this value to the specified output stream in a human‐readable format. | xref:BloombergLP/bdljsn/Json/pushBack-0ce.adoc[`pushBack`] | `pushBack` overloads | xref:BloombergLP/bdljsn/Json/size.adoc[`size`] | Return the number of elements in the `JsonObject` or `JsonArray` held by this object. The behavior is undefined unless `isArray() || isObject()` evaluates to true. | xref:BloombergLP/bdljsn/Json/swap.adoc[`swap`] | Exchange the value of this object with that of `other`. | xref:BloombergLP/bdljsn/Json/theArray-0f.adoc[`theArray`] | `theArray` overloads | xref:BloombergLP/bdljsn/Json/theBoolean-0f.adoc[`theBoolean`] | `theBoolean` overloads | xref:BloombergLP/bdljsn/Json/theNull-0c.adoc[`theNull`] | `theNull` overloads | xref:BloombergLP/bdljsn/Json/theNumber-01.adoc[`theNumber`] | `theNumber` overloads | xref:BloombergLP/bdljsn/Json/theObject-08a.adoc[`theObject`] | `theObject` overloads | xref:BloombergLP/bdljsn/Json/theString.adoc[`theString`] | Return a non‐modifiable reference to the held string. | xref:BloombergLP/bdljsn/Json/type.adoc[`type`] | Return the type of this `Json` value. | xref:BloombergLP/bdljsn/Json/visit-0a.adoc[`visit`] | Invoke `visitor` on the value held by this object. | xref:BloombergLP/bdljsn/Json/2conversion-05d0.adoc[`operator BloombergLP::bslmf::NestedTraitDeclaration<Json, HasPrintMethod>`] | Declare that this type uses a `bslma` allocator. | xref:BloombergLP/bdljsn/Json/2conversion-0def.adoc[`operator JsonArray&`] | Return a reference providing modifiable access to the value of type `JsonArray` held by this object. The behavior is undefined unless `isArray()` returns true. | xref:BloombergLP/bdljsn/Json/2conversion-0a9.adoc[`operator JsonNull&`] | Return a reference providing modifiable access to the value of type `JsonNull` held by this object. The behavior is undefined unless `isNull()` returns true. | xref:BloombergLP/bdljsn/Json/2conversion-0e.adoc[`operator JsonNumber&`] | Return a reference providing modifiable access to the value of type `JsonNumber` held by this object. The behavior is undefined unless `isNumber()` returns true. | xref:BloombergLP/bdljsn/Json/2conversion-08.adoc[`operator JsonObject&`] | Return a reference providing modifiable access to the value of type `JsonObject` held by this object. The behavior is undefined unless `isObject()` returns true. | xref:BloombergLP/bdljsn/Json/2conversion-01.adoc[`operator bool&`] | Return a reference providing modifiable access to the value of type `boolean` held by this object. The behavior is undefined unless `isBoolean()` returns true. | xref:BloombergLP/bdljsn/Json/2conversion-04.adoc[`operator JsonArray const&`] | Return a reference providing non‐modifiable access to the value of type `JsonArray` held by this object. The behavior is undefined unless `isArray()` returns true. | xref:BloombergLP/bdljsn/Json/2conversion-0aa.adoc[`operator JsonNull const&`] | Return a reference providing non‐modifiable access to the value of type `JsonNull` held by this object. The behavior is undefined unless `isNull()` returns true. | xref:BloombergLP/bdljsn/Json/2conversion-0de6.adoc[`operator JsonNumber const&`] | Return a non‐modifiable reference to the held `JsonNumber`. | xref:BloombergLP/bdljsn/Json/2conversion-05d7.adoc[`operator JsonObject const&`] | Return a non‐modifiable reference to the held `JsonObject`. | xref:BloombergLP/bdljsn/Json/2conversion-0b.adoc[`operator bool const&`] | Return a reference providing non‐modifiable access to the value of type `boolean` held by this object. The behavior is undefined unless `isBoolean()` returns true. | xref:BloombergLP/bdljsn/Json/2conversion-00.adoc[`operator bsl::string const&`] | Return a non‐modifiable reference to the held string. |=== == Friends [cols="1,4"] |=== | Name| Description | `xref:BloombergLP/bdljsn/swap-04.adoc[BloombergLP::bdljsn::swap]` | Exchange the values of the specified `a` and `b` objects. | `xref:BloombergLP/bdljsn/operator_not_eq-0b5.adoc[BloombergLP::bdljsn::operator!=]` | Return whether `lhs` and `rhs` do not have the same value. | `xref:BloombergLP/bdljsn/operator_eq-0d2.adoc[BloombergLP::bdljsn::operator==]` | Return whether `lhs` and `rhs` have the same value. |=== == Non-Member Functions [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bdljsn/operator_not_eq-00f.adoc[`operator!=`] | Same as the related overload above for `operator!=`. | xref:BloombergLP/bdljsn/operator_not_eq-014.adoc[`operator!=`] | Same as the related overload above for `operator!=`. | xref:BloombergLP/bdljsn/operator_not_eq-015.adoc[`operator!=`] | Same as the related overload above for `operator!=`. | xref:BloombergLP/bdljsn/operator_not_eq-04.adoc[`operator!=`] | Same as the related overload above for `operator!=`. | xref:BloombergLP/bdljsn/operator_not_eq-053.adoc[`operator!=`] | Same as the related overload above for `operator!=`. | xref:BloombergLP/bdljsn/operator_not_eq-05b.adoc[`operator!=`] | Same as the related overload above for `operator!=`. | xref:BloombergLP/bdljsn/operator_not_eq-05f.adoc[`operator!=`] | Same as the related overload above for `operator!=`. | xref:BloombergLP/bdljsn/operator_not_eq-076.adoc[`operator!=`] | Same as the related overload above for `operator!=`. | xref:BloombergLP/bdljsn/operator_not_eq-078.adoc[`operator!=`] | Same as the related overload above for `operator!=`. | xref:BloombergLP/bdljsn/operator_not_eq-087.adoc[`operator!=`] | Same as the related overload above for `operator!=`. | xref:BloombergLP/bdljsn/operator_not_eq-09.adoc[`operator!=`] | Same as the related overload above for `operator!=`. | xref:BloombergLP/bdljsn/operator_not_eq-0a.adoc[`operator!=`] | Same as the related overload above for `operator!=`. | xref:BloombergLP/bdljsn/operator_not_eq-0c0.adoc[`operator!=`] | Same as the related overload above for `operator!=`. | xref:BloombergLP/bdljsn/operator_not_eq-0d5.adoc[`operator!=`] | Same as the related overload above for `operator!=`. | xref:BloombergLP/bdljsn/operator_not_eq-0ee.adoc[`operator!=`] | Same as the related overload above for `operator!=`. | xref:BloombergLP/bdljsn/operator_not_eq-0f5.adoc[`operator!=`] | Same as the related overload above for `operator!=`. | xref:BloombergLP/bdljsn/operator_json.adoc[`operator""_json`] | Return a `bdljsn::Json` object from the specified JSON literal text. | xref:BloombergLP/bdljsn/operator_eq-025.adoc[`operator==`] | Same as the related overload above for `operator==`. | xref:BloombergLP/bdljsn/operator_eq-02a.adoc[`operator==`] | Same as the related overload above for `operator==`. | xref:BloombergLP/bdljsn/operator_eq-03f.adoc[`operator==`] | Same as the related overload above for `operator==`. | xref:BloombergLP/bdljsn/operator_eq-040.adoc[`operator==`] | Same as the related overload above for `operator==`. | xref:BloombergLP/bdljsn/operator_eq-0482.adoc[`operator==`] | Same as the related overload above for `operator==`. | xref:BloombergLP/bdljsn/operator_eq-05f0.adoc[`operator==`] | Same as the related overload above for `operator==`. | xref:BloombergLP/bdljsn/operator_eq-060.adoc[`operator==`] | Same as the related overload above for `operator==`. | xref:BloombergLP/bdljsn/operator_eq-071.adoc[`operator==`] | Same as the related overload above for `operator==`. | xref:BloombergLP/bdljsn/operator_eq-077.adoc[`operator==`] | Same as the related overload above for `operator==`. | xref:BloombergLP/bdljsn/operator_eq-0844.adoc[`operator==`] | Same as the related overload above for `operator==`. | xref:BloombergLP/bdljsn/operator_eq-089.adoc[`operator==`] | Same as the related overload above for `operator==`. | xref:BloombergLP/bdljsn/operator_eq-0b.adoc[`operator==`] | Same as the related overload above for `operator==`. | xref:BloombergLP/bdljsn/operator_eq-0c8.adoc[`operator==`] | Same as the related overload above for `operator==`. | xref:BloombergLP/bdljsn/operator_eq-0cd.adoc[`operator==`] | Same as the related overload above for `operator==`. | xref:BloombergLP/bdljsn/operator_eq-0e1.adoc[`operator==`] | Same as the related overload above for `operator==`. | xref:BloombergLP/bdljsn/operator_eq-0f1.adoc[`operator==`] | Same as the related overload above for `operator==`. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#