|
brace
Incredibly simple JSON parser in C++
|
Represents a flexible JSON value that can hold different types of data. More...
#include <brace.h>
Public Types | |
| using | Value |
| Internal type definition for storing different JSON value types. | |
Public Member Functions | |
| JsonValue () | |
| Default constructor. Creates a null JSON value. | |
| JsonValue (bool b) | |
| Constructs a JSON value from a boolean. | |
| JsonValue (double d) | |
| Constructs a JSON value from a numeric value. | |
| JsonValue (const std::string &s) | |
| Constructs a JSON value from a string. | |
| JsonValue (const JsonObject &obj) | |
| Constructs a JSON value from an object (map of key-value pairs). | |
| JsonValue (const JsonArray &arr) | |
| Constructs a JSON value from an array. | |
| bool | is_null () const |
| Checks if the current value is null. | |
| bool | is_bool () const |
| Checks if the current value is a boolean. | |
| bool | is_number () const |
| Checks if the current value is a number. | |
| bool | is_string () const |
| Checks if the current value is a string. | |
| bool | is_object () const |
| Checks if the current value is an object. | |
| bool | is_array () const |
| Checks if the current value is an array. | |
| const Value & | value () const |
| Retrieves the internal variant value. | |
| operator std::string () const | |
| Converts the JsonValue to a string. | |
| operator int () const | |
| Converts the JsonValue to an integer. | |
| operator double () const | |
| Converts the JsonValue to a double. | |
| operator float () const | |
| Converts the JsonValue to a float. | |
| operator size_t () const | |
| Converts the JsonValue to an size_t. | |
| operator bool () const | |
| Converts the JsonValue to a bool. | |
| const JsonArray & | to_array () const |
| Retrieves the array value of the JsonValue. | |
| bool | operator== (const std::string &other) const |
| Compares the JsonValue with a string. | |
| bool | operator== (const char *other) const |
| Compares the JsonValue with a C-style string. | |
| bool | operator== (double other) const |
| Compares the JsonValue with a double. | |
| bool | operator== (int other) const |
| Compares the JsonValue with an integer. | |
| const JsonValue & | operator[] (const std::string &key) const |
| Accesses an object's value by string key. | |
| const JsonValue & | operator[] (const char *key) const |
| Accesses an object's value by C-style string key. | |
| const JsonValue & | operator[] (size_t index) const |
| Accesses an array's value by index. | |
Represents a flexible JSON value that can hold different types of data.
Supported JSON value types:
| using brace::JsonValue::Value |
Internal type definition for storing different JSON value types.
|
inline |
Constructs a JSON value from a boolean.
| b | The boolean value to store |
|
inline |
Constructs a JSON value from a numeric value.
| d | The numeric value to store (as a double) |
|
inline |
Constructs a JSON value from a string.
| s | The string to store |
|
inline |
Constructs a JSON value from an object (map of key-value pairs).
| obj | The JSON object to store |
|
inline |
Constructs a JSON value from an array.
| arr | The JSON array to store |
|
inline |
Checks if the current value is an array.
|
inline |
Checks if the current value is a boolean.
|
inline |
Checks if the current value is null.
|
inline |
Checks if the current value is a number.
|
inline |
Checks if the current value is an object.
|
inline |
Checks if the current value is a string.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Retrieves the internal variant value.