template<class T>
Corrade::Utility::JsonView class new in Git master

JSON object and array view.

Returned from Json::parseObject(), Json::parseArray(), JsonToken::asObject() and JsonToken::asArray(). See Iterating objects and arrays for more information.

Public functions

auto begin() const -> JsonIterator<T>
Iterator to the first element.
auto cbegin() const -> JsonIterator<T>
auto end() const -> JsonIterator<T>
Iterator to (one item after) the last element.
auto cend() const -> JsonIterator<T>
auto find(typename T::KeyType key) const -> const JsonToken*
Find an object value by key or an array value by index.
auto operator[](typename T::KeyType key) const -> const JsonToken&
Access an object value by key or an array value by index.

Function documentation

template<class T>
JsonIterator<T> Corrade::Utility::JsonView<T>::cbegin() const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

template<class T>
JsonIterator<T> Corrade::Utility::JsonView<T>::cend() const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

template<class T>
const JsonToken* Corrade::Utility::JsonView<T>::find(typename T::KeyType key) const

Find an object value by key or an array value by index.

Calls JsonToken::find(Containers::StringView) const or JsonToken::find(std::size_t) const on the enclosing object or array token. Useful for performing a lookup directly on the value returned from Json::parseObject() or Json::parseArray().

template<class T>
const JsonToken& Corrade::Utility::JsonView<T>::operator[](typename T::KeyType key) const

Access an object value by key or an array value by index.

Calls JsonToken::operator[](Containers::StringView) const or JsonToken::operator[](std::size_t) const on the enclosing object or array token. Useful for performing a lookup directly on the value returned from Json::parseObject() or Json::parseArray().