Pigweed
 
Loading...
Searching...
No Matches
pw::JsonBuffer< kMaxSize > Class Template Referencefinal

#include <builder.h>

Inheritance diagram for pw::JsonBuffer< kMaxSize >:
pw::JsonBuilder pw::JsonValue pw::JsonArray pw::JsonObject

Public Member Functions

constexpr JsonBuffer (const JsonBuffer &other)
 
template<size_t kOtherSize>
constexpr JsonBuffer (const JsonBuffer< kOtherSize > &other)
 
constexpr JsonBufferoperator= (const JsonBuffer &rhs)
 
template<size_t kOtherSize>
constexpr JsonBufferoperator= (const JsonBuffer< kOtherSize > &rhs)
 
- Public Member Functions inherited from pw::JsonBuilder
constexpr JsonBuilder (span< char > buffer)
 Initializes to the value null. buffer.size() must be at least 5.
 
constexpr JsonBuilder (char *buffer, size_t buffer_size)
 Initializes to the value null. buffer_size must be at least 5.
 
constexpr bool IsValue () const
 True if the top-level JSON entity is a simple value (not array or object).
 
constexpr bool IsArray () const
 True if the top-level JSON entity is an array.
 
constexpr bool IsObject () const
 True if the top-level JSON entity is an object.
 
constexpr operator std::string_view () const
 JsonBuilder converts to std::string_view.
 
constexpr const char * data () const
 Pointer to the serialized JSON, which is always a null-terminated string.
 
constexpr size_t size () const
 The current size of the JSON string, excluding the null terminator.
 
constexpr size_t max_size () const
 The maximum size of the JSON string, excluding the null terminator.
 
constexpr bool ok () const
 True if.
 
constexpr Status status () const
 
constexpr Status last_status () const
 
constexpr void clear ()
 Sets the JSON null and clears the status.
 
constexpr void clear_status ()
 Resets status() and last_status().
 
template<typename T >
constexpr Status SetValue (const T &value)
 Clears the JSON and sets it to a single JSON value (see JsonValue::Set).
 
constexpr JsonValueStartValue ()
 
constexpr JsonArrayStartArray ()
 
constexpr JsonObjectStartObject ()
 

Static Public Member Functions

template<typename T >
static constexpr JsonBuffer Value (const T &initial_value)
 
static constexpr size_t max_size ()
 
- Static Public Member Functions inherited from pw::JsonBuilder
static constexpr size_t MinBufferSize ()
 JsonBuilder requires at least 5 characters in its buffer.
 

Additional Inherited Members

- Protected Types inherited from pw::JsonBuilder
enum class  Uninitialized
 
- Protected Member Functions inherited from pw::JsonBuilder
constexpr JsonBuilder (char *buffer, size_t buffer_size, Uninitialized)
 
constexpr void MakeNull ()
 
constexpr void set_json_size (size_t json_size)
 
constexpr void set_statuses (Status status, Status last_status)
 

Detailed Description

template<size_t kMaxSize>
class pw::JsonBuffer< kMaxSize >

A JsonBuilder with an integrated buffer. The buffer will be sized to fit kMaxSize characters.


The documentation for this class was generated from the following file: