Re: string replace function

2011-12-21 Thread Aleksander Morgado

On 12/16/2011 07:34 PM, Richard Hughes wrote:

On 6 December 2011 02:53, Kevin Anthonykevin.s.anth...@gmail.com  wrote:

But what i would like to know, is if i write this, and include it in the
glib/gstrfuncs.c in a patch, would it be included.


I've got a pretty efficient g_string_replace() function in zif if
you're interested. Doing it with a GString rather than a gchar* makes
things much more efficient in the common cases.



FYI, there's already a bug report about getting a g_string_replace() in 
GLib, with some unreviewed patches:

  https://bugzilla.gnome.org/show_bug.cgi?id=585816
___
gtk-devel-list mailing list
gtk-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-devel-list


Re: string replace function

2011-12-18 Thread Kevin Anthony
i created a patch
https://bugzilla.gnome.org/show_bug.cgi?id=665763

how do i go about getting it reviewed?



On Tue, Dec 6, 2011 at 10:05 AM, Kevin Anthony kevin.s.anth...@gmail.comwrote:

 g_strreplace(Source String ABCDEFG,CDE,XYZ) would return

 Source String ABXYZFG

 g_strnreplace(Source String x x x x x x,x,y,2) would return

 Source String y y x x x x

 i understand there are other functions that sort of do this, but i makes
 sense, i think, to have an actual search and replace function.



 On Tue, Dec 6, 2011 at 5:04 AM, Stefan Sauer enso...@hora-obscura.dewrote:

 On 12/06/2011 03:56 AM, Kevin Anthony wrote:
  I was thinking of making a g_strrpl and g_strnrpl
  The first one takes (gchar*,gchar*) and returns a gchar* in which the
 all
  instances of the second gchar* will be found and replaced in the first
  gchar*.
 replaced by what? g_strcannon can be used for some of the user cases
 maybe. Also g_strrpl is not a good name, it would be better to just call
 it g_strreplace.

 Stefan
  The second one is the same, but only replaces the first n instances.
 
  But what i would like to know, is if i write this, and include it in the
  glib/gstrfuncs.c in a patch, would it be included.
 

 ___
 gtk-app-devel-list mailing list
 gtk-app-devel-list@gnome.org
 http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list




 --
 Thanks
 Kevin Anthony
 www.NoSideRacing.com

 Do you use Banshee?
 Download the Community Extensions:
 http://banshee.fm/download/extensions/




-- 
Thanks
Kevin Anthony
www.NoSideRacing.com

Do you use Banshee?
Download the Community Extensions:
http://banshee.fm/download/extensions/
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: string replace function

2011-12-16 Thread Richard Hughes
On 6 December 2011 02:53, Kevin Anthony kevin.s.anth...@gmail.com wrote:
 But what i would like to know, is if i write this, and include it in the
 glib/gstrfuncs.c in a patch, would it be included.

I've got a pretty efficient g_string_replace() function in zif if
you're interested. Doing it with a GString rather than a gchar* makes
things much more efficient in the common cases.

Richard.
___
gtk-devel-list mailing list
gtk-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-devel-list


Re: string replace function

2011-12-06 Thread Stefan Sauer
On 12/06/2011 03:56 AM, Kevin Anthony wrote:
 I was thinking of making a g_strrpl and g_strnrpl
 The first one takes (gchar*,gchar*) and returns a gchar* in which the all
 instances of the second gchar* will be found and replaced in the first
 gchar*.
replaced by what? g_strcannon can be used for some of the user cases
maybe. Also g_strrpl is not a good name, it would be better to just call
it g_strreplace.

Stefan
 The second one is the same, but only replaces the first n instances.

 But what i would like to know, is if i write this, and include it in the
 glib/gstrfuncs.c in a patch, would it be included.


___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


string replace function

2011-12-05 Thread Kevin Anthony
I was thinking of making a g_strrpl and g_strnrpl
The first one takes (gchar*,gchar*) and returns a gchar* in which the all
instances of the second gchar* will be found and replaced in the first
gchar*.
The second one is the same, but only replaces the first n instances.

But what i would like to know, is if i write this, and include it in the
glib/gstrfuncs.c in a patch, would it be included.

-- 
Thanks
Kevin Anthony
www.NoSideRacing.com

Do you use Banshee?
Download the Community Extensions:
http://banshee.fm/download/extensions/
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list