* garrow_struct_array_get_field * @array: A #GArrowStructArray. * @i: The index of the field in the struct. * * Returns: (transfer full): The i-th field. */
| 1007 | * Returns: (transfer full): The i-th field. |
| 1008 | */ |
| 1009 | GArrowArray * |
| 1010 | garrow_struct_array_get_field(GArrowStructArray *array, gint i) |
| 1011 | { |
| 1012 | auto fields = garrow_struct_array_get_fields_internal(array); |
| 1013 | if (i < 0) { |
| 1014 | i += fields->len; |
| 1015 | } |
| 1016 | if (i < 0) { |
| 1017 | return NULL; |
| 1018 | } |
| 1019 | if (i >= static_cast<gint>(fields->len)) { |
| 1020 | return NULL; |
| 1021 | } |
| 1022 | auto field = static_cast<GArrowArray *>(g_ptr_array_index(fields, i)); |
| 1023 | g_object_ref(field); |
| 1024 | return field; |
| 1025 | } |
| 1026 | |
| 1027 | /** |
| 1028 | * garrow_struct_array_get_fields |
nothing calls this directly
no test coverage detected