summaryrefslogtreecommitdiff
path: root/glib/src/bytearray.hg
diff options
context:
space:
mode:
authorJosé Alburquerque <jaalburqu@svn.gnome.org>2013-04-12 00:01:02 -0400
committerJosé Alburquerque <jaalburqu@svn.gnome.org>2013-04-12 00:01:02 -0400
commitf87fc0ed78cd7e306a617fcd83208ad90395a7b1 (patch)
tree92cbbc3c3f4d952051edef63b657f1d7f73f9012 /glib/src/bytearray.hg
parent975f517d1adf53c4c6df96fca524141c3638d92a (diff)
downloadglibmm-f87fc0ed78cd7e306a617fcd83208ad90395a7b1.tar.gz
ByteArray: Add size() and get_data() methods.
* glib/src/bytearray.{ccg,hg}: Add these methods so that accessing the underlying GByteArray's data and len members (which is how it is done in the C API) is just as easy with glibmm. Also use _WRAP_METHOD to wrap the create() method.
Diffstat (limited to 'glib/src/bytearray.hg')
-rw-r--r--glib/src/bytearray.hg16
1 files changed, 14 insertions, 2 deletions
diff --git a/glib/src/bytearray.hg b/glib/src/bytearray.hg
index a9e2312b..cea6f6d6 100644
--- a/glib/src/bytearray.hg
+++ b/glib/src/bytearray.hg
@@ -53,11 +53,23 @@ public:
*/
typedef sigc::slot<int, const guint8*, const guint8*> SlotCompare;
- _WRAP_METHOD_DOCS_ONLY(g_byte_array_new)
- static Glib::RefPtr<Glib::ByteArray> create();
+ _WRAP_METHOD(static Glib::RefPtr<ByteArray> create(), g_byte_array_new)
_WRAP_METHOD(Glib::RefPtr<ByteArray> append(const guint8* data, guint len), g_byte_array_append)
_WRAP_METHOD(Glib::RefPtr<ByteArray> prepend(const guint8* data, guint len), g_byte_array_prepend)
+
+ /** Gets the size of the byte array.
+ * @return The size.
+ * @newin{2,36}
+ */
+ guint size() const;
+
+ /** Gets the data of the byte array.
+ * @return The data.
+ * @newin{2,36}
+ */
+ guint8* get_data() const;
+
_WRAP_METHOD(Glib::RefPtr<ByteArray> remove_index(guint index_), g_byte_array_remove_index)
_WRAP_METHOD(Glib::RefPtr<ByteArray> remove_index_fast(guint index_), g_byte_array_remove_index_fast)
_WRAP_METHOD(Glib::RefPtr<ByteArray> remove_range(guint index_, guint length), g_byte_array_remove_range)