[glibmm] Glib::Regex: Fix a member name
- From: Kjell Ahlstedt <kjellahl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glibmm] Glib::Regex: Fix a member name
- Date: Tue, 20 Jun 2017 08:08:24 +0000 (UTC)
commit 0b4dd160066eead824e276a0e1d6d729fe7fefca
Author: Kjell Ahlstedt <kjellahlstedt gmail com>
Date: Tue Jun 20 10:03:38 2017 +0200
Glib::Regex: Fix a member name
The member data name shall be take_ownership_ (with an underscore suffix)
and the function argument name take_ownership.
glib/src/regex.ccg | 24 ++++++++++++------------
glib/src/regex.hg | 7 +++----
2 files changed, 15 insertions(+), 16 deletions(-)
---
diff --git a/glib/src/regex.ccg b/glib/src/regex.ccg
index 7707efa..1014971 100644
--- a/glib/src/regex.ccg
+++ b/glib/src/regex.ccg
@@ -239,50 +239,50 @@ Regex::split(const Glib::ustring& string, int start_position, MatchFlags match_o
return retvalue;
}
-MatchInfo::MatchInfo() : gobject_(nullptr), take_ownership(false)
+MatchInfo::MatchInfo() : gobject_(nullptr), take_ownership_(false)
{
}
-MatchInfo::MatchInfo(GMatchInfo* castitem, bool take_the_ownership)
-: gobject_(castitem), take_ownership(take_the_ownership)
+MatchInfo::MatchInfo(GMatchInfo* castitem, bool take_ownership)
+: gobject_(castitem), take_ownership_(take_ownership)
{
}
MatchInfo::MatchInfo(MatchInfo&& other) noexcept : gobject_(std::move(other.gobject_)),
- take_ownership(std::move(other.take_ownership))
+ take_ownership_(std::move(other.take_ownership_))
{
other.gobject_ = nullptr;
- other.take_ownership = false;
+ other.take_ownership_ = false;
}
MatchInfo&
MatchInfo::operator=(MatchInfo&& other) noexcept
{
- if (take_ownership && gobject_)
+ if (take_ownership_ && gobject_)
g_match_info_free(gobject_);
gobject_ = std::move(other.gobject_);
- take_ownership = std::move(other.take_ownership);
+ take_ownership_ = std::move(other.take_ownership_);
other.gobject_ = nullptr;
- other.take_ownership = false;
+ other.take_ownership_ = false;
return *this;
}
void
-MatchInfo::set_gobject(GMatchInfo* castitem, bool take_the_ownership)
+MatchInfo::set_gobject(GMatchInfo* castitem, bool take_ownership)
{
- if (gobject_ && this->take_ownership)
+ if (gobject_ && this->take_ownership_)
g_match_info_free(gobject_);
gobject_ = castitem;
- this->take_ownership = take_the_ownership;
+ this->take_ownership_ = take_ownership;
}
MatchInfo::~MatchInfo()
{
- if (take_ownership && gobject_)
+ if (take_ownership_ && gobject_)
g_match_info_free(gobject_);
}
diff --git a/glib/src/regex.hg b/glib/src/regex.hg
index 71e2200..73eedf3 100644
--- a/glib/src/regex.hg
+++ b/glib/src/regex.hg
@@ -222,10 +222,9 @@ public:
/** C object constructor.
* @param castitem The C object.
- * @param take_the_ownership Whether to destroy the C object with the wrapper or
- * not.
+ * @param take_ownership Whether to destroy the C object with the wrapper or not.
*/
- explicit MatchInfo(GMatchInfo* castitem, bool take_the_ownership = true); //TODO: Rename to take_ownership
when we can rename the member variable.
+ explicit MatchInfo(GMatchInfo* castitem, bool take_ownership = true);
MatchInfo(const MatchInfo& other) = delete;
MatchInfo& operator=(const MatchInfo& other) = delete;
@@ -275,7 +274,7 @@ public:
protected:
GMatchInfo* gobject_; // The C object.
- bool take_ownership; // Bool signaling ownership. //TODO: Give this a _ suffix when we can break API.
+ bool take_ownership_; // Bool signaling ownership.
protected:
// So that Glib::Regex::match() can set the C object.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]