Method

GLibVariantBuilderend

since: 2.24

Declaration

GVariant*
g_variant_builder_end (
  GVariantBuilder* builder
)

Description

Ends the builder process and returns the constructed value.

It is not permissible to use builder in any way after this call except for reference counting operations (in the case of a heap-allocated GVariantBuilder) or by reinitialising it with g_variant_builder_init() (in the case of stack-allocated). This means that for the stack-allocated builders there is no need to call g_variant_builder_clear() after the call to g_variant_builder_end().

It is an error to call this function in any way that would create an inconsistent value to be constructed (ie: insufficient number of items added to a container with a specific number of children required). It is also an error to call this function if the builder was created with an indefinite array or maybe type and no children have been added; in this case it is impossible to infer the type of the empty array.

Available since: 2.24

Return value

Type: GVariant

A new, floating, GVariant.

The data is owned by the instance.