diff options
Diffstat (limited to 'glib/src/regex.ccg')
-rw-r--r-- | glib/src/regex.ccg | 54 |
1 files changed, 27 insertions, 27 deletions
diff --git a/glib/src/regex.ccg b/glib/src/regex.ccg index af91d4ab..61408cc6 100644 --- a/glib/src/regex.ccg +++ b/glib/src/regex.ccg @@ -24,8 +24,8 @@ Glib::RefPtr<Glib::Regex> Regex::create(const Glib::ustring& pattern, RegexCompileFlags compile_options, RegexMatchFlags match_options) { - GError* gerror = 0; - GRegex* regex = g_regex_new(pattern.c_str(), (GRegexCompileFlags)compile_options, + GError* gerror = nullptr; + auto regex = g_regex_new(pattern.c_str(), (GRegexCompileFlags)compile_options, (GRegexMatchFlags)match_options, &gerror); if(gerror) @@ -47,7 +47,7 @@ bool Regex::match( RegexMatchFlags match_options ) { - GMatchInfo* ginfo = 0; + GMatchInfo* ginfo = nullptr; bool const result = static_cast<bool>(g_regex_match(gobj(), string.c_str(), static_cast<GRegexMatchFlags>(match_options), &ginfo)); match_info.set_gobject(ginfo); @@ -66,8 +66,8 @@ bool Regex::match( RegexMatchFlags match_options ) { - GError* gerror = 0; - GMatchInfo* ginfo = 0; + GError* gerror = nullptr; + GMatchInfo* ginfo = nullptr; bool const result = static_cast<bool>(g_regex_match_full(gobj(), string.c_str(), -1, start_position, @@ -88,8 +88,8 @@ bool Regex::match( RegexMatchFlags match_options ) { - GError* gerror = 0; - GMatchInfo* ginfo = 0; + GError* gerror = nullptr; + GMatchInfo* ginfo = nullptr; bool const result = static_cast<bool>(g_regex_match_full(gobj(), string.c_str(), string_len, start_position, @@ -104,7 +104,7 @@ bool Regex::match( bool Regex::match(const Glib::ustring& string, int start_position, RegexMatchFlags match_options) { - GError* gerror = 0; + GError* gerror = nullptr; bool retvalue = g_regex_match_full(gobj(), string.c_str(), -1, start_position, ((GRegexMatchFlags)(match_options)), 0, &(gerror)); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -114,7 +114,7 @@ bool Regex::match(const Glib::ustring& string, int start_position, RegexMatchFla bool Regex::match(const Glib::ustring& string, gssize string_len, int start_position, RegexMatchFlags match_options) { - GError* gerror = 0; + GError* gerror = nullptr; bool retvalue = g_regex_match_full(gobj(), string.c_str(), string_len, start_position, ((GRegexMatchFlags)(match_options)), 0, &(gerror)); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -128,7 +128,7 @@ bool Regex::match_all( RegexMatchFlags match_options ) { - GMatchInfo* ginfo = 0; + GMatchInfo* ginfo = nullptr; bool const result = static_cast<bool>(g_regex_match_all(gobj(), string.c_str(), static_cast<GRegexMatchFlags>(match_options), &ginfo)); @@ -148,8 +148,8 @@ bool Regex::match_all( RegexMatchFlags match_options ) { - GError* gerror = 0; - GMatchInfo* ginfo = 0; + GError* gerror = nullptr; + GMatchInfo* ginfo = nullptr; bool const retvalue = static_cast<bool>(g_regex_match_all_full(gobj(), string.c_str(), -1, start_position, @@ -170,8 +170,8 @@ bool Regex::match_all( RegexMatchFlags match_options ) { - GError* gerror = 0; - GMatchInfo* ginfo = 0; + GError* gerror = nullptr; + GMatchInfo* ginfo = nullptr; bool const retvalue = static_cast<bool>(g_regex_match_all_full(gobj(), string.c_str(), string_len, start_position, @@ -186,7 +186,7 @@ bool Regex::match_all( bool Regex::match_all(const Glib::ustring& string, int start_position, RegexMatchFlags match_options) { - GError* gerror = 0; + GError* gerror = nullptr; bool retvalue = g_regex_match_all_full(gobj(), string.c_str(), -1, start_position, ((GRegexMatchFlags)(match_options)), 0, &(gerror)); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -196,7 +196,7 @@ bool Regex::match_all(const Glib::ustring& string, int start_position, RegexMatc bool Regex::match_all(const Glib::ustring& string, gssize string_len, int start_position, RegexMatchFlags match_options) { - GError* gerror = 0; + GError* gerror = nullptr; bool retvalue = g_regex_match_all_full(gobj(), string.c_str(), string_len, start_position, ((GRegexMatchFlags)(match_options)), 0, &(gerror)); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -206,8 +206,8 @@ bool Regex::match_all(const Glib::ustring& string, gssize string_len, int start_ Glib::ustring Regex::replace(const Glib::ustring& string, int start_position, const Glib::ustring& replacement, RegexMatchFlags match_options) { - GError* gerror = 0; - Glib::ustring retvalue = Glib::convert_return_gchar_ptr_to_ustring(g_regex_replace(gobj(), string.c_str(), -1, start_position, replacement.c_str(), ((GRegexMatchFlags)(match_options)), &(gerror))); + GError* gerror = nullptr; + auto retvalue = Glib::convert_return_gchar_ptr_to_ustring(g_regex_replace(gobj(), string.c_str(), -1, start_position, replacement.c_str(), ((GRegexMatchFlags)(match_options)), &(gerror))); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -217,8 +217,8 @@ Glib::ustring Regex::replace(const Glib::ustring& string, int start_position, co Glib::ustring Regex::replace_literal(const Glib::ustring& string, int start_position, const Glib::ustring& replacement, RegexMatchFlags match_options) { - GError* gerror = 0; - Glib::ustring retvalue = Glib::convert_return_gchar_ptr_to_ustring(g_regex_replace_literal(gobj(), string.c_str(), -1, start_position, replacement.c_str(), ((GRegexMatchFlags)(match_options)), &(gerror))); + GError* gerror = nullptr; + auto retvalue = Glib::convert_return_gchar_ptr_to_ustring(g_regex_replace_literal(gobj(), string.c_str(), -1, start_position, replacement.c_str(), ((GRegexMatchFlags)(match_options)), &(gerror))); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -227,8 +227,8 @@ Glib::ustring Regex::replace_literal(const Glib::ustring& string, int start_posi Glib::StringArrayHandle Regex::split(const Glib::ustring& string, int start_position, RegexMatchFlags match_options, int max_tokens) const { - GError* gerror = 0; - Glib::StringArrayHandle retvalue = Glib::StringArrayHandle(g_regex_split_full(const_cast<GRegex*>(gobj()), string.c_str(), -1, start_position, ((GRegexMatchFlags)(match_options)), max_tokens, &(gerror)), Glib::OWNERSHIP_DEEP); + GError* gerror = nullptr; + auto retvalue = Glib::StringArrayHandle(g_regex_split_full(const_cast<GRegex*>(gobj()), string.c_str(), -1, start_position, ((GRegexMatchFlags)(match_options)), max_tokens, &(gerror)), Glib::OWNERSHIP_DEEP); if(gerror) ::Glib::Error::throw_exception(gerror); @@ -242,19 +242,19 @@ MatchInfo::MatchInfo() { } -MatchInfo::MatchInfo(GMatchInfo* castitem, bool take_ownership) +MatchInfo::MatchInfo(GMatchInfo* castitem, bool take_the_ownership) : gobject_(castitem), - take_ownership(take_ownership) + take_ownership(take_the_ownership) { } -void MatchInfo::set_gobject(GMatchInfo* castitem, bool take_ownership) +void MatchInfo::set_gobject(GMatchInfo* castitem, bool take_the_ownership) { - if(gobject_ && take_ownership) + if(gobject_ && this->take_ownership) g_match_info_free(gobject_); gobject_ = castitem; - this->take_ownership = take_ownership; + this->take_ownership = take_the_ownership; } MatchInfo::~MatchInfo() |