is_a


Description:

public bool is_a (Type is_a_type)

If is_a_type is a derivable type, check whether type is a descendant of is_a_type.

If is_a_type is an interface, check whether type conforms to it.

Example: Check whether type is a descendant of another:

public interface Interface : Object {}

public static int main (string[] args) {
// Output: ``true``
bool tmp = typeof (Interface).is_a (typeof (Object));
print ("%s\n", tmp.to_string ());

// Output: ``false``
tmp = typeof (Object).is_a (typeof (Interface));
print ("%s\n", tmp.to_string ());
return 0;
}

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

Parameters:

is_a_type

possible ancestor of type or interface that type could conform to

type

type to check ancestry for

Returns:

true if type is a is_a_type




2022 vala-language.org