[vala] glib-2.0: Add string.get_next_char



commit 1a08e2d675514a251b680833d5fae6ee10f788a6
Author: Jürg Billeter <j bitron ch>
Date:   Sat Apr 2 20:29:23 2011 +0200

    glib-2.0: Add string.get_next_char
    
    Fixes bug 645150.

 vapi/glib-2.0.vapi |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)
---
diff --git a/vapi/glib-2.0.vapi b/vapi/glib-2.0.vapi
index 78c3cea..afa0b90 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) {



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