gvariant_deserialize_data


Description:

[ CCode ( returns_floating_reference = true ) ]
[ Version ( since = "0.14" ) ]
public Variant? gvariant_deserialize_data (string json, ssize_t length, string? signature) throws Error

Converts a JSON string to a `GVariant` value.

This function works exactly like [func@Json.gvariant_deserialize], but takes a JSON encoded string instead.

The string is first converted to a [struct@Json.Node] using [class@Json.Parser], and then `json_gvariant_deserialize` is called on the node.

The returned variant has a floating reference that will need to be sunk by the caller code.

Parameters:

json

A JSON data string

length

The length of json, or -1 if `NUL`-terminated

signature

A valid `GVariant` type string

Returns:

A newly created `GVariant`D compliant


Namespace: Json
Package: json-glib-1.0