VariantBuilder

A utility type for constructing container-type glib.Variant instances.

This is an opaque structure and may only be accessed using the following functions.

glib.VariantBuilder is not threadsafe in any way. Do not attempt to access it from more than one thread.

Constructors

this
this(GVariantBuilder* gVariantBuilder, bool ownedRef)

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

this
this(VariantType type)

Allocates and initialises a new glib.VariantBuilder

Destructor

A destructor is present on this object, but not explicitly documented in the source.

Members

Functions

addValue
void addValue(Variant value)

Adds value to builder.

clear
void clear()

Releases all memory associated with a glib.VariantBuilder without freeing the glib.VariantBuilder structure itself.

close
void close()

Closes the subcontainer inside the given builder that was opened by the most recent call to Variant.builderOpen.

end
Variant end()

Ends the builder process and returns the constructed value.

getStruct
void* getStruct()

the main Gtk struct as a void*

getVariantBuilderStruct
GVariantBuilder* getVariantBuilderStruct(bool transferOwnership)

Get the main Gtk struct

init
void init(VariantType type)

Initialises a glib.VariantBuilder structure.

open
void open(VariantType type)

Opens a subcontainer inside the given builder. When done adding items to the subcontainer, Variant.builderClose must be called. type is the type of the container: so to build a tuple of several values, type must include the tuple itself.

ref_
VariantBuilder ref_()

Increases the reference count on builder.

unref
void unref()

Decreases the reference count on builder.

Variables

gVariantBuilder
GVariantBuilder* gVariantBuilder;

the main Gtk struct