VariantBuilder

A utility type for constructing container-type #GVariant instances.

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

#GVariantBuilder 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 #GVariantBuilder.

Destructor

~this
~this()
Undocumented in source.

Members

Functions

addValue
void addValue(Variant value)

Adds @value to @builder.

clear
void clear()

Releases all memory associated with a #GVariantBuilder without freeing the #GVariantBuilder structure itself.

close
void close()

Closes the subcontainer inside the given @builder that was opened by the most recent call to g_variant_builder_open().

doref
VariantBuilder doref()

Increases the reference count on @builder.

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 #GVariantBuilder structure.

open
void open(VariantType type)

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

unref
void unref()

Decreases the reference count on @builder.

Variables

gVariantBuilder
GVariantBuilder* gVariantBuilder;

the main Gtk struct

ownedRef
bool ownedRef;
Undocumented in source.

Meta