]> 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>
Thu, 23 Sep 2021 08:11:36 +0000 (10:11 +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 6e2a761c80b12d23941a29285a1bb73afae6f5f3..00153e31c9d73a08ac3da10cd155f3e79a5fd0b1 100644 (file)
@@ -5311,6 +5311,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")]