bpf::json::Json::Array class

Represents a Json Array

Public types

using Iterator = collection::List<Json>::Iterator
using ReverseIterator = collection::List<Json>::ReverseIterator
using CIterator = collection::List<Json>::CIterator
using CReverseIterator = collection::List<Json>::CReverseIterator

Constructors, destructors, conversion operators

Array()
Array(const std::initializer_list<Json>& vals) explicit
Array(const collection::List<Json>& vals) explicit
Array(collection::List<Json>&& vals) explicit

Public functions

void Add(const Json& json)
void Add(Json&& data)
void RemoveAt(const fsize id)
auto operator[](const fsize id) -> Json&
auto operator[](const fsize id) const -> const Json&
auto Size() const -> fsize noexcept
auto begin() const -> CIterator
auto end() const -> CIterator
auto begin() -> Iterator
auto end() -> Iterator
auto rbegin() const -> CReverseIterator
auto rend() const -> CReverseIterator
auto rbegin() -> ReverseIterator
auto rend() -> ReverseIterator

Public variables

collection::List<Json> Items

Function documentation

bpf::json::Json::Array::Array()

Constructs an empty array

bpf::json::Json::Array::Array(const std::initializer_list<Json>& vals) explicit

Parameters
vals the initial list of items to add to this new Array

Constructs an Array from an existing initializer list

bpf::json::Json::Array::Array(const collection::List<Json>& vals) explicit

Parameters
vals the list to construct from

Constructs an Array from an existing List

bpf::json::Json::Array::Array(collection::List<Json>&& vals) explicit

Parameters
vals the list to construct from

Constructs an Array from an existing List

void bpf::json::Json::Array::Add(const Json& json)

Parameters
json the new value to append

Adds a new item at the end of the array

void bpf::json::Json::Array::Add(Json&& data)

Parameters
data the new value to append

Adds a new item at the end of the array

void bpf::json::Json::Array::RemoveAt(const fsize id)

Parameters
id the index of the item to remove

Remove an item at a given index

Json& bpf::json::Json::Array::operator[](const fsize id)

Parameters
id the index of the element, in case of out of bounds, throws
Returns mutable item at index id
Exceptions
IndexException if id is out of bounds

Returns an element non-const mode

const Json& bpf::json::Json::Array::operator[](const fsize id) const

Parameters
id the index of the element, in case of out of bounds, throws
Returns immutable item at index id
Exceptions
IndexException if id is out of bounds

Returns an element const mode

fsize bpf::json::Json::Array::Size() const noexcept

Returns number of items as unsigned

Returns the number of items in this list

CIterator bpf::json::Json::Array::begin() const

Returns new iterator

Returns an iterator to the begining of the collection

CIterator bpf::json::Json::Array::end() const

Returns new iterator

Returns an iterator to the end of the collection

Iterator bpf::json::Json::Array::begin()

Returns new iterator

Returns an iterator to the begining of the collection

Iterator bpf::json::Json::Array::end()

Returns new iterator

Returns an iterator to the end of the collection

CReverseIterator bpf::json::Json::Array::rbegin() const

Returns new iterator

Returns a reverse iterator to the begining of the collection

CReverseIterator bpf::json::Json::Array::rend() const

Returns new iterator

Returns a reverse iterator to the end of the collection

ReverseIterator bpf::json::Json::Array::rbegin()

Returns new iterator

Returns a reverse iterator to the begining of the collection

ReverseIterator bpf::json::Json::Array::rend()

Returns new iterator

Returns a reverse iterator to the end of the collection

Variable documentation

collection::List<Json> bpf::json::Json::Array::Items

Array content