BloombergLP::bdljsn::Json

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>

class Json;

Member Functions

NameDescription
Json [constructor]Constructors
operator= Assignment operators
allocator Return the allocator used by this object to allocate memory.
asDecimal64 Return the closest Decimal64 representation of this number.
asDecimal64Exact Load result with the closest Decimal64 representation of this number.
asDouble Return the closest double representation of this number.
asFloat Return the closest float representation of this number.
asInt Same as the related overload above for asInt.
asInt64 Same as the related overload above for asInt64.
asLong Same as the related overload above for asLong.
asLonglong Same as the related overload above for asLonglong.
asShort Load result with the integer value of this number.
asUint Same as the related overload above for asUint.
asUint64 Same as the related overload above for asUint64.
asUlong Same as the related overload above for asUlong.
asUlonglong Same as the related overload above for asUlonglong.
asUshort Same as the related overload above for asUshort.
contains Return whether the held object contains a member with key.
insert insert overloads
isArray Return true if the value held by this object is of type JsonArray, and false otherwise.
isBoolean Return true if the value held by this object is of type bool, and false otherwise.
isNull Return true if the value held by this object is of type JsonNull, and false otherwise.
isNumber Return true if the value held by this object is of type JsonNumber, and false otherwise.
isObject Return true if the value held by this object is of type JsonObject, and false otherwise.
isString Return true if the value held by this object is of type bsl::string, and false otherwise.
makeArray makeArray overloads
makeBoolean makeBoolean overloads
makeNull Create an instance of type JsonNull in this object. This method first destroys the current value held by this object.
makeNumber makeNumber overloads
makeObject makeObject overloads
makeString makeString overloads
operator[] Subscript operators
print Write this value to the specified output stream in a human-readable format.
pushBack pushBack overloads
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.
swap Exchange the value of this object with that of other.
theArray theArray overloads
theBoolean theBoolean overloads
theNull theNull overloads
theNumber theNumber overloads
theObject theObject overloads
theString Return a non-modifiable reference to the held string.
type Return the type of this Json value.
visit Invoke visitor on the value held by this object.
operator BloombergLP::bslmf::NestedTraitDeclaration<Json, HasPrintMethod> Declare that this type uses a bslma allocator.
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.
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.
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.
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.
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.
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.
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.
operator JsonNumber const& Return a non-modifiable reference to the held JsonNumber.
operator JsonObject const& Return a non-modifiable reference to the held JsonObject.
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.
operator bsl::string const& Return a non-modifiable reference to the held string.

Friends

NameDescription
BloombergLP::bdljsn::swapExchange the values of the specified a and b objects.
BloombergLP::bdljsn::operator!=Return whether lhs and rhs do not have the same value.
BloombergLP::bdljsn::operator==Return whether lhs and rhs have the same value.

Non-Member Functions

NameDescription
operator!=Same as the related overload above for operator!=.
operator!=Same as the related overload above for operator!=.
operator!=Same as the related overload above for operator!=.
operator!=Same as the related overload above for operator!=.
operator!=Same as the related overload above for operator!=.
operator!=Same as the related overload above for operator!=.
operator!=Same as the related overload above for operator!=.
operator!=Same as the related overload above for operator!=.
operator!=Same as the related overload above for operator!=.
operator!=Same as the related overload above for operator!=.
operator!=Same as the related overload above for operator!=.
operator!=Same as the related overload above for operator!=.
operator!=Same as the related overload above for operator!=.
operator!=Same as the related overload above for operator!=.
operator!=Same as the related overload above for operator!=.
operator!=Same as the related overload above for operator!=.
operator""_jsonReturn a bdljsn::Json object from the specified JSON literal text.
operator==Same as the related overload above for operator==.
operator==Same as the related overload above for operator==.
operator==Same as the related overload above for operator==.
operator==Same as the related overload above for operator==.
operator==Same as the related overload above for operator==.
operator==Same as the related overload above for operator==.
operator==Same as the related overload above for operator==.
operator==Same as the related overload above for operator==.
operator==Same as the related overload above for operator==.
operator==Same as the related overload above for operator==.
operator==Same as the related overload above for operator==.
operator==Same as the related overload above for operator==.
operator==Same as the related overload above for operator==.
operator==Same as the related overload above for operator==.
operator==Same as the related overload above for operator==.
operator==Same as the related overload above for operator==.