* gaflight_path_descriptor_get_paths: * @descriptor: A #GAFlightPathDescriptor. * * Returns: (nullable) (array zero-terminated=1) (transfer full): * The paths in this descriptor. * * It must be freed with g_strfreev() when no longer needed. * * Since: 5.0.0 */
| 468 | * Since: 5.0.0 |
| 469 | */ |
| 470 | gchar ** |
| 471 | gaflight_path_descriptor_get_paths(GAFlightPathDescriptor *descriptor) |
| 472 | { |
| 473 | const auto flight_descriptor = |
| 474 | gaflight_descriptor_get_raw(GAFLIGHT_DESCRIPTOR(descriptor)); |
| 475 | const auto &flight_paths = flight_descriptor->path; |
| 476 | if (flight_paths.empty()) { |
| 477 | return NULL; |
| 478 | } else { |
| 479 | auto paths = g_new(gchar *, flight_paths.size() + 1); |
| 480 | gsize i = 0; |
| 481 | for (const auto &flight_path : flight_paths) { |
| 482 | paths[i++] = g_strdup(flight_path.c_str()); |
| 483 | } |
| 484 | paths[i] = NULL; |
| 485 | return paths; |
| 486 | } |
| 487 | } |
| 488 | |
| 489 | G_DEFINE_TYPE(GAFlightCommandDescriptor, |
| 490 | gaflight_command_descriptor, |
nothing calls this directly
no test coverage detected