VariantBuilder

class VariantBuilder(pointer: <Error class: unknown class><<Error class: unknown class>>) : Record

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

Link copied to clipboard
constructor(pointer: <Error class: unknown class><<Error class: unknown class>>)

Types

Link copied to clipboard
object Companion : RecordCompanion<VariantBuilder, <Error class: unknown class>>

Properties

Link copied to clipboard
val glibVariantBuilderPointer: <Error class: unknown class><<Error class: unknown class>>

Functions

Link copied to clipboard
fun addValue(value: Variant)

Adds @value to @builder.

Link copied to clipboard
fun close()

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

Link copied to clipboard
fun end(): Variant

Ends the builder process and returns the constructed value.

Link copied to clipboard
fun open(type: VariantType)

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.

Link copied to clipboard

Increases the reference count on @builder.

Link copied to clipboard
fun unref()

Decreases the reference count on @builder.