Re: [gtkmm] Glib::ustring bug?



>> 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]