From 1a08e2d675514a251b680833d5fae6ee10f788a6 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=BCrg=20Billeter?= Date: Sat, 2 Apr 2011 20:29:23 +0200 Subject: [PATCH] glib-2.0: Add string.get_next_char Fixes bug 645150. --- vapi/glib-2.0.vapi | 11 +++++++++++ 1 file changed, 11 insertions(+) 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) { -- 2.47.2