gvariantDeserialize
fn
glib.variant.Variant gvariantDeserialize(json.node.Node jsonNode, string signature = null)Converts a JSON data structure to a [glib.variant.Variant].
If signature is not NULL, it will be used to resolve ambiguous data types.
If no error occurs, the resulting [glib.variant.Variant] is guaranteed to conform to signature.
If signature is not NULL but does not represent a valid [glib.variant.Variant] type string, NULL is returned and the error is set to [gio.types.IOErrorEnum.InvalidArgument].
If a signature is provided but the JSON structure cannot be mapped to it, NULL is returned and the error is set to [gio.types.IOErrorEnum.InvalidData].
If signature is NULL, the conversion is done based strictly on the types in the JSON nodes.
The returned variant has a floating reference that will need to be sunk by the caller code.
Parameters
jsonNode | the node to convert |
signature | a valid [glib.variant.Variant] type string |
Returns
A newly created [glib.variant.Variant]
Throws
[ErrorWrap]