After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 109286 - GString APIs for substring and replace wanted.
GString APIs for substring and replace wanted.
Status: RESOLVED WONTFIX
Product: glib
Classification: Platform
Component: general
unspecified
Other other
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2003-03-26 20:34 UTC by kz
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description kz 2003-03-26 20:31:42 UTC
Package: glib
Severity: enhancement
Version: 2.2.1
Synopsis: GString APIs for substring and replace wanted.
Bugzilla-Product: glib
Bugzilla-Component: general

Description:
http://sourceforge.net/docman/display_doc.php?docid=16145&group_id=51905

append, insert, and delete fulfilled by corresponding APIs of GString;
append, insert, and erase.

but GString has no API for substring and replace, yet.
what about to make those APIs?




------- Bug moved to this database by unknown@bugzilla.gnome.org 2003-03-26 15:31 -------

Reassigning to the default owner of the component, gtkdev@gtk.org.

Comment 1 kz 2003-05-10 10:23:17 UTC
replace() could be implemented with sequence of erase() and insert().
but I have no idea what is the best way to implement substring() yet.
Comment 2 Owen Taylor 2003-05-30 18:16:27 UTC
Substring is trivial to do as:

substring (GString *str, int index, int len)
{
  return g_string_new_len (str->str, index, MIN (str->len - index, len));
}