Commit Graph

14 Commits

Author SHA1 Message Date
Xavier Claessens
9559f579e6 Variant: Fix crash when casting a Variant to string
If we don't pass NULL to the length argument it makes C
code write the length at random places in memory and bad
things happens.
2014-06-17 21:16:38 +02:00
Bertrand Lorentz
a1636d306b Variant: Add a NewArray (Variant[] children) convenience method
This allows you to avoid ugly calls like "NewArray (null, some_array)"
when you want the child type to be determined by the first element of
the children array.

Also throw specific exceptions when both type and children parameters
would be null.
2014-06-13 13:10:48 +02:00
Bertrand Lorentz
b605b42540 Variant: Small code formatting fix 2014-06-13 13:10:02 +02:00
Xavier Claessens
4158bc99f8 Variant: Add Type property 2014-06-12 16:48:03 -04:00
Xavier Claessens
dc0f50729a Variant: Add ToArray() and ToAsv() helpers 2014-06-12 16:08:36 -04:00
Xavier Claessens
893703018f Variant: Add wrapper to construct "a{sv}" variant 2014-06-12 13:22:44 -04:00
Xavier Claessens
cef9b13d72 Variant: Add wrapper for g_variant_new_dict_entry() 2014-06-12 13:22:44 -04:00
Xavier Claessens
58fb7aa378 Variant: Add wrapper for g_variant_new_array() 2014-06-12 13:22:43 -04:00
Xavier Claessens
24f8cede19 Variant: Add wrapper for g_variant_new_tuple() 2014-06-12 13:22:43 -04:00
Xavier Claessens
b5062a8c7d Variant: Add wrapper for g_variant_new_variant() 2014-06-12 13:22:43 -04:00
Xavier Claessens
b357aaef84 Variant: Add wrapper for g_variant_new_strv() 2014-06-12 12:30:29 -04:00
Xavier Claessens
c1fbe27b32 Variant: Add wrapper for g_variant_print() 2014-06-12 12:05:35 -04:00
Andrés G. Aragoneses
f1005da47c glib: Make all DllImports in custom code use a common const
This way there's less redundancy, and if the library name changes in the
future, it will be changed only in one place.

Signed-off-by: Bertrand Lorentz <bertrand.lorentz@gmail.com>
2013-11-17 13:05:12 +01:00
Mike Kestner
8459ac5560 Initial support for GVariant
* generator/SymbolTable.cs : add GVariant type mapping.
* glib/Variant.cs: initial implementation of an opaque class to expose
the GVariant type from glib.  We won't make any attempt to combine managed
references since there is no "toggle" ref capability.  We'll do a one-to-one
ref_sink/unref pair on construction/dispose.
2011-01-22 12:52:38 -06:00