A JSON value (RFC 8259): null, bool, number, string, array or object.
More...
#include <gui_core/gui_json.h>
|
| static Result< JsonValue > | Parse (std::string_view text) |
| | Parses JSON Text. Nesting deeper than 64 is an error, not a stack overflow.
|
| bool | IsNull () const |
| | True when the value is of that type.
|
| bool | IsBool () const |
| | True when the value is of that type.
|
| bool | IsNumber () const |
| | True when the value is of that type.
|
| bool | IsString () const |
| | True when the value is of that type.
|
| bool | IsArray () const |
| | True when the value is of that type.
|
| bool | IsObject () const |
| | True when the value is of that type.
|
| bool | AsBool (bool fallback=false) const |
| | The value, or fallback when it is of another type.
|
| double | AsNumber (double fallback=0.0) const |
| | The value, or fallback when it is of another type.
|
| const std::string & | AsString () const |
| | The string, array items or object members; empty when the value is of another type.
|
| const Array & | Items () const |
| | The string, array items or object members; empty when the value is of another type.
|
| const Object & | Members () const |
| | The string, array items or object members; empty when the value is of another type.
|
| JsonValue & | Set (std::string_view key, JsonValue value) |
| | Set adds or replaces an object's member, Push appends to an array.
|
| JsonValue & | Push (JsonValue value) |
| | Set adds or replaces an object's member, Push appends to an array.
|
| static JsonValue | MakeArray () |
| | An empty array / object, to fill with Push / Set.
|
| static JsonValue | MakeObject () |
| | An empty array / object, to fill with Push / Set.
|
A JSON value (RFC 8259): null, bool, number, string, array or object.
Objects keep their members in order, so what is written reads back the same.
◆ Array
◆ Object
◆ MakeArray()
An empty array / object, to fill with Push / Set.
◆ MakeObject()
An empty array / object, to fill with Push / Set.
◆ Parse()
Parses JSON Text. Nesting deeper than 64 is an error, not a stack overflow.
◆ Write()
| std::string tachyon::JsonValue::Write |
( |
| ) |
const |
Compact JSON text (no whitespace); NaN and infinity are written as null.
◆ IsNull()
| bool tachyon::JsonValue::IsNull |
( |
| ) |
const |
|
inline |
True when the value is of that type.
◆ IsBool()
| bool tachyon::JsonValue::IsBool |
( |
| ) |
const |
|
inline |
True when the value is of that type.
◆ IsNumber()
| bool tachyon::JsonValue::IsNumber |
( |
| ) |
const |
|
inline |
True when the value is of that type.
◆ IsString()
| bool tachyon::JsonValue::IsString |
( |
| ) |
const |
|
inline |
True when the value is of that type.
◆ IsArray()
| bool tachyon::JsonValue::IsArray |
( |
| ) |
const |
|
inline |
True when the value is of that type.
◆ IsObject()
| bool tachyon::JsonValue::IsObject |
( |
| ) |
const |
|
inline |
True when the value is of that type.
◆ AsBool()
| bool tachyon::JsonValue::AsBool |
( |
bool | fallback = false | ) |
const |
|
inline |
The value, or fallback when it is of another type.
◆ AsNumber()
| double tachyon::JsonValue::AsNumber |
( |
double | fallback = 0.0 | ) |
const |
|
inline |
The value, or fallback when it is of another type.
◆ AsString()
| const std::string & tachyon::JsonValue::AsString |
( |
| ) |
const |
The string, array items or object members; empty when the value is of another type.
◆ Items()
| const Array & tachyon::JsonValue::Items |
( |
| ) |
const |
The string, array items or object members; empty when the value is of another type.
◆ Members()
| const Object & tachyon::JsonValue::Members |
( |
| ) |
const |
The string, array items or object members; empty when the value is of another type.
◆ Find()
| const JsonValue * tachyon::JsonValue::Find |
( |
std::string_view | key | ) |
const |
An object's member by name, or null when absent (or not an object).
◆ Set()
Set adds or replaces an object's member, Push appends to an array.
A value of another type is replaced by an empty object / array first. Both return the stored value.
◆ Push()
Set adds or replaces an object's member, Push appends to an array.
A value of another type is replaced by an empty object / array first. Both return the stored value.
The documentation for this class was generated from the following file: