Re: Some new GString functions - constructors
- From: Owen Taylor <otaylor redhat com>
- To: Paul LeoNerd Evans <leonerd leonerd org uk>
- Cc: gtk-devel-list gnome org
- Subject: Re: Some new GString functions - constructors
- Date: Tue, 20 Dec 2005 18:31:01 -0500
At a high-level, I think there is a question of "what GString is" - 
should there be GString versions of everything you want to do 
with a char *?
My opinion is no ... a GString is the equivalent of a Java 
StringBuffer .. it is a useful way to build and work with strings,
but it isn't *a string*. That's a char *.
It would be for example, wrong to pass a GString as an argument
to a function that takes a string as an input parameter.
That implies to me, for example:
 GList *g_string_split(GString *str, gchar c);
Is wrong ... we already have g_strsplit():
(Sidenote: g_strsplit() takes a char * delimiter. This has 
the big benefit of handling UTF-8 and ascii equally well.)
Regards,
					Owen
[
Date Prev][
Date Next]   [
Thread Prev][
Thread Next]   
[
Thread Index]
[
Date Index]
[
Author Index]