construct_gobject


Description:


[ Version ( deprecated = true , deprecated_since = "0.10" , replacement = "Json.gobject_from_data" , since = "0.4" ) ]
public Object? construct_gobject (Type gtype, string data, size_t length) throws Error

Warning: construct_gobject is deprecated since 0.10. Use Json.gobject_from_data.

Deserializes a JSON data stream and creates an instance of the given type.

Note:

Use [func@Json.gobject_from_data] instead

If the given type implements the [iface@Json.Serializable] interface, it will be asked to deserialize all the JSON members into their respective properties; otherwise, the default implementation will be used to translate the compatible JSON native types.

**Note**: the JSON data stream must be an object.

For historical reasons, the `length` argument is unused. The given `data` must be a `NUL`-terminated string.

Parameters:

gtype

the type of the object to construct

data

a JSON data stream

length

length of the data stream (unused)

Returns:

a new object instance of the given type


Namespace: Json
Package: json-glib-1.0