GLib.VariantBuilder
Description: Reference for GLib.VariantBuilder

### Struct

# GLibVariantBuilder

since: 2.0

#### Description

    struct GVariantBuilder {
      /* No available fields */
    }

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.

Available since: 2.0

#### Constructors

###### g_variant_builder_new

Allocates and initialises a new `GVariantBuilder`.

since: 2.24

#### Instance methods

###### g_variant_builder_add

Adds to a `GVariantBuilder`.

since: 2.24

###### g_variant_builder_add_parsed

Adds to a `GVariantBuilder`.

since: 2.26

###### g_variant_builder_add_value

Adds `value` to `builder`.

since: 2.24

###### g_variant_builder_clear

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

since: 2.24

###### g_variant_builder_close

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

since: 2.24

###### g_variant_builder_end

Ends the builder process and returns the constructed value.

since: 2.24

###### g_variant_builder_init

Initialises a `GVariantBuilder` structure.

since: 2.24

###### g_variant_builder_open

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.

since: 2.24

###### g_variant_builder_ref

Increases the reference count on `builder`.

since: 2.24

###### g_variant_builder_unref

Decreases the reference count on `builder`.

since: 2.24