glib.strv_builder

Module for [StrvBuilder] class

Types 1

[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
void * _cPtr(Flag!"Dup" dup = No.Dup)
GType _gType() @property
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.
Constructors
this(void * ptr, Flag!"Take" take)
this()Creates a new #GStrvBuilder with a reference count of 1. Use [glib.strv_builder.StrvBuilder.unref] on the returned value when no longer needed. Returns: the new #GStrvBuilder