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>

class JsonObject;

Type Aliases

Name

Description

ConstIterator

This typedef is an alias for ConstIterator.

Iterator

This typedef is an alias for Iterator.

IteratorAndStatus

This typedef is an alias for IteratorAndStatus.

Member

This typedef is an alias for Member.

const_iterator

This typedef is an alias for const_iterator.

const_reference

This typedef is an alias to Container::const_reference.

difference_type

This typedef is an alias to Container::difference_type.

iterator

This typedef is an alias for iterator.

reference

This typedef is an alias for reference.

size_type

This typedef is an alias for size_type.

value_type

This typedef is an alias for value_type.

Member Functions

Name

Description

JsonObject [constructor]

Constructors

operator=

Assignment operators

allocator

Return the allocator used by this object to allocate memory.

begin

begin overloads

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.

cend

Same as the related overload above for cend.

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.

contains

Return true if there is a Member object in this JsonObject with a key equivalent to the specified key, and return false otherwise.

empty

Return true if this JsonObject contains no elements, and false otherwise.

end

end overloads

erase

erase overloads

find

find overloads

insert

insert overloads

operator[]

Subscript operators

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.

size

Return the number of elements in this JsonObject.

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.

operator BloombergLP::bslmf::NestedTraitDeclaration<JsonObject, HasPrintMethod>

Process the specified object during visitation of a bdljsn::Json object.

Friends

Name

Description

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.

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.

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

Name

Description

operator!=

Process the specified object during visitation of a bdljsn::Json object.

operator==

Process the specified object during visitation of a bdljsn::Json object.

Created with MrDocs