JSON array value providing a sequence‐container‐like interface.

Synopsis

Declared in <bdljsn_json.h>

class JsonArray;

Description

This type is designed to replicate much of the standard sequence container interface, eliding interfaces that are less relevant for a non‐generic container. Note that a bsl::vector is chosen for the implementation because our implementation permits the element type to be incomplete (when just spelling the type name).

Type Aliases

Name

Description

ConstIterator

Iterator providing non‐modifiable access to elements.

Iterator

Iterator providing modifiable access to elements.

const_iterator

Iterator providing non‐modifiable access to elements.

const_reference

Reference providing non‐modifiable access to an element.

difference_type

Signed type used to represent distances between iterators.

iterator

Iterator providing modifiable access to elements.

reference

Reference providing modifiable access to an element.

size_type

Unsigned type used to represent sizes and indices.

value_type

Type of the elements stored in this array.

Member Functions

Name

Description

JsonArray [constructor]

Constructors

operator=

Assignment operators

allocator

Return the allocator used by this object to allocate memory.

assign

assign overloads

back

back overloads

begin

begin overloads

cbegin

Return a const iterator to the first member of this object.

cend

Return the past‐the‐end iterator providing non‐modifiable access to this JsonArray.

clear

Remove all elements from this array.

empty

Return true if this JsonArray has size 0, and false otherwise.

end

end overloads

erase

erase overloads

front

front overloads

insert

insert overloads

maxSize

Return a theoretical upper bound on this array's maximum size.

operator[]

Subscript operators

popBack

Erase the last element from this JsonArray. The behavior is undefined if this JsonArray is empty.

print

Write this value to the specified output stream in a human‐readable format.

pushBack

pushBack overloads

resize

resize overloads

size

Return the number of elements in this JsonArray.

swap

Exchange the value of this object with that of other.

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

Declare that this type uses a bslma allocator.

Friends

Name

Description

BloombergLP::bdljsn::swap

Exchange the values of the specified a and b arrays.

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

Name

Description

operator!=

Return whether lhs and rhs do not have the same value.

operator==

Return whether lhs and rhs have the same value.

Created with MrDocs