Re: check GVariant



Thank you it does work now!
On Fri, Oct 12, 2018 at 5:06 PM Jason Crain <jason inspiresomeone us> wrote:

On 2018-10-12, Damian Ivanov via gtk-list <gtk-list gnome org> 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.


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