]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
glib-2.0: Add RefString since 2.58
authorRico Tzschichholz <ricotz@ubuntu.com>
Thu, 1 Nov 2018 17:38:02 +0000 (18:38 +0100)
committerRico Tzschichholz <ricotz@ubuntu.com>
Wed, 1 Sep 2021 11:33:17 +0000 (13:33 +0200)
Thanks to Jiří Janoušek

See https://gitlab.gnome.org/GNOME/vala/issues/666

Fixes https://gitlab.gnome.org/GNOME/vala/issues/723

vapi/glib-2.0.vapi

index a86b81df0771ed97170ed6b2095303cf9cfe27de..71caeaf2ca9475b018a4ab0e653b7ef453fbc6f8 100644 (file)
@@ -5443,6 +5443,22 @@ namespace GLib {
 
        /* Strings */
 
+       [CCode (cprefix = "g_ref_string_", ref_function = "g_ref_string_acquire", unref_function = "g_ref_string_release", type_id = "G_TYPE_STRING")]
+       [Version (since = "2.58")]
+       public class RefString {
+               public RefString (string str);
+               public RefString.intern (string str);
+               public RefString.len (string str, ssize_t len);
+
+               public size_t length {
+                       [CCode (cname = "g_ref_string_length")]
+                       get;
+               }
+
+               [CCode (cname = "(const char*)")]
+               public unowned string to_string ();
+       }
+
        [Compact]
        [GIR (name = "String")]
        [CCode (cname = "GString", cprefix = "g_string_", free_function = "g_string_free", type_id = "G_TYPE_GSTRING")]