VariantIter


Object Hierarchy:

GLib.VariantIter GLib.VariantIter GLib.VariantIter

Description:

[ Compact ]
[ Version ( since = "2.24" ) ]
public class VariantIter

VariantIter is an opaque data structure and can only be accessed using the following functions.

Example: Variant iter:

public static int main (string[] args) {
GLib.Variant? val = null;
string? key = null;

VariantBuilder builder = new VariantBuilder (new VariantType ("a{sv}") );
builder.add ("{sv}", "str1", new Variant.string ("str"));
builder.add ("{sv}", "str2", new Variant.int16 (10));
builder.add ("{sv}", "str4", new Variant.int32 (10));
builder.add ("{sv}", "str5", new Variant.int64 (10));

Variant dictionary = builder.end ();

VariantIter iter = dictionary.iterator ();

while (iter.next ("{sv}", out key, out val)) {
print ("Item '%s' has type '%s'\n", key, val.get_type_string ());
}

return 0;
}

valac --pkg glib-2.0 GLib.VariantIter.vala


Namespace: GLib
Package: glib-2.0

Content:

Creation methods:

Methods: