From: Jürg Billeter Date: Sat, 2 Apr 2011 18:29:23 +0000 (+0200) Subject: glib-2.0: Add string.get_next_char X-Git-Tag: 0.12.0~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1a08e2d675514a251b680833d5fae6ee10f788a6;p=thirdparty%2Fvala.git glib-2.0: Add string.get_next_char Fixes bug 645150. --- diff --git a/vapi/glib-2.0.vapi b/vapi/glib-2.0.vapi index 78c3ceaae..afa0b90f1 100644 --- a/vapi/glib-2.0.vapi +++ b/vapi/glib-2.0.vapi @@ -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) {