interfaces


Description:

[ CCode ( array_length_type = "guint" ) ]
public Type[] interfaces ()

Return a newly allocated and 0-terminated array of type IDs, listing the interface types that type conforms to.

Example: Get a list of implemented interfaces:

public interface InterfaceA : Object {}
public interface InterfaceB : Object {}
public abstract class AbstractGObject : Object, InterfaceA, InterfaceB {}

public static int main (string[] args) {
// Output:
// `` - InterfaceA``
// `` - InterfaceB``
Type type = typeof (AbstractGObject);
foreach (unowned Type ch in type.interfaces ()) {
print (" - %s\n", ch.name ());
}

return 0;
}

valac --pkg gobject-2.0 GLib.Type.interfaces.vala

Parameters:

n_interfaces

location to store the length of the returned array, or null

type

the type to list interface types for

Returns:

Newly allocated and 0-terminated array of interface types, free with g_free