Method
GLibStrvBuilderunref_to_strv
since: 2.82
Declaration [src]
GStrv
g_strv_builder_unref_to_strv (
GStrvBuilder* builder
)
Description [src]
Decreases the reference count on the string vector builder, and returns
its contents as a NULL
-terminated string array.
This function is especially useful for cases where it’s not possible
to use g_autoptr()
.
GStrvBuilder *builder = g_strv_builder_new ();
g_strv_builder_add (builder, "hello");
g_strv_builder_add (builder, "world");
GStrv array = g_strv_builder_unref_to_strv (builder);
g_assert_true (g_strv_equal (array, (const char *[]) { "hello", "world", NULL }));
g_strfreev (array);
Available since: 2.82