[glibmm] ByteArray: get_data(): Add a const version.
- From: José Alburquerque <jaalburqu src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glibmm] ByteArray: get_data(): Add a const version.
- Date: Tue, 16 Apr 2013 03:44:35 +0000 (UTC)
commit 6e4e1669a33080e34445964005b395481111f5f2
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 cc19c1d..4be1dca 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-12 José Alburquerque <jaalburquerque gmail com>
Tls Client Test: Update to test the TlsDatabase class.
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]