[vala/wip/unicode: 5/5] glib-2.0: Add UCS-4 and UTF-16 related bindings
- From: Rico Tzschichholz <ricotz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala/wip/unicode: 5/5] glib-2.0: Add UCS-4 and UTF-16 related bindings
- Date: Wed, 21 Sep 2016 16:42:26 +0000 (UTC)
commit e87316c751d3a0da77b885652954728aed32f249
Author: Rico Tzschichholz <ricotz ubuntu com>
Date: Sun Sep 18 13:27:35 2016 +0200
glib-2.0: Add UCS-4 and UTF-16 related bindings
https://bugzilla.gnome.org/show_bug.cgi?id=740818
vapi/glib-2.0.vapi | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 62 insertions(+), 0 deletions(-)
---
diff --git a/vapi/glib-2.0.vapi b/vapi/glib-2.0.vapi
index b15d9a6..7314cad 100644
--- a/vapi/glib-2.0.vapi
+++ b/vapi/glib-2.0.vapi
@@ -959,6 +959,22 @@ public struct unichar {
[CCode (cname = "G_UNICHAR_MAX_DECOMPOSITION_LENGTH")]
public const int MAX_DECOMPOSITION_LENGTH;
+
+ [CCode (cname = "G_GUINT32_FORMAT")]
+ public const string FORMAT;
+ [CCode (cname = "G_GINT32_MODIFIER")]
+ public const string FORMAT_MODIFIER;
+}
+
+[SimpleType]
+[GIR (name = "guint16")]
+[CCode (cname = "gunichar2", cheader_filename = "glib.h", default_value = "0U", type_signature = "q",
has_type_id = false)]
+[IntegerType (rank = 5)]
+public struct unichar2 {
+ [CCode (cname = "G_GUINT16_FORMAT")]
+ public const string FORMAT;
+ [CCode (cname = "G_GINT16_MODIFIER")]
+ public const string FORMAT_MODIFIER;
}
[Compact]
@@ -1412,6 +1428,52 @@ public class string {
public unowned string to_string () {
return this;
}
+
+ [CCode (cname = "g_utf8_to_utf16")]
+ public string_utf16 to_utf16 (long len = -1, out long? items_read = null, out long? items_written =
null) throws GLib.ConvertError;
+ [CCode (cname = "g_utf8_to_ucs4")]
+ public string_ucs4 to_ucs4 (long len = -1, out long? items_read = null, out long? items_written =
null) throws GLib.ConvertError;
+ [CCode (cname = "g_utf8_to_ucs4_fast")]
+ public string_ucs4 to_ucs4_fast (long len = -1, out long? items_written = null);
+
+}
+
+[Compact]
+[Immutable]
+[GIR (name = "guint16")]
+[CCode (cname = "gunichar2", const_cname = "const gunichar2", copy_function = "", free_function = "g_free",
cheader_filename = "glib.h")]
+public class string_utf16 {
+ [CCode (cname = "g_utf16_to_ucs4")]
+ public string_ucs4 to_ucs4 (long len = -1, out long? items_read = null, out long? items_written =
null) throws GLib.ConvertError;
+ [CCode (cname = "g_utf16_to_utf8")]
+ public string to_utf8 (long len = -1, out long? items_read = null, out long? items_written = null)
throws GLib.ConvertError;
+
+ public string? to_string () {
+ try {
+ return this.to_utf8 ();
+ } catch (GLib.ConvertError e) {
+ return null;
+ }
+ }
+}
+
+[Compact]
+[Immutable]
+[GIR (name = "gunichar")]
+[CCode (cname = "gunichar", const_cname = "const gunichar", copy_function = "", free_function = "g_free",
cheader_filename = "glib.h")]
+public class string_ucs4 {
+ [CCode (cname = "g_ucs4_to_utf16")]
+ public string_utf16 to_utf16 (long len = -1, out long? items_read = null, out long? items_written =
null) throws GLib.ConvertError;
+ [CCode (cname = "g_ucs4_to_utf8")]
+ public string to_utf8 (long len = -1, out long? items_read = null, out long? items_written = null)
throws GLib.ConvertError;
+
+ public string? to_string () {
+ try {
+ return this.to_utf8 ();
+ } catch (GLib.ConvertError e) {
+ return null;
+ }
+ }
}
[CCode (cprefix = "G", lower_case_cprefix = "g_", cheader_filename = "glib.h", gir_namespace = "GLib",
gir_version = "2.0")]
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]