g_filename_display_name()



squentin pointed out in irc that there is no bindings for g_filename_display_name()[1], or for its recommended brother, g_filename_display_basename()[2].

Now, looking at this for a few minutes, there are several observations:

- We have gperl_sv_from_filename() and gperl_filename_from_sv(), and Glib::filename_to_unicode() and Glib::filename_from_unicode(). These use g_filename_(to|from)_utf8() internally.

- g_filename_to_utf8() can fail if the filename is hosed, making filename_to_unicode() rather annoying to use. This is why the display* variants were introduced -- to try really hard to recover from those failures and make a reasonable conversion.

- We can add bindings for g_filename_display_(base)?name(), but how would we add them? Glib::filename_display_name() looks wrong. Glib::Filename::display_name() looks alright, and may make more sense.

- We could just change gperl_filename_from_sv() to use g_filename_display_name(). What would this mean for compatibility? You'd still have the problem of having a full path to truncate when you just wanted to display a basename.


Thoughts?



[1] http://developer.gnome.org/doc/API/2.0/glib/glib-Character-Set- Conversion.html#id2810046 [2] http://developer.gnome.org/doc/API/2.0/glib/glib-Character-Set- Conversion.html#id2810157

--
Walk softly, and carry a BFG-9000.
  -- unknown




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]