Method

GLibVariantBuilderadd_parsed

Declaration

void
g_variant_builder_add_parsed (
  GVariantBuilder* builder,
  const gchar* format,
  ...
)

Description

Adds to a GVariantBuilder.

This call is a convenience wrapper that is exactly equivalent to calling g_variant_new_parsed() followed by g_variant_builder_add_value().

Note that the arguments must be of the correct width for their types specified in format_string. This can be achieved by casting them. See the [GVariant varargs documentation][gvariant-varargs].

This function might be used as follows:

GVariant *
make_pointless_dictionary (void)
{
  GVariantBuilder builder;
  int i;

  g_variant_builder_init (&builder, G_VARIANT_TYPE_ARRAY);
  g_variant_builder_add_parsed (&builder, "{'width', <%i>}", 600);
  g_variant_builder_add_parsed (&builder, "{'title', <%s>}", "foo");
  g_variant_builder_add_parsed (&builder, "{'transparency', <0.5>}");
  return g_variant_builder_end (&builder);
}
Available since:2.26
This method is not directly available to language bindings.

Parameters

format

Type: const gchar*

A text format GVariant.

The data is owned by the caller of the function.
The value is a NUL terminated UTF-8 string.
...

Type: 

Arguments as per format.