Function

Json-1.0Jsonconstruct_gobjectDeprecated 0.10Since 0.4

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

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

    Type Parameters

    Parameters

    • Deprecatedgtype: GType

      the type of the object to construct

    • Deprecateddata: string

      a JSON data stream

    • Deprecatedlength: number

      length of the data stream (unused)

    Returns T

    a new object instance of the given type

    0.4

    since 0.10: Use Json.gobject_from_data instead