Variant: Add wrapper for g_variant_new_strv()
This commit is contained in:
parent
c1fbe27b32
commit
b357aaef84
1 changed files with 10 additions and 0 deletions
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in a new issue