[glibmm/glibmm-2-36] ByteArray: get_data(): Add a const version.
- From: Murray Cumming <murrayc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glibmm/glibmm-2-36] ByteArray: get_data(): Add a const version.
- Date: Tue, 16 Apr 2013 11:26:36 +0000 (UTC)
commit b2f3aa837f6f0b617bfc4db36f9871d9abbc7dd9
Author: José Alburquerque <jaalburqu svn gnome org>
Date: Mon Apr 15 18:53:16 2013 -0400
ByteArray: get_data(): Add a const version.
* glib/src/bytearray.{ccg,hg}: Make the already existing get_data()
method non-constant and add a constant one returning a const array as
is done in general in *mm modules.
ChangeLog | 8 ++++++++
glib/src/bytearray.ccg | 7 ++++++-
glib/src/bytearray.hg | 8 +++++++-
3 files changed, 21 insertions(+), 2 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index bd123d0..138f246 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2013-04-14 José Alburquerque <jaalburquerque gmail com>
+
+ ByteArray: get_data(): Add a const version.
+
+ * glib/src/bytearray.{ccg,hg}: Make the already existing get_data()
+ method non-constant and add a constant one returning a const array as
+ is done in general in *mm modules.
+
2013-04-11 José Alburquerque <jaalburquerque gmail com>
ByteArray: Add size() and get_data() methods.
diff --git a/glib/src/bytearray.ccg b/glib/src/bytearray.ccg
index f2a0158..4cf3ff1 100644
--- a/glib/src/bytearray.ccg
+++ b/glib/src/bytearray.ccg
@@ -42,7 +42,12 @@ guint ByteArray::size() const
return gobj()->len;
}
-guint8* ByteArray::get_data() const
+guint8* ByteArray::get_data()
+{
+ return gobj()->data;
+}
+
+const guint8* ByteArray::get_data() const
{
return gobj()->data;
}
diff --git a/glib/src/bytearray.hg b/glib/src/bytearray.hg
index cea6f6d..48fc2dc 100644
--- a/glib/src/bytearray.hg
+++ b/glib/src/bytearray.hg
@@ -68,7 +68,13 @@ public:
* @return The data.
* @newin{2,36}
*/
- guint8* get_data() const;
+ guint8* get_data();
+
+ /** Gets the data of the byte array.
+ * @return The data.
+ * @newin{2,36}
+ */
+ const 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)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]