StrvBuilder

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);

Constructors

this
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.

Members

Functions

add
void add(string value)

Add a string to the end of the array.

addv
void addv(string[] value)

Appends all the strings in the given vector to the builder.

end
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.

take
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.

Inherited Members

From Boxed

cInstancePtr
void* cInstancePtr;

Pointer to the C boxed value

getType
GType getType()

Get the GType of this boxed type.

gType
GType gType [@property getter]

Boxed GType property.

self
Boxed self()

Convenience method to return this cast to a type. For use in D with statements.

copy_
void* copy_()

Make a copy of the wrapped C boxed data.

boxedCopy
void* boxedCopy(void* cBoxed)

Copy a C boxed value using g_boxed_copy.

boxedFree
void boxedFree(void* cBoxed)

Free a C boxed value using g_boxed_free.