.\" Automatically generated by Pod::Man 4.11 (Pod::Simple 3.35)
.\"
.\" Standard preamble:
.\" ========================================================================
.de Sp \" Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
..
.de Vb \" Begin verbatim text
.ft CW
.nf
.ne \\$1
..
.de Ve \" End verbatim text
.ft R
.fi
..
.\" Set up some character translations and predefined strings.  \*(-- will
.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
.\" double quote, and \*(R" will give a right double quote.  \*(C+ will
.\" give a nicer C++.  Capital omega is used to do unbreakable dashes and
.\" therefore won't be available.  \*(C` and \*(C' expand to `' in nroff,
.\" nothing in troff, for use with C<>.
.tr \(*W-
.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
.ie n \{\
.    ds -- \(*W-
.    ds PI pi
.    if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
.    if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\"  diablo 12 pitch
.    ds L" ""
.    ds R" ""
.    ds C` ""
.    ds C' ""
'br\}
.el\{\
.    ds -- \|\(em\|
.    ds PI \(*p
.    ds L" ``
.    ds R" ''
.    ds C`
.    ds C'
'br\}
.\"
.\" Escape single quotes in literal strings from groff's Unicode transform.
.ie \n(.g .ds Aq \(aq
.el       .ds Aq '
.\"
.\" If the F register is >0, we'll generate index entries on stderr for
.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
.\" entries marked with X<> in POD.  Of course, you'll have to process the
.\" output yourself in some meaningful fashion.
.\"
.\" Avoid warning from groff about undefined register 'F'.
.de IX
..
.nr rF 0
.if \n(.g .if rF .nr rF 1
.if (\n(rF:(\n(.g==0)) \{\
.    if \nF \{\
.        de IX
.        tm Index:\\$1\t\\n%\t"\\$2"
..
.        if !\nF==2 \{\
.            nr % 0
.            nr F 2
.        \}
.    \}
.\}
.rr rF
.\" ========================================================================
.\"
.IX Title "Glib::Variant 3pm"
.TH Glib::Variant 3pm "2020-02-18" "perl v5.30.0" "User Contributed Perl Documentation"
.\" For nroff, turn off justification.  Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
.nh
.SH "NAME"
Glib::Variant \-  strongly typed value datatype
.SH "SYNOPSIS"
.IX Header "SYNOPSIS"
.Vb 2
\&  my $v = Glib::Variant\->new (\*(Aqas\*(Aq, [\*(AqGTK+\*(Aq, \*(AqPerl\*(Aq]);
\&  my $aref = $v\->get (\*(Aqas\*(Aq);
.Ve
.SH "DESCRIPTION"
.IX Header "DESCRIPTION"
There are two sets of APIs for creating and dealing with \f(CW\*(C`Glib::Variant\*(C'\fRs: the
low-level \s-1API\s0 described below under \*(L"\s-1METHODS\*(R"\s0, and the convenience \s-1API\s0
described in this section.
.SS "\s-1CONVENIENCE API\s0"
.IX Subsection "CONVENIENCE API"
.ie n .IP "variant = Glib::Variant\->new ($format_string, $value)" 4
.el .IP "variant = Glib::Variant\->new ($format_string, \f(CW$value\fR)" 4
.IX Item "variant = Glib::Variant->new ($format_string, $value)"
.PD 0
.ie n .IP "(variant1, ...) = Glib::Variant\->new ($format_string, $value1, ...)" 4
.el .IP "(variant1, ...) = Glib::Variant\->new ($format_string, \f(CW$value1\fR, ...)" 4
.IX Item "(variant1, ...) = Glib::Variant->new ($format_string, $value1, ...)"
.PD
Constructs a variant from \f(CW$format_string\fR and \f(CW$value\fR.  Also supports
constructing multiple variants when the format string is a concatenation of
multiple types.
.ie n .IP "value = $variant\->get ($format_string)" 4
.el .IP "value = \f(CW$variant\fR\->get ($format_string)" 4
.IX Item "value = $variant->get ($format_string)"
Deconstructs \f(CW$variant\fR according to \f(CW$format_string\fR.
.PP
The following symbols are currently supported in format strings:
.PP
.Vb 11
\&  +\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+
\&  |            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              |
\&  +\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+
.Ve
.PP
Note that if a format string specifies an array, a tuple or a dictionary entry
(\*(L"a\*(R", \*(L"()\*(R" or \*(L"{}\*(R"), then array references are expected by \f(CW\*(C`new\*(C'\fR and produced
by \f(CW\*(C`get\*(C'\fR.  For arrays of dictionary entries (\*(L"a{}\*(R"), hash references are also
supported by \f(CW\*(C`new\*(C'\fR and handled as you would expect.
.PP
For a complete specification, see the documentation at
.IP "<https://developer.gnome.org/glib/stable/glib\-GVariantType.html>" 4
.IX Item "<https://developer.gnome.org/glib/stable/glib-GVariantType.html>"
.PD 0
.IP "<https://developer.gnome.org/glib/stable/glib\-GVariant.html>" 4
.IX Item "<https://developer.gnome.org/glib/stable/glib-GVariant.html>"
.IP "<https://developer.gnome.org/glib/stable/gvariant\-format\-strings.html>" 4
.IX Item "<https://developer.gnome.org/glib/stable/gvariant-format-strings.html>"
.IP "<https://developer.gnome.org/glib/stable/gvariant\-text.html>" 4
.IX Item "<https://developer.gnome.org/glib/stable/gvariant-text.html>"
.PD
.SH "HIERARCHY"
.IX Header "HIERARCHY"
.Vb 1
\&  Glib::Variant
.Ve
.SH "METHODS"
.IX Header "METHODS"
.ie n .SS "variant = Glib::Variant\->\fBnew_array\fP ($child_type, $children)"
.el .SS "variant = Glib::Variant\->\fBnew_array\fP ($child_type, \f(CW$children\fP)"
.IX Subsection "variant = Glib::Variant->new_array ($child_type, $children)"
.IP "\(bu" 4
\&\f(CW$child_type\fR (Glib::VariantType)
.IP "\(bu" 4
\&\f(CW$children\fR (scalar)
.SS "variant = Glib::Variant\->\fBnew_boolean\fP ($value)"
.IX Subsection "variant = Glib::Variant->new_boolean ($value)"
.IP "\(bu" 4
\&\f(CW$value\fR (boolean)
.SS "variant = Glib::Variant\->\fBnew_byte\fP ($value)"
.IX Subsection "variant = Glib::Variant->new_byte ($value)"
.IP "\(bu" 4
\&\f(CW$value\fR (Glib::UChar)
.SS "variant = Glib::Variant\->\fBnew_bytestring\fP ($string)"
.IX Subsection "variant = Glib::Variant->new_bytestring ($string)"
.IP "\(bu" 4
\&\f(CW$string\fR (byte string)
.PP
Since: glib 2.26
.ie n .SS "variant = Glib::Variant\->\fBnew_dict_entry\fP ($key, $value)"
.el .SS "variant = Glib::Variant\->\fBnew_dict_entry\fP ($key, \f(CW$value\fP)"
.IX Subsection "variant = Glib::Variant->new_dict_entry ($key, $value)"
.IP "\(bu" 4
\&\f(CW$key\fR (Glib::Variant)
.IP "\(bu" 4
\&\f(CW$value\fR (Glib::Variant)
.SS "variant = Glib::Variant\->\fBnew_double\fP ($value)"
.IX Subsection "variant = Glib::Variant->new_double ($value)"
.IP "\(bu" 4
\&\f(CW$value\fR (double)
.SS "variant = Glib::Variant\->\fBnew_handle\fP ($value)"
.IX Subsection "variant = Glib::Variant->new_handle ($value)"
.IP "\(bu" 4
\&\f(CW$value\fR (integer)
.SS "variant = Glib::Variant\->\fBnew_int16\fP ($value)"
.IX Subsection "variant = Glib::Variant->new_int16 ($value)"
.IP "\(bu" 4
\&\f(CW$value\fR (integer)
.SS "variant = Glib::Variant\->\fBnew_int32\fP ($value)"
.IX Subsection "variant = Glib::Variant->new_int32 ($value)"
.IP "\(bu" 4
\&\f(CW$value\fR (integer)
.SS "variant = Glib::Variant\->\fBnew_int64\fP ($value)"
.IX Subsection "variant = Glib::Variant->new_int64 ($value)"
.IP "\(bu" 4
\&\f(CW$value\fR (64 bit integer)
.ie n .SS "variant = Glib::Variant\->\fBnew_maybe\fP ($child_type, $child)"
.el .SS "variant = Glib::Variant\->\fBnew_maybe\fP ($child_type, \f(CW$child\fP)"
.IX Subsection "variant = Glib::Variant->new_maybe ($child_type, $child)"
.IP "\(bu" 4
\&\f(CW$child_type\fR (Glib::VariantType)
.IP "\(bu" 4
\&\f(CW$child\fR (Glib::Variant)
.SS "variant = Glib::Variant\->\fBnew_object_path\fP ($object_path)"
.IX Subsection "variant = Glib::Variant->new_object_path ($object_path)"
.IP "\(bu" 4
\&\f(CW$object_path\fR (string)
.SS "variant = Glib::Variant\->\fBnew_signature\fP ($signature)"
.IX Subsection "variant = Glib::Variant->new_signature ($signature)"
.IP "\(bu" 4
\&\f(CW$signature\fR (string)
.SS "variant = Glib::Variant\->\fBnew_string\fP ($string)"
.IX Subsection "variant = Glib::Variant->new_string ($string)"
.IP "\(bu" 4
\&\f(CW$string\fR (string)
.SS "variant = Glib::Variant\->\fBnew_tuple\fP ($children)"
.IX Subsection "variant = Glib::Variant->new_tuple ($children)"
.IP "\(bu" 4
\&\f(CW$children\fR (scalar)
.SS "variant = Glib::Variant\->\fBnew_uint16\fP ($value)"
.IX Subsection "variant = Glib::Variant->new_uint16 ($value)"
.IP "\(bu" 4
\&\f(CW$value\fR (unsigned)
.SS "variant = Glib::Variant\->\fBnew_uint32\fP ($value)"
.IX Subsection "variant = Glib::Variant->new_uint32 ($value)"
.IP "\(bu" 4
\&\f(CW$value\fR (unsigned)
.SS "variant = Glib::Variant\->\fBnew_uint64\fP ($value)"
.IX Subsection "variant = Glib::Variant->new_uint64 ($value)"
.IP "\(bu" 4
\&\f(CW$value\fR (64 bit unsigned)
.SS "variant = Glib::Variant\->\fBnew_variant\fP ($value)"
.IX Subsection "variant = Glib::Variant->new_variant ($value)"
.IP "\(bu" 4
\&\f(CW$value\fR (Glib::Variant)
.ie n .SS "boolean = $value\->\fBget_boolean\fP"
.el .SS "boolean = \f(CW$value\fP\->\fBget_boolean\fP"
.IX Subsection "boolean = $value->get_boolean"
.ie n .SS "uchar = $value\->\fBget_byte\fP"
.el .SS "uchar = \f(CW$value\fP\->\fBget_byte\fP"
.IX Subsection "uchar = $value->get_byte"
.ie n .SS "string = $value\->\fBget_bytestring\fP"
.el .SS "string = \f(CW$value\fP\->\fBget_bytestring\fP"
.IX Subsection "string = $value->get_bytestring"
Since: glib 2.26
.ie n .SS "variant = $value\->\fBbyteswap\fP"
.el .SS "variant = \f(CW$value\fP\->\fBbyteswap\fP"
.IX Subsection "variant = $value->byteswap"
.ie n .SS "variant = $value\->\fBget_child_value\fP ($index_)"
.el .SS "variant = \f(CW$value\fP\->\fBget_child_value\fP ($index_)"
.IX Subsection "variant = $value->get_child_value ($index_)"
.IP "\(bu" 4
\&\f(CW$index_\fR (unsigned)
.ie n .SS "string = $value\->\fBclassify\fP"
.el .SS "string = \f(CW$value\fP\->\fBclassify\fP"
.IX Subsection "string = $value->classify"
.ie n .SS "integer = $one\->\fBcompare\fP ($two)"
.el .SS "integer = \f(CW$one\fP\->\fBcompare\fP ($two)"
.IX Subsection "integer = $one->compare ($two)"
.IP "\(bu" 4
\&\f(CW$two\fR (Glib::Variant)
.PP
Since: glib 2.26
.ie n .SS "double = $value\->\fBget_double\fP"
.el .SS "double = \f(CW$value\fP\->\fBget_double\fP"
.IX Subsection "double = $value->get_double"
.ie n .SS "boolean = $one\->\fBequal\fP ($two)"
.el .SS "boolean = \f(CW$one\fP\->\fBequal\fP ($two)"
.IX Subsection "boolean = $one->equal ($two)"
.IP "\(bu" 4
\&\f(CW$two\fR (Glib::Variant)
.ie n .SS "integer = $value\->\fBget_handle\fP"
.el .SS "integer = \f(CW$value\fP\->\fBget_handle\fP"
.IX Subsection "integer = $value->get_handle"
.ie n .SS "integer = $value\->\fBhash\fP"
.el .SS "integer = \f(CW$value\fP\->\fBhash\fP"
.IX Subsection "integer = $value->hash"
.ie n .SS "integer = $value\->\fBget_int16\fP"
.el .SS "integer = \f(CW$value\fP\->\fBget_int16\fP"
.IX Subsection "integer = $value->get_int16"
.ie n .SS "integer = $value\->\fBget_int32\fP"
.el .SS "integer = \f(CW$value\fP\->\fBget_int32\fP"
.IX Subsection "integer = $value->get_int32"
.ie n .SS "64 bit integer = $value\->\fBget_int64\fP"
.el .SS "64 bit integer = \f(CW$value\fP\->\fBget_int64\fP"
.IX Subsection "64 bit integer = $value->get_int64"
.ie n .SS "boolean = $value\->\fBis_container\fP"
.el .SS "boolean = \f(CW$value\fP\->\fBis_container\fP"
.IX Subsection "boolean = $value->is_container"
.ie n .SS "boolean = $value\->\fBis_normal_form\fP"
.el .SS "boolean = \f(CW$value\fP\->\fBis_normal_form\fP"
.IX Subsection "boolean = $value->is_normal_form"
.ie n .SS "boolean = $string\->\fBis_object_path\fP"
.el .SS "boolean = \f(CW$string\fP\->\fBis_object_path\fP"
.IX Subsection "boolean = $string->is_object_path"
.ie n .SS "boolean = $value\->\fBis_of_type\fP ($type)"
.el .SS "boolean = \f(CW$value\fP\->\fBis_of_type\fP ($type)"
.IX Subsection "boolean = $value->is_of_type ($type)"
.IP "\(bu" 4
\&\f(CW$type\fR (Glib::VariantType)
.ie n .SS "boolean = $string\->\fBis_signature\fP"
.el .SS "boolean = \f(CW$string\fP\->\fBis_signature\fP"
.IX Subsection "boolean = $string->is_signature"
.ie n .SS "variant = $dictionary\->\fBlookup_value\fP ($key, $expected_type)"
.el .SS "variant = \f(CW$dictionary\fP\->\fBlookup_value\fP ($key, \f(CW$expected_type\fP)"
.IX Subsection "variant = $dictionary->lookup_value ($key, $expected_type)"
.IP "\(bu" 4
\&\f(CW$key\fR (string)
.IP "\(bu" 4
\&\f(CW$expected_type\fR (Glib::VariantType)
.PP
Since: glib 2.28
.ie n .SS "variant = $value\->\fBget_maybe\fP"
.el .SS "variant = \f(CW$value\fP\->\fBget_maybe\fP"
.IX Subsection "variant = $value->get_maybe"
.ie n .SS "unsigned = $value\->\fBn_children\fP"
.el .SS "unsigned = \f(CW$value\fP\->\fBn_children\fP"
.IX Subsection "unsigned = $value->n_children"
.ie n .SS "variant = $value\->\fBget_normal_form\fP"
.el .SS "variant = \f(CW$value\fP\->\fBget_normal_form\fP"
.IX Subsection "variant = $value->get_normal_form"
.ie n .SS "variant = Glib::Variant::parse ($type, $text)"
.el .SS "variant = Glib::Variant::parse ($type, \f(CW$text\fP)"
.IX Subsection "variant = Glib::Variant::parse ($type, $text)"
.IP "\(bu" 4
\&\f(CW$type\fR (Glib::VariantType)
.IP "\(bu" 4
\&\f(CW$text\fR (string)
.PP
May croak with a Glib::Error in $@ on failure.
.ie n .SS "string = $value\->\fBprint\fP ($type_annotate)"
.el .SS "string = \f(CW$value\fP\->\fBprint\fP ($type_annotate)"
.IX Subsection "string = $value->print ($type_annotate)"
.IP "\(bu" 4
\&\f(CW$type_annotate\fR (boolean)
.ie n .SS "unsigned = $value\->\fBget_size\fP"
.el .SS "unsigned = \f(CW$value\fP\->\fBget_size\fP"
.IX Subsection "unsigned = $value->get_size"
.ie n .SS "string = $value\->\fBget_string\fP"
.el .SS "string = \f(CW$value\fP\->\fBget_string\fP"
.IX Subsection "string = $value->get_string"
.ie n .SS "varianttype = $value\->\fBget_type\fP"
.el .SS "varianttype = \f(CW$value\fP\->\fBget_type\fP"
.IX Subsection "varianttype = $value->get_type"
.ie n .SS "string = $value\->\fBget_type_string\fP"
.el .SS "string = \f(CW$value\fP\->\fBget_type_string\fP"
.IX Subsection "string = $value->get_type_string"
.ie n .SS "unsigned = $value\->\fBget_uint16\fP"
.el .SS "unsigned = \f(CW$value\fP\->\fBget_uint16\fP"
.IX Subsection "unsigned = $value->get_uint16"
.ie n .SS "unsigned = $value\->\fBget_uint32\fP"
.el .SS "unsigned = \f(CW$value\fP\->\fBget_uint32\fP"
.IX Subsection "unsigned = $value->get_uint32"
.ie n .SS "64 bit unsigned = $value\->\fBget_uint64\fP"
.el .SS "64 bit unsigned = \f(CW$value\fP\->\fBget_uint64\fP"
.IX Subsection "64 bit unsigned = $value->get_uint64"
.ie n .SS "variant = $value\->\fBget_variant\fP"
.el .SS "variant = \f(CW$value\fP\->\fBget_variant\fP"
.IX Subsection "variant = $value->get_variant"
.SH "SEE ALSO"
.IX Header "SEE ALSO"
Glib, Glib::VariantType, Glib::VariantDict
.SH "COPYRIGHT"
.IX Header "COPYRIGHT"
Copyright (C) 2003\-2011 by the gtk2\-perl team.
.PP
This software is licensed under the \s-1LGPL.\s0  See Glib for a full notice.
