]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
glib: add .data to StringBuilder
authorRyan Lortie <desrt@desrt.ca>
Fri, 3 Feb 2012 15:50:23 +0000 (10:50 -0500)
committerRyan Lortie <desrt@desrt.ca>
Sun, 5 Feb 2012 00:35:21 +0000 (19:35 -0500)
To do the same thing as string.data, but without the strlen() (since we
already know this from the GString's length field).

https://bugzilla.gnome.org/show_bug.cgi?id=669313

vapi/glib-2.0.vapi

index 45f5640e29ade17a8bf88ddf17049cb279edfc93..25b228fe381225697be627ec8de2d79727077ac8 100644 (file)
@@ -4068,6 +4068,14 @@ namespace GLib {
                public string str;
                public ssize_t len;
                public ssize_t allocated_len;
+
+               public uint8[] data {
+                       get {
+                               unowned uint8[] res = (uint8[]) this.str;
+                               res.length = (int) this.len;
+                               return res;
+                       }
+               }
        }
 
        /* String Chunks */