diff --git a/glib/Variant.cs b/glib/Variant.cs index 6da8ca838..9ff39f670 100644 --- a/glib/Variant.cs +++ b/glib/Variant.cs @@ -114,6 +114,16 @@ namespace GLib { Marshaller.Free (native_val); } + [DllImport (Global.GLibNativeDll, CallingConvention = CallingConvention.Cdecl)] + static extern IntPtr g_variant_new_strv (IntPtr[] strv, IntPtr length); + + public Variant (string[] strv) + { + IntPtr[] native = Marshaller.StringArrayToNullTermPointer (strv); + handle = g_variant_ref_sink (g_variant_new_strv (native, new IntPtr ((long) strv.Length))); + Marshaller.Free (native); + } + [DllImport (Global.GLibNativeDll, CallingConvention = CallingConvention.Cdecl)] static extern bool g_variant_get_boolean (IntPtr handle);