Pigweed
C/C++ API Reference
|
Public Member Functions | |
constexpr | JsonBuffer (const JsonBuffer &other) |
template<size_t kOtherSize> | |
constexpr | JsonBuffer (const JsonBuffer< kOtherSize > &other) |
constexpr JsonBuffer & | operator= (const JsonBuffer &rhs) |
template<size_t kOtherSize> | |
constexpr JsonBuffer & | operator= (const JsonBuffer< kOtherSize > &rhs) |
![]() | |
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 JsonValue & | StartValue () |
constexpr JsonArray & | StartArray () |
constexpr JsonObject & | StartObject () |
Static Public Member Functions | |
template<typename T > | |
static constexpr JsonBuffer | Value (const T &initial_value) |
static constexpr size_t | max_size () |
![]() | |
static constexpr size_t | MinBufferSize () |
JsonBuilder requires at least 5 characters in its buffer. | |
Additional Inherited Members | |
![]() | |
enum class | Uninitialized |
![]() | |
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) |
A JsonBuilder
with an integrated buffer. The buffer will be sized to fit kMaxSize
characters.