Re: check GVariant

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2018-10-12, Damian Ivanov via gtk-list <gtk-list@xxxxxxxxx> wrote:
> How do I check if the type of value is (ii) ?
>   switch (g_variant_classify(value)) {
>     case G_VARIANT_CLASS_BOOLEAN:
>         return ;
>     case G_VARIANT_CLASS_BYTE:
>         return ;
>     case HOW_CHECK_ii :

You may want to use the `g_variant_check_format_string`
(https://developer.gnome.org/glib/2.56/glib-GVariant.html#g-variant-check-format-string)
function instead of `g_variant_classify`.

The `g_variant_classify` function will return G_VARIANT_CLASS_TUPLE for
that type. Then you could get the children with
`g_variant_get_child_value` and examine their classes.
_______________________________________________
gtk-list mailing list
gtk-list@xxxxxxxxx
https://mail.gnome.org/mailman/listinfo/gtk-list



[Index of Archives]     [Touch Screen Library]     [GIMP Users]     [Gnome]     [KDE]     [Yosemite News]     [Steve's Art]

  Powered by Linux