JsonObject
Object Hierarchy:
Description:
[ CCode ( has_type_id = false ) ]
[ Compact ]
public class JsonObject
A JSON object.
See also: [struct@FwupdJsonArray] [struct@FwupdJsonNode]
Content:
Methods:
- public void add_array (string key, JsonArray json_arr)
Adds an array to the JSON object.
- public void add_array_strv (string key, string value)
Adds a string array to the JSON object.
- public void add_boolean (string key, bool value)
Adds a boolean value to the JSON object.
- public void add_bytes (string key, Bytes value)
Adds bytes to the JSON object.
- public void add_integer (string key, int64 value)
Adds an integer value to the JSON object.
- public void add_node (string key, JsonNode json_node)
Adds a node to the JSON object.
- public void add_object (string key, JsonObject json_obj)
Adds a different object to the JSON object.
- public void add_object_map (string key, HashTable<string,string> value)
Adds a string:string object to the JSON object.
- public void add_raw (string key, string value)
Adds a raw value to the JSON object.
- public void add_string (string key, string? value)
Adds a string value to the JSON object.
- public void clear ()
Clears the member data for the JSON object, but does not affect the
refcount.
- public bool get_boolean (string key, out bool value) throws Error
Gets a boolean from a JSON object.
- public bool get_boolean_with_default (string key, out bool value, bool value_default) throws Error
Gets a boolean from a JSON object.
- public bool get_integer (string key, out int64 value) throws Error
Gets an integer from a JSON object.
- public bool get_integer_with_default (string key, out int64 value, int64 value_default) throws Error
Gets an integer from a JSON object.
- public uint get_size ()
Gets the size of the JSON object.
- public unowned string get_string_with_default (string key, string value_default) throws Error
Gets a string from a JSON object.
- public Bytes to_bytes (JsonExportFlags flags)
Converts the JSON object to UTF-8 bytes.
- public StringBuilder to_string (JsonExportFlags flags)
Converts the JSON object to a string representation.