Re: [gtkmm] One thing we didn't really discuss: ustring vs string



On Thu, 2002-08-08 at 15:30, ERDI Gergo wrote:
> I remember I mentioned something like this on the mailing list during
> GUAD3C, but there hasn't been a discussion about it: when to use ustring,
> when to use string, adn when to use StockID.
> 
> I see we currently use ustring for nearly everything -- including file
> names, stringified colors, stringified TreeModel paths, and other
> non-user-visible strings. Is this a design decision or mere oversight? Is
> this a Good Thing? Is this Good Enough?
> 
> We need to discuss its implications ASAP if we want to freeze, as this
> could possibly affect a huge part of the API.

I'm sure I answered this on the list already. Hopefully this is just a
repeat:

1. We currently use Glib::ustring whenever we are not _certain_ that the
string could never be UTF8. Filenames can probably never be UTF8 so they
should be std::string. Others might have more expertise.
  It seems to me that color names such as "red" could be UTF8 one day.
And as long as the GTK+ coders don't say that they can never be UTF8
then we need to use Glib::ustring.

1. We currently use Gtk::StockID to avoid ambiguities with strings.

2. If you want to patch all stock_id parameters to have StockID types,
for consistency, then maybe that would be OK. But we would need to make
very clear that there an automatic conversion from "SOME_STOCK_ID_NAME".

 
-- 
Murray Cumming
murrayc usa net
www.murrayc.com




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