Re: [gtkmm] Glib::ustring bug?
- From: Paul Davis <pbd op net>
- To: "Robert J. Hansen" <rjhansen inav net>
- Cc: Joe Yandle <jwy divisionbyzero com>, Martin Schulze <MHL Schulze t-online de>, gtkmm-list gnome org
- Subject: Re: [gtkmm] Glib::ustring bug?
- Date: Thu, 05 Sep 2002 07:53:06 -0400
>> 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
>
>When I see in the documentation that it returns a std::string reference,
>the first thing that leaps into my head is "ah, it returns a std::string
>version of its internal contents; I can use raw() to convert ustrings to
>std::strings if the library I'm using requires them". Given that in the
>API ref, raw() is listed right alongside c_str(), which works exactly as
>the std::string c_str(), this doesn't seem like an unreasonable inference
>to draw.
it correct too. however, once you've got the std::string, you then
need to use std::string::c_str() on it to get the data as a C-style
string, which is what you wanted to do.
its obviously more convenient for such purposes to use
Glib::ustring::c_str().
--p
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]