Re: [gtkmm] Glib::ustring bug?
- From: MHL Schulze t-online de (Martin Schulze)
- To: gtkmm-list <gtkmm-list gnome org>
- Subject: Re: [gtkmm] Glib::ustring bug?
- Date: Wed, 4 Sep 2002 21:13:48 +0200
Am 04.09.2002 20:12 schrieb(en) Joe Yandle:
> > Please try data.c_str() before speaking of a bug. I suspect
> > that the string returned by data.raw() is not '\0'-terminated.
>
> Yes, .c_str() works properly. However, if .raw() does not return a
> string representation which works with third-party STL add-ons, I think
> a word of warning somewhere in the documentation is appropriate.
I think you've missed the point about ustring::raw(). It does *not*
return
a C style string, so the fact that your code snippet worked under gcc-RH
is simply an accident. Outputting an unterminated char* to a C++
iostream
is as likely to cause a segfault as anything else, since the stream will
keep outputting characters until it reaches a null.
Still, Robert is right about the poor documentation of Glib::ustring.
Is there noone who has some deeper knowledge about std::string who
would volunteer to update the documentation? Just write a few
doxygen style comments into glib/glibmm/ustring.h, patch the ChangeLog
and put a cvs diff into bugzilla...
Regards,
Martin
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]