From c1fbe27b320919a17d8c3d6a66657b4932be3294 Mon Sep 17 00:00:00 2001 From: Xavier Claessens Date: Thu, 15 May 2014 15:51:32 -0400 Subject: [PATCH] Variant: Add wrapper for g_variant_print() --- glib/Variant.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/glib/Variant.cs b/glib/Variant.cs index 8603f09d9..6da8ca838 100644 --- a/glib/Variant.cs +++ b/glib/Variant.cs @@ -194,5 +194,14 @@ namespace GLib { IntPtr str = g_variant_get_string (val.Handle); return str == IntPtr.Zero ? null : GLib.Marshaller.Utf8PtrToString (str); } + + [DllImport (Global.GLibNativeDll, CallingConvention = CallingConvention.Cdecl)] + static extern IntPtr g_variant_print (IntPtr variant, bool type_annotate); + + public string Print (bool type_annotate) + { + IntPtr str = g_variant_print(handle, type_annotate); + return Marshaller.PtrToStringGFree (str); + } } }