Function

Jsonconstruct_gobject

Declaration [src]

GObject*
json_construct_gobject (
  GType gtype,
  const gchar* data,
  gsize length,
  GError** error
)

Description [src]

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

If the given type implements the JsonSerializable 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.

Available since:0.4
Deprecated since:0.10

Use json_gobject_from_data() instead.

Parameters

gtype GType
 

The type of the object to construct.

data const gchar*
 

A JSON data stream.

 The data is owned by the caller of the function.
 The string is a NUL terminated UTF-8 string.
length gsize
 

Length of the data stream.

error GError **
  The return location for a GError*, or NULL.

Return value

Returns: GObject*
 

A new object instance of the given type.

 The caller of the function takes ownership of the data, and is responsible for freeing it.
 The return value can be NULL.