Re: The snprintf problems...

Subject: Re: The snprintf problems...
From: Mike Nordell (
Date: Wed Oct 17 2001 - 22:07:16 CDT

Martin Sevior wrote:
> >
> Mike,
> Since you're interested in this, is is possible to implement
> a way to snprintf into a UT_String?

Possible? Yes. Would I do it, or would I even like it if something as
type-unsafe as sprintf was added to it? No. There is a reason for me
opposing this; locales.

The only data-type that could be allowed in that format specification would
be "%d". Not very useful, eh?

"%s" format specification would be redundant, we already can concatenate
strings into UT_String. "%f" would be unusable since it would require the
process-wide C library locale (not to be confused with the "C" locale :-) )
to be used.

Should there be popular demand for string formatting except snprintf, I
suggest we have another look at the level of conformance of C++ compilers
and libraries instead. std::string already got all this, and more, not to
mention locales can be imbued on a per-object basis, which would benefit AW
performance in regards to writing and parsing strings to/from float.


This archive was generated by hypermail 2b25 : Tue Oct 23 2001 - 05:19:54 CDT