Re: Get gchar* from Glib::ustring
- From: Fabrício Godoy <skarllot gmail com>
- To: Hubert Figuiere <hub figuiere net>
- Cc: gtkmm-list <gtkmm-list gnome org>
- Subject: Re: Get gchar* from Glib::ustring
- Date: Wed, 3 Jun 2009 15:50:51 -0300
2009/6/3 Hubert Figuiere
<hub figuiere net>
On 06/03/2009 02:08 PM, Fabrício Godoy wrote:
Thank you.
Can you say why the following code compile but don't work?
template<class T1, class T2, class T3>
Glib::ustring build_filename(const T1& str1, const T2& str2, const T3& str3)
{
Glib::ustring ustr1 = Glib::ustring::compose("%1", str1);
Glib::ustring ustr2 = Glib::ustring::compose("%1", str2);
Glib::ustring ustr3 = Glib::ustring::compose("%1", str3);
gchar* path;
path = g_build_filename(ustr1.c_str(), ustr2.c_str(), ustr3.c_str());
Because, as written in the Fine Manual, you must end the argument list with NULL.
There is also Glib::build_filename()
Glib::build_filename() doesn't fit my needs. I was thinking in propose a patch like as my function.
Can I?
Since your description of "doesn't work" is missing I assume you are either getting a crash or garbage, depending on the phase of the moon and the age of the captain.
Hub
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]