]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
glib-2.0: Add string.get_next_char
authorJürg Billeter <j@bitron.ch>
Sat, 2 Apr 2011 18:29:23 +0000 (20:29 +0200)
committerJürg Billeter <j@bitron.ch>
Sat, 2 Apr 2011 18:29:23 +0000 (20:29 +0200)
Fixes bug 645150.

vapi/glib-2.0.vapi

index 78c3ceaaef314adedfd3b82ff93c8235f043a702..afa0b90f110f5c8359062d311a30d0f7291b4408 100644 (file)
@@ -1132,6 +1132,17 @@ public class string {
 
        [CCode (cname = "g_utf8_next_char")]
        public unowned string next_char ();
+       [CCode (cname = "g_utf8_next_char")]
+       static char* utf8_next_char (char* str);
+       public bool get_next_char (ref int index, out unichar c) {
+               c = utf8_get_char ((char*) this + index);
+               if (c != 0) {
+                       index = (int) (utf8_next_char ((char*) this + index) - (char*) this);
+                       return true;
+               } else {
+                       return false;
+               }
+       }
        [CCode (cname = "g_utf8_get_char")]
        static unichar utf8_get_char (char* str);
        public unichar get_char (long index = 0) {