Open Lighting Architecture
0.9.5
|
Represents a JSON text as defined in section 2 of RFC7158.
JsonData encapsulates a JsonValue and permits patch operations to be applied.
Clients should use this rather than JsonValues when using JSON patch operations. This is because some patch ops may delete the entire value, so you shouldn't really be passing JsonValue* around.
Public Member Functions | |
JsonData (const JsonValue *value, ValidatorInterface *schema=NULL) | |
Construct a new JsonData. | |
const JsonValue * | Value () const |
Return the JsonValue for this text. | |
bool | SetValue (JsonValue *value) |
Set the value for this JsonData. | |
bool | Apply (const JsonPatchSet &patch) |
Apply a set of JSON patches to the value. | |
const ValidatorInterface * | GetSchema () const |
Return the schema for this JSON data. |
|
inline |
bool ola::web::JsonData::Apply | ( | const JsonPatchSet & | patch | ) |
Apply a set of JSON patches to the value.
patch | The set of JsonPatch operations to apply. |
bool ola::web::JsonData::SetValue | ( | JsonValue * | value | ) |
|
inline |
Return the JsonValue for this text.
The pointer is valid until the next patch operation or call to SetValue()