Function completion for GVariant maybe types?



Hello!

The software component "GLib" provides support for nullable data types to some
degree.
http://developer.gnome.org/glib/2.30/gvariant-text.html#gvariant-text-maybe-types
http://developer.gnome.org/glib/2.30/glib-GVariantType.html#glib-GVariantType.description

I imagine that functions like the following will be also useful for this API.

1. g_variant_is_maybe
   A new predicate function that can provide another type check (like
"g_variant_is_container").

2. g_variant_can_be_nothing/undefined/optional/maybe
   This would provide a similar feature like data base access libraries can
usually determine if a column is allowed to be "NULL".
   http://developer.gnome.org/libgda/4.2/libgda-4.0-Gda-Value.html#gda-value-is-null

3. g_variant_convert_to_maybe
   I see a need for a alternative to the interface "g_variant_new_maybe". I
would like to replace a maybe instance directly instead of allocating a new one.

4. g_variant_set_to_nothing/none
   How should a GVariant variable be reset to the special marker "nothing" after
it was used with other concrete values for a while?

How do you think about my suggestion to complete this programming interface?

Regards,
Markus


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