glib.strv_builder
Module for [StrvBuilder] class
class StrvBuilder
Types 1
classStrvBuilder : gobject.boxed.Boxed
[glib.strv_builder.StrvBuilder] is a helper object to build a null-terminated string arrays.
The following example shows how to build a two element array:
g_autoptr(GStrvBuilder) builder = g_strv_builder_new ();
g_strv_builder_add (builder, "hello");
g_strv_builder_add (builder, "world");
g_auto(GStrv) array = g_strv_builder_end (builder);Methods
StrvBuilder self()Returns `this`, for use in `with` statements.void add(string value)Add a string to the end of the array.void addv(string[] value)Appends all the strings in the given vector to the builder.string[] end()Ends the builder process and returns the constructed NULL-terminated string array. The returned value should be freed with [glib.global.strfreev] when no longer needed. Returns: the constructed str...void take(string value)Add a string to the end of the array. After value belongs to the #GStrvBuilder and may no longer be modified by the caller.