add


Description:

public void add (string format_string, ...)

Adds to a VariantBuilder.

This call is a convenience wrapper that is exactly equivalent to calling Variant followed by 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.

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);
for (i = 0; i < 16; i++)
{
gchar buf[3];

sprintf (buf, "%d", i);
g_variant_builder_add (&builder, "{is}", i, buf);
}

return g_variant_builder_end (&builder);
}

Parameters:

this

a VariantBuilder

format_string

a Variant varargs format string

...

arguments, as per format_string