|
NAMEGlib::Variant - strongly typed value datatypeSYNOPSISmy $v = Glib::Variant->new ('as', ['GTK+', 'Perl']); my $aref = $v->get ('as'); DESCRIPTIONThere are two sets of APIs for creating and dealing with "Glib::Variant"s: the low-level API described below under "METHODS", and the convenience API described in this section.CONVENIENCE API
The following symbols are currently supported in format strings: +------------------------------+---------------------------------+ | Symbol | Meaning | +------------------------------+---------------------------------+ | b, y, n, q, i, u, x, t, h, d | Boolean, byte and numeric types | | s, o, g | String types | | v | Variant types | | a | Arrays | | m | Maybe types | | () | Tuples | | {} | Dictionary entries | +------------------------------+---------------------------------+ Note that if a format string specifies an array, a tuple or a dictionary entry ("a", "()" or "{}"), then array references are expected by "new" and produced by "get". For arrays of dictionary entries ("a{}"), hash references are also supported by "new" and handled as you would expect. For a complete specification, see the documentation at
HIERARCHYGlib::Variant METHODSvariant = Glib::Variant->new_array ($child_type, $children)
variant = Glib::Variant->new_boolean ($value)
variant = Glib::Variant->new_byte ($value)
variant = Glib::Variant->new_bytestring ($string)
Since: glib 2.26 variant = Glib::Variant->new_dict_entry ($key, $value)
variant = Glib::Variant->new_double ($value)
variant = Glib::Variant->new_handle ($value)
variant = Glib::Variant->new_int16 ($value)
variant = Glib::Variant->new_int32 ($value)
variant = Glib::Variant->new_int64 ($value)
variant = Glib::Variant->new_maybe ($child_type, $child)
variant = Glib::Variant->new_object_path ($object_path)
variant = Glib::Variant->new_signature ($signature)
variant = Glib::Variant->new_string ($string)
variant = Glib::Variant->new_tuple ($children)
variant = Glib::Variant->new_uint16 ($value)
variant = Glib::Variant->new_uint32 ($value)
variant = Glib::Variant->new_uint64 ($value)
variant = Glib::Variant->new_variant ($value)
boolean = $value->get_booleanuchar = $value->get_bytestring = $value->get_bytestringSince: glib 2.26variant = $value->byteswapvariant = $value->get_child_value ($index_)
string = $value->classifyinteger = $one->compare ($two)
Since: glib 2.26 double = $value->get_doubleboolean = $one->equal ($two)
integer = $value->get_handleinteger = $value->hashinteger = $value->get_int16integer = $value->get_int3264 bit integer = $value->get_int64boolean = $value->is_containerboolean = $value->is_normal_formboolean = $string->is_object_pathboolean = $value->is_of_type ($type)
boolean = $string->is_signaturevariant = $dictionary->lookup_value ($key, $expected_type)
Since: glib 2.28 variant = $value->get_maybeunsigned = $value->n_childrenvariant = $value->get_normal_formvariant = Glib::Variant::parse ($type, $text)
May croak with a Glib::Error in $@ on failure. string = $value->print ($type_annotate)
unsigned = $value->get_sizestring = $value->get_stringvarianttype = $value->get_typestring = $value->get_type_stringunsigned = $value->get_uint16unsigned = $value->get_uint3264 bit unsigned = $value->get_uint64variant = $value->get_variantSEE ALSOGlib, Glib::VariantType, Glib::VariantDictCOPYRIGHTCopyright (C) 2003-2011 by the gtk2-perl team.This software is licensed under the LGPL. See Glib for a full notice.
Visit the GSP FreeBSD Man Page Interface. |