#include <builder.h>
Public Member Functions | |
constexpr | JsonObject (const JsonObject &)=delete |
constexpr JsonObject & | operator= (const JsonObject &)=delete |
constexpr bool | IsValue () const |
constexpr bool | IsArray () const |
constexpr bool | IsObject () const |
constexpr | operator std::string_view () const |
constexpr const char * | data () const |
constexpr size_t | size () const |
constexpr size_t | max_size () const |
constexpr bool | ok () const |
constexpr Status | status () const |
constexpr Status | last_status () const |
constexpr void | clear () |
constexpr void | clear_status () |
template<typename T > | |
constexpr JsonObject & | Add (std::string_view key, const T &value) |
template<typename T > | |
constexpr JsonObject & | Add (std::nullptr_t, const T &value)=delete |
constexpr NestedJsonArray | AddNestedArray (std::string_view key) |
constexpr NestedJsonObject | AddNestedObject (std::string_view key) |
Friends | |
class | JsonBuilder |
Stores a JSON object: a sequence of key-value pairs. Provides functions for adding entries to the object, as well as the common functions for accessing the serialized data (see documentation for JsonBuilder
).
|
constexpr |
Adds a key-value pair to the JSON object. Updates the status.
It is an error to call Add()
if the underlying JsonBuilder
is no longer an object.
embed:rst:leading-asterisk * * .. pw-status-codes:: * * OK: The value was appended successfully. * * RESOURCE_EXHAUSTED: Insufficient buffer space to serialize. * *