Re: API proposal: Glib::compose()



Am Samstag, den 20.01.2007, 17:08 +0100 schrieb Ole Laursen:
> Daniel Elstner <daniel kitta googlemail com> writes:
> 
> > Ah yes.  This looks pretty cool.  It supports conversion of arbitrary
> > types to strings by going through an std::wostringstream internally.
> > We'd have to investigate whether that is available on all our target
> > platforms.  Apart from the support for arbitrary types, the API is
> > identical to mine (probably because I unconsciously plagiarized his
> > interface).
> 
> I originally intended the functions to go into Glibmm because
> something like this is absolutely necessary for i18n. So feel free to
> copy whatever you want. :-)

Thanks :-)

I just filed an enhancement bug with a preliminary patch:
http://bugzilla.gnome.org/show_bug.cgi?id=399216

The API differs from yours in that I chose to separate the compose() and
format() functionality.  But this is not set in stone yet.  I'll outline
my reasons for favoring this approach tomorrow; gotta sleep now...

> One gotcha is the use of std::wostringstream instead of
> std::ostringstream - the wide version is needed because some
> characters might otherwise be truncated, e.g. thousands separator
> characters in some languages. I learned this the hard way.

Yeah, I noticed.  In glibmm we'll need a configure check for that,
though.

Cheers,
--Daniel





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