[#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&hyphen;style variant interface&period;

== Synopsis

Declared in `&lt;bdljsn&lowbar;json&period;h&gt;`

[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&equals;`] 
| Assignment operators
| xref:BloombergLP/bdljsn/Json/allocator.adoc[`allocator`] 
| Return the allocator used by this object to allocate memory&period;
| xref:BloombergLP/bdljsn/Json/asDecimal64.adoc[`asDecimal64`] 
| Return the closest `Decimal64` representation of this number&period;
| xref:BloombergLP/bdljsn/Json/asDecimal64Exact.adoc[`asDecimal64Exact`] 
| Load `result` with the closest Decimal64 representation of this number&period;
| xref:BloombergLP/bdljsn/Json/asDouble.adoc[`asDouble`] 
| Return the closest `double` representation of this number&period;
| xref:BloombergLP/bdljsn/Json/asFloat.adoc[`asFloat`] 
| Return the closest `float` representation of this number&period;
| xref:BloombergLP/bdljsn/Json/asInt.adoc[`asInt`] 
| Same as the related overload above for `asInt`&period;
| xref:BloombergLP/bdljsn/Json/asInt64.adoc[`asInt64`] 
| Same as the related overload above for `asInt64`&period;
| xref:BloombergLP/bdljsn/Json/asLong.adoc[`asLong`] 
| Same as the related overload above for `asLong`&period;
| xref:BloombergLP/bdljsn/Json/asLonglong.adoc[`asLonglong`] 
| Same as the related overload above for `asLonglong`&period;
| xref:BloombergLP/bdljsn/Json/asShort.adoc[`asShort`] 
| Load `result` with the integer value of this number&period;
| xref:BloombergLP/bdljsn/Json/asUint.adoc[`asUint`] 
| Same as the related overload above for `asUint`&period;
| xref:BloombergLP/bdljsn/Json/asUint64.adoc[`asUint64`] 
| Same as the related overload above for `asUint64`&period;
| xref:BloombergLP/bdljsn/Json/asUlong.adoc[`asUlong`] 
| Same as the related overload above for `asUlong`&period;
| xref:BloombergLP/bdljsn/Json/asUlonglong.adoc[`asUlonglong`] 
| Same as the related overload above for `asUlonglong`&period;
| xref:BloombergLP/bdljsn/Json/asUshort.adoc[`asUshort`] 
| Same as the related overload above for `asUshort`&period;
| xref:BloombergLP/bdljsn/Json/contains.adoc[`contains`] 
| Return whether the held object contains a member with `key`&period;
| 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&period;
| xref:BloombergLP/bdljsn/Json/isBoolean.adoc[`isBoolean`] 
| Return true if the value held by this object is of type `bool`, and false otherwise&period;
| xref:BloombergLP/bdljsn/Json/isNull.adoc[`isNull`] 
| Return true if the value held by this object is of type `JsonNull`, and false otherwise&period;
| xref:BloombergLP/bdljsn/Json/isNumber.adoc[`isNumber`] 
| Return true if the value held by this object is of type `JsonNumber`, and false otherwise&period;
| xref:BloombergLP/bdljsn/Json/isObject.adoc[`isObject`] 
| Return true if the value held by this object is of type `JsonObject`, and false otherwise&period;
| xref:BloombergLP/bdljsn/Json/isString.adoc[`isString`] 
| Return true if the value held by this object is of type `bsl&colon;&colon;string`, and false otherwise&period;
| 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&period; This method first destroys the current value held by this object&period;
| 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&lsqb;&rsqb;`] 
| Subscript operators
| xref:BloombergLP/bdljsn/Json/print.adoc[`print`] 
| Write this value to the specified output stream in a human&hyphen;readable format&period;
| 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&period; The behavior is undefined unless `isArray() &verbar;&verbar; isObject()` evaluates to true&period;
| xref:BloombergLP/bdljsn/Json/swap.adoc[`swap`] 
| Exchange the value of this object with that of `other`&period;
| 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&hyphen;modifiable reference to the held string&period;
| xref:BloombergLP/bdljsn/Json/type.adoc[`type`] 
| Return the type of this `Json` value&period;
| xref:BloombergLP/bdljsn/Json/visit-0a.adoc[`visit`] 
| Invoke `visitor` on the value held by this object&period;
| xref:BloombergLP/bdljsn/Json/2conversion-05d0.adoc[`operator BloombergLP::bslmf::NestedTraitDeclaration&lt;Json, HasPrintMethod&gt;`] 
| Declare that this type uses a `bslma` allocator&period;
| 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&period; The behavior is undefined unless `isArray()` returns true&period;
| 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&period; The behavior is undefined unless `isNull()` returns true&period;
| 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&period; The behavior is undefined unless `isNumber()` returns true&period;
| 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&period; The behavior is undefined unless `isObject()` returns true&period;
| 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&period; The behavior is undefined unless `isBoolean()` returns true&period;
| xref:BloombergLP/bdljsn/Json/2conversion-04.adoc[`operator JsonArray const&`] 
| Return a reference providing non&hyphen;modifiable access to the value of type `JsonArray` held by this object&period; The behavior is undefined unless `isArray()` returns true&period;
| xref:BloombergLP/bdljsn/Json/2conversion-0aa.adoc[`operator JsonNull const&`] 
| Return a reference providing non&hyphen;modifiable access to the value of type `JsonNull` held by this object&period; The behavior is undefined unless `isNull()` returns true&period;
| xref:BloombergLP/bdljsn/Json/2conversion-0de6.adoc[`operator JsonNumber const&`] 
| Return a non&hyphen;modifiable reference to the held `JsonNumber`&period;
| xref:BloombergLP/bdljsn/Json/2conversion-05d7.adoc[`operator JsonObject const&`] 
| Return a non&hyphen;modifiable reference to the held `JsonObject`&period;
| xref:BloombergLP/bdljsn/Json/2conversion-0b.adoc[`operator bool const&`] 
| Return a reference providing non&hyphen;modifiable access to the value of type `boolean` held by this object&period; The behavior is undefined unless `isBoolean()` returns true&period;
| xref:BloombergLP/bdljsn/Json/2conversion-00.adoc[`operator bsl::string const&`] 
| Return a non&hyphen;modifiable reference to the held string&period;
|===


== 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&period;
| `xref:BloombergLP/bdljsn/operator_not_eq-0b5.adoc[BloombergLP::bdljsn::operator!&equals;]`
| Return whether `lhs` and `rhs` do not have the same value&period;
| `xref:BloombergLP/bdljsn/operator_eq-0d2.adoc[BloombergLP::bdljsn::operator&equals;&equals;]`
| Return whether `lhs` and `rhs` have the same value&period;
|===

== Non-Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bdljsn/operator_not_eq-00f.adoc[`operator!&equals;`]
| Same as the related overload above for `operator!&equals;`&period;
| xref:BloombergLP/bdljsn/operator_not_eq-014.adoc[`operator!&equals;`]
| Same as the related overload above for `operator!&equals;`&period;
| xref:BloombergLP/bdljsn/operator_not_eq-015.adoc[`operator!&equals;`]
| Same as the related overload above for `operator!&equals;`&period;
| xref:BloombergLP/bdljsn/operator_not_eq-04.adoc[`operator!&equals;`]
| Same as the related overload above for `operator!&equals;`&period;
| xref:BloombergLP/bdljsn/operator_not_eq-053.adoc[`operator!&equals;`]
| Same as the related overload above for `operator!&equals;`&period;
| xref:BloombergLP/bdljsn/operator_not_eq-05b.adoc[`operator!&equals;`]
| Same as the related overload above for `operator!&equals;`&period;
| xref:BloombergLP/bdljsn/operator_not_eq-05f.adoc[`operator!&equals;`]
| Same as the related overload above for `operator!&equals;`&period;
| xref:BloombergLP/bdljsn/operator_not_eq-076.adoc[`operator!&equals;`]
| Same as the related overload above for `operator!&equals;`&period;
| xref:BloombergLP/bdljsn/operator_not_eq-078.adoc[`operator!&equals;`]
| Same as the related overload above for `operator!&equals;`&period;
| xref:BloombergLP/bdljsn/operator_not_eq-087.adoc[`operator!&equals;`]
| Same as the related overload above for `operator!&equals;`&period;
| xref:BloombergLP/bdljsn/operator_not_eq-09.adoc[`operator!&equals;`]
| Same as the related overload above for `operator!&equals;`&period;
| xref:BloombergLP/bdljsn/operator_not_eq-0a.adoc[`operator!&equals;`]
| Same as the related overload above for `operator!&equals;`&period;
| xref:BloombergLP/bdljsn/operator_not_eq-0c0.adoc[`operator!&equals;`]
| Same as the related overload above for `operator!&equals;`&period;
| xref:BloombergLP/bdljsn/operator_not_eq-0d5.adoc[`operator!&equals;`]
| Same as the related overload above for `operator!&equals;`&period;
| xref:BloombergLP/bdljsn/operator_not_eq-0ee.adoc[`operator!&equals;`]
| Same as the related overload above for `operator!&equals;`&period;
| xref:BloombergLP/bdljsn/operator_not_eq-0f5.adoc[`operator!&equals;`]
| Same as the related overload above for `operator!&equals;`&period;
| xref:BloombergLP/bdljsn/operator_json.adoc[`operator&quot;&quot;&lowbar;json`]
| Return a `bdljsn&colon;&colon;Json` object from the specified JSON literal text&period;
| xref:BloombergLP/bdljsn/operator_eq-025.adoc[`operator&equals;&equals;`]
| Same as the related overload above for `operator&equals;&equals;`&period;
| xref:BloombergLP/bdljsn/operator_eq-02a.adoc[`operator&equals;&equals;`]
| Same as the related overload above for `operator&equals;&equals;`&period;
| xref:BloombergLP/bdljsn/operator_eq-03f.adoc[`operator&equals;&equals;`]
| Same as the related overload above for `operator&equals;&equals;`&period;
| xref:BloombergLP/bdljsn/operator_eq-040.adoc[`operator&equals;&equals;`]
| Same as the related overload above for `operator&equals;&equals;`&period;
| xref:BloombergLP/bdljsn/operator_eq-0482.adoc[`operator&equals;&equals;`]
| Same as the related overload above for `operator&equals;&equals;`&period;
| xref:BloombergLP/bdljsn/operator_eq-05f0.adoc[`operator&equals;&equals;`]
| Same as the related overload above for `operator&equals;&equals;`&period;
| xref:BloombergLP/bdljsn/operator_eq-060.adoc[`operator&equals;&equals;`]
| Same as the related overload above for `operator&equals;&equals;`&period;
| xref:BloombergLP/bdljsn/operator_eq-071.adoc[`operator&equals;&equals;`]
| Same as the related overload above for `operator&equals;&equals;`&period;
| xref:BloombergLP/bdljsn/operator_eq-077.adoc[`operator&equals;&equals;`]
| Same as the related overload above for `operator&equals;&equals;`&period;
| xref:BloombergLP/bdljsn/operator_eq-0844.adoc[`operator&equals;&equals;`]
| Same as the related overload above for `operator&equals;&equals;`&period;
| xref:BloombergLP/bdljsn/operator_eq-089.adoc[`operator&equals;&equals;`]
| Same as the related overload above for `operator&equals;&equals;`&period;
| xref:BloombergLP/bdljsn/operator_eq-0b.adoc[`operator&equals;&equals;`]
| Same as the related overload above for `operator&equals;&equals;`&period;
| xref:BloombergLP/bdljsn/operator_eq-0c8.adoc[`operator&equals;&equals;`]
| Same as the related overload above for `operator&equals;&equals;`&period;
| xref:BloombergLP/bdljsn/operator_eq-0cd.adoc[`operator&equals;&equals;`]
| Same as the related overload above for `operator&equals;&equals;`&period;
| xref:BloombergLP/bdljsn/operator_eq-0e1.adoc[`operator&equals;&equals;`]
| Same as the related overload above for `operator&equals;&equals;`&period;
| xref:BloombergLP/bdljsn/operator_eq-0f1.adoc[`operator&equals;&equals;`]
| Same as the related overload above for `operator&equals;&equals;`&period;
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
