[vala] glib: add .data to StringBuilder
- From: Ryan Lortie <ryanl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala] glib: add .data to StringBuilder
- Date: Sun, 5 Feb 2012 00:35:26 +0000 (UTC)
commit cd1dc0923fb88a5f2e69a9a134c42a7206247a21
Author: Ryan Lortie <desrt desrt ca>
Date: Fri Feb 3 10:50:23 2012 -0500
glib: add .data to StringBuilder
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 | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/vapi/glib-2.0.vapi b/vapi/glib-2.0.vapi
index 45f5640..25b228f 100644
--- a/vapi/glib-2.0.vapi
+++ b/vapi/glib-2.0.vapi
@@ -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 */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]