StrvBuilder

#GStrvBuilder is a method of easily building dynamically sized NULL-terminated string arrays.

The following example shows how to build a two element array:

|[<!-- language="C" --> 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(GStrvBuilder* gStrvBuilder, bool ownedRef)

Sets our main struct and passes it to the parent class.

this
this()

Creates a new #GStrvBuilder with a reference count of 1. Use g_strv_builder_unref() on the returned value when no longer needed.

Destructor

~this
~this()
Undocumented in source.

Members

Aliases

doref
alias doref = ref_
Undocumented in source.

Functions

add
void add(string value)

Add a string to the end of the array.

end
string[] end()

Ends the builder process and returns the constructed NULL-terminated string array. The returned value should be freed with g_strfreev() when no longer needed.

getStruct
void* getStruct()

the main Gtk struct as a void*

getStrvBuilderStruct
GStrvBuilder* getStrvBuilderStruct(bool transferOwnership)

Get the main Gtk struct

ref_
StrvBuilder ref_()

Atomically increments the reference count of @builder by one. This function is thread-safe and may be called from any thread.

unref
void unref()

Decreases the reference count on @builder.

Variables

gStrvBuilder
GStrvBuilder* gStrvBuilder;

the main Gtk struct

ownedRef
bool ownedRef;
Undocumented in source.

Meta

Since

2.68