Re: Some new GString functions - constructors



Hi,

On Tue, 2005-12-20 at 22:36 +0000, Paul LeoNerd Evans wrote:
> As promised earlier, here's a patch with some new functions for GString.
> I'll split them up with related changes, so this is just the first of a
> sequence.

Can you please open a bug inside http://bugzilla.gnome.org and attach
the patch there? Tracking patches on Bugzilla makes things easier than
on a mailing list.

> * g_string_clone()

> * g_string_new_lenz()

> * g_string_slice()

Apart from g_string_new_lenz() which I don't understand, the _clone()
and _slice() functions looks intersting.

> Some other ideas
> ================

>     gint g_string_indexof(GString *str, gchar c);

This would be useful with Unicode support, or with a gunichar variant.

>     void g_string_destroy(GString *str);

This is *most* useful.

> I also have some slightly more special-purpose functions which I find
> useful, but I'm not sure of their place in such a general-purpose
> library as GLib. These are:
> 
>     GString* g_string_pull_token(GString *str);
>     // Deletes a token from the beginning of str, and returns it
> 
>     GString* g_string_pull_line(GString *str);
>     // Deletes a line from the beginning of str, and returns it

Also, a

	gchar ** g_string_tokenize (GString     *str,
                                    const gchar *token,
                                    gsize        lenght);

Could be interesting, instead of creating a new StringList type, since,
if you want a list of GString, you can always iterate on the returned
strings vector.

Ciao,
 Emmanuele.

-- 
Emmanuele Bassi - <ebassi gmail com>
Log: http://log.emmanuelebassi.net




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]