#include <userver/formats/json/array.hpp>
Non-mutable JSON array representation.
This class is implemented in terms of formats::json::Value and cannot represent anything else but a JSON array. Use it when you need to explicitly state that only JSON array is expected.
Inheritance diagram for formats::json::Array:Public Types | |
| using | const_iterator |
| using | const_reverse_iterator |
Public Member Functions | |
| Array () | |
| Creates empty array. | |
| Array (const Value &value) | |
| Array (Value &&value) | |
| Array (ValueBuilder &&builder) | |
| Creates array extracting value from the builder. | |
| Array (const Array &)=default | |
| Array (Array &&) noexcept=default | |
| Array & | operator= (const Array &) &=default |
| Array & | operator= (Array &&) noexcept=default |
| const Value & | GetValue () const & |
| Returns formats::json::Value. | |
| Value && | ExtractValue () && |
| Returns formats::json::Value. | |
| Value | operator[] (std::string_view key) const =delete |
| bool | operator== (const Array &other) const |
| Compares values. | |
| bool | operator!= (const Array &other) const |
| Array | Clone () const |
| Returns a deep copy of array (see formats::json::Value::Clone). | |
| Value | operator[] (std::size_t index) const |
| const_iterator | begin () const |
| const_iterator | end () const |
| const_reverse_iterator | rbegin () const |
| const_reverse_iterator | rend () const |
| bool | IsEmpty () const |
| std::size_t | GetSize () const |
| void | CheckInBounds (std::size_t index) const |
| template<typename T> | |
| auto | As () const |
| template<typename T, typename First, typename... Rest> | |
| auto | As (First &&default_arg, Rest &&... more_default_args) const |
| template<typename T> | |
| auto | As (DefaultConstructed) const |
| template<typename T> | |
| T | ConvertTo () const |
| template<typename T, typename First, typename... Rest> | |
| T | ConvertTo (First &&default_arg, Rest &&... more_default_args) const |
| std::string | GetPath () const |
| bool | IsRoot () const noexcept |
Private Member Functions | |
| bool | operator== (const Value &other) const |
| Compares values. | |
| bool | operator!= (const Value &other) const |
|
inlineexplicit |
| TypeMismatchException | if value is not an array |
|
inlineexplicit |
| TypeMismatchException | if value is not an array |
|
explicit |
Creates array extracting value from the builder.
| TypeMismatchException | if extracted value is not an array. |
| auto formats::json::Value::As | ( | ) | const |
| auto formats::json::Value::As | ( | Value::DefaultConstructed | ) | const |
| auto formats::json::Value::As | ( | First && | default_arg, |
| Rest &&... | more_default_args ) const |
| const_iterator formats::json::Value::begin | ( | ) | const |
| void formats::json::Value::CheckInBounds | ( | std::size_t | index | ) | const |
|
inline |
Returns a deep copy of array (see formats::json::Value::Clone).
| T formats::json::Value::ConvertTo | ( | ) | const |
| T formats::json::Value::ConvertTo | ( | First && | default_arg, |
| Rest &&... | more_default_args ) const |
| const_iterator formats::json::Value::end | ( | ) | const |
|
inline |
Returns formats::json::Value.
| std::string formats::json::Value::GetPath | ( | ) | const |
| std::size_t formats::json::Value::GetSize | ( | ) | const |
|
inline |
Returns formats::json::Value.
| bool formats::json::Value::IsEmpty | ( | ) | const |
|
noexcept |
|
inline |
|
inline |
| Value formats::json::Value::operator[] | ( | std::size_t | index | ) | const |
| const_reverse_iterator formats::json::Value::rbegin | ( | ) | const |
| const_reverse_iterator formats::json::Value::rend | ( | ) | const |