[vala] glib-2.0: Add string.to_utf8() method



commit 6f4c7dec8d16ede148824da2203b447d77db5763
Author: Jürg Billeter <j bitron ch>
Date:   Tue Aug 4 12:01:44 2009 +0200

    glib-2.0: Add string.to_utf8() method

 vapi/glib-2.0.vapi |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/vapi/glib-2.0.vapi b/vapi/glib-2.0.vapi
index 6052c8d..9e415af 100644
--- a/vapi/glib-2.0.vapi
+++ b/vapi/glib-2.0.vapi
@@ -951,6 +951,13 @@ public class string {
 	public long length {
 		get { return this.len (); }
 	}
+
+	public char[] to_utf8 () {
+		char[] result = new char[this.size () + 1];
+		result.length--;
+		GLib.Memory.copy (result, this, this.size ());
+		return result;
+	}
 }
 
 [CCode (cprefix = "G", lower_case_cprefix = "g_", cheader_filename = "glib.h")]



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