Top | ![]() |
![]() |
![]() |
![]() |
GITypeInfo represents a type. You can retrieve a type info from an argument (see GIArgInfo), a functions return value (see GIFunctionInfo), a field (see GIFieldInfo), a property (see GIPropertyInfo), a constant (see GIConstantInfo) or for a union discriminator (see GIUnionInfo).
A type can either be a of a basic type which is a standard C primitive
type or an interface type. For interface types you need to call
g_type_info_get_interface()
to get a reference to the base info for that
interface.
#define G_TYPE_TAG_IS_BASIC(tag) (tag < GI_TYPE_TAG_ARRAY || tag == GI_TYPE_TAG_UNICHAR)
const gchar *
g_type_tag_to_string (GITypeTag type
);
Obtain a string representation of type
gboolean
g_type_info_is_pointer (GITypeInfo *info
);
Obtain if the type is passed as a reference.
GITypeTag
g_type_info_get_tag (GITypeInfo *info
);
Obtain the type tag for the type. See GITypeTag for a list of type tags.
GITypeInfo * g_type_info_get_param_type (GITypeInfo *info
,gint n
);
Obtain the parameter type n
.
GIBaseInfo *
g_type_info_get_interface (GITypeInfo *info
);
For types which have GI_TYPE_TAG_INTERFACE such as GObjects and boxed values,
this function returns full information about the referenced type. You can then
inspect the type of the returned GIBaseInfo to further query whether it is
a concrete GObject, a GInterface, a structure, etc. using g_base_info_get_type()
.
gint
g_type_info_get_array_length (GITypeInfo *info
);
Obtain the array length of the type. The type tag must be a GI_TYPE_TAG_ARRAY or -1 will returned.
gint
g_type_info_get_array_fixed_size (GITypeInfo *info
);
Obtain the fixed array size of the type. The type tag must be a GI_TYPE_TAG_ARRAY or -1 will returned.
gboolean
g_type_info_is_zero_terminated (GITypeInfo *info
);
Obtain if the last element of the array is NULL
. The type tag must be a
GI_TYPE_TAG_ARRAY or FALSE
will returned.
GIArrayType
g_type_info_get_array_type (GITypeInfo *info
);
Obtain the array type for this type. See GIArrayType for a list of possible values. If the type tag of this type is not array, -1 will be returned.
The type of array in a GITypeInfo.
The type tag of a GITypeInfo.
void |
||
boolean |
||
8-bit signed integer |
||
8-bit unsigned integer |
||
16-bit signed integer |
||
16-bit unsigned integer |
||
32-bit signed integer |
||
32-bit unsigned integer |
||
64-bit signed integer |
||
64-bit unsigned integer |
||
float |
||
double floating point |
||
a GType |
||
a UTF-8 encoded string |
||
a filename, encoded in the same encoding as the native filesystem is using. |
||
an array |
||
an extended interface object |
||
a GList |
||
a GSList |
||
a GError |
||
Unicode character |