[geary/wip/save-sent-713263] Add UnownedBytesBuffer iface to OffsetBuffer
- From: Charles Lindsay <clindsay src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [geary/wip/save-sent-713263] Add UnownedBytesBuffer iface to OffsetBuffer
- Date: Wed, 29 Jan 2014 01:54:41 +0000 (UTC)
commit 5c942d4b8ff4ca8cecbba06526a56e0199e68fb6
Author: Charles Lindsay <chaz yorba org>
Date: Tue Jan 28 16:58:32 2014 -0800
Add UnownedBytesBuffer iface to OffsetBuffer
src/engine/memory/memory-offset-buffer.vala | 9 ++++++++-
1 files changed, 8 insertions(+), 1 deletions(-)
---
diff --git a/src/engine/memory/memory-offset-buffer.vala b/src/engine/memory/memory-offset-buffer.vala
index a7193ee..cd7ea78 100644
--- a/src/engine/memory/memory-offset-buffer.vala
+++ b/src/engine/memory/memory-offset-buffer.vala
@@ -8,7 +8,7 @@
* A buffer that's simply an offset into an existing buffer.
*/
-public class Geary.Memory.OffsetBuffer : Geary.Memory.Buffer {
+public class Geary.Memory.OffsetBuffer : Geary.Memory.Buffer, Geary.Memory.UnownedBytesBuffer {
/**
* { inheritDoc}
*/
@@ -37,4 +37,11 @@ public class Geary.Memory.OffsetBuffer : Geary.Memory.Buffer {
bytes = new Bytes.from_bytes(buffer.get_bytes(), offset, buffer.size - offset);
return bytes;
}
+
+ /**
+ * { inheritDoc}
+ */
+ public unowned uint8[] to_unowned_uint8_array() {
+ return get_bytes().get_data();
+ }
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]