#include <userver/formats/json/object.hpp>
Non-mutable JSON object representation.
This class is implemented in terms of formats::json::Value and cannot represent anything else but a JSON object. Use it when you need to explicitly state that only JSON object is expected.
Definition at line 20 of file object.hpp.
Inheritance diagram for formats::json::Object:Public Member Functions | |
| Object () | |
| Creates empty object. | |
| Object (const Value &value) | |
| Object (Value &&value) | |
| Object (ValueBuilder &&builder) | |
| Creates object extracting value from the builder. | |
| Object (const Object &)=default | |
| Object (Object &&) noexcept=default | |
| Object & | operator= (const Object &) &=default |
| Object & | operator= (Object &&) noexcept=default |
| const Value & | GetValue () const & |
| Returns formats::json::Value. | |
| Value && | ExtractValue () && |
| Returns formats::json::Value. | |
| Value | operator[] (std::size_t index) const =delete |
| bool | operator== (const Object &other) const |
| Compares values. | |
| bool | operator!= (const Object &other) const |
| Object | Clone () const |
| Returns a deep copy of object (see formats::json::Value::Clone). | |
| Value | operator[] (std::string_view key) const |
| bool | IsEmpty () const |
| std::size_t | GetSize () 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 |
| bool | HasMember (std::string_view key) 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 object |
Definition at line 26 of file object.hpp.
|
inlineexplicit |
| TypeMismatchException | if value is not an object |
Definition at line 29 of file object.hpp.
|
explicit |
Creates object extracting value from the builder.
| TypeMismatchException | if extracted value is not an object. |
| 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 |
|
inline |
Returns a deep copy of object (see formats::json::Value::Clone).
Definition at line 79 of file object.hpp.
| T formats::json::Value::ConvertTo | ( | ) | const |
| T formats::json::Value::ConvertTo | ( | First && | default_arg, |
| Rest &&... | more_default_args ) const |
|
inline |
Returns formats::json::Value.
Definition at line 45 of file object.hpp.
| std::string formats::json::Value::GetPath | ( | ) | const |
| std::size_t formats::json::Value::GetSize | ( | ) | const |
|
inline |
Returns formats::json::Value.
Definition at line 42 of file object.hpp.
| bool formats::json::Value::HasMember | ( | std::string_view | key | ) | const |
| bool formats::json::Value::IsEmpty | ( | ) | const |
|
noexcept |
|
inline |
Definition at line 61 of file object.hpp.
|
inline |
Compares values.
Definition at line 60 of file object.hpp.
| Value formats::json::Value::operator[] | ( | std::string_view | key | ) | const |