]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
glib-2.0: Add string.to_utf8() method
authorJürg Billeter <j@bitron.ch>
Tue, 4 Aug 2009 10:01:44 +0000 (12:01 +0200)
committerJürg Billeter <j@bitron.ch>
Tue, 4 Aug 2009 10:01:44 +0000 (12:01 +0200)
vapi/glib-2.0.vapi

index 6052c8d4afa543dc5db0f7eab34192f983f27a9b..9e415afd7ba69a27ef6c1a59c8237e4fd5dd1ce3 100644 (file)
@@ -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")]