[g-ir-generate] Write out array type

For GLib arrays, write out the array type to the tgir
This commit is contained in:
Johan Dahlin 2010-05-27 00:17:56 -03:00 committed by Philip Withnall
parent ecd9c2f3e7
commit a9a3352d8a

View File

@ -221,9 +221,29 @@ write_type_info (const gchar *namespace,
else if (tag == GI_TYPE_TAG_ARRAY) else if (tag == GI_TYPE_TAG_ARRAY)
{ {
gint length, size; gint length, size;
char *name = NULL;
xml_start_element (file, "array"); xml_start_element (file, "array");
switch (g_type_info_get_array_type (info)) {
case GI_ARRAY_TYPE_C:
break;
case GI_ARRAY_TYPE_ARRAY:
name = "GLib.Array";
break;
case GI_ARRAY_TYPE_PTR_ARRAY:
name = "GLib.PtrArray";
break;
case GI_ARRAY_TYPE_BYTE_ARRAY:
name = "GLib.ByteArray";
break;
default:
break;
}
if (name)
xml_printf (file, " name=\"%s\"", name);
type = g_type_info_get_param_type (info, 0); type = g_type_info_get_param_type (info, 0);
length = g_type_info_get_array_length (info); length = g_type_info_get_array_length (info);