VariantBuilder

class VariantBuilder(val glibVariantBuilderPointer: <Error class: unknown class><<Error class: unknown class>>) : ProxyInstance(source)

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.

Skipped during bindings generation

  • method add: Varargs parameter is not supported

  • method add_parsed: Varargs parameter is not supported

  • field x: Array parameter of type guintptr is not supported

  • field y: Array parameter of type guintptr is not supported

Constructors

Link copied to clipboard
constructor(type: VariantType)

Allocates and initialises a new #GVariantBuilder.

constructor()

Allocate a new VariantBuilder.

constructor(scope: <Error class: unknown class>)

Allocate a new VariantBuilder using the provided AutofreeScope.

constructor(partialMagic: <Error class: unknown class>, type: VariantType?)

Allocate a new VariantBuilder.

constructor(partialMagic: <Error class: unknown class>, type: VariantType?, scope: <Error class: unknown class>)

Allocate a new VariantBuilder using the provided AutofreeScope.

constructor(glibVariantBuilderPointer: <Error class: unknown class><<Error class: unknown class>>)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
val glibVariantBuilderPointer: <Error class: unknown class><<Error class: unknown class>>
Link copied to clipboard
open override val handle: <Error class: unknown class>
Link copied to clipboard
var partialMagic: <Error class: unknown class>
Link copied to clipboard

Functions

Link copied to clipboard
open override fun addCleaner(cleaner: <Error class: unknown class>): Boolean

Registers a cleaner to be executed when this proxy object is garbage collected.

Link copied to clipboard
fun addValue(value: Variant)

Adds @value to @builder.

Link copied to clipboard
fun clear()

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

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
open operator override fun equals(other: Any?): Boolean

Compare two proxy instances for equality. This will compare both the type of the instances, and their memory addresses.

Link copied to clipboard
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
fun init(type: VariantType)

Initialises a #GVariantBuilder structure.

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
open override fun removeCleaner(cleaner: <Error class: unknown class>): Boolean

Removes a previously registered cleaner from this proxy object.

Link copied to clipboard
open override fun toString(): String
Link copied to clipboard
fun unref()

Decreases the reference count on @builder.