-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi folks,

In an application I maintain, I use printf along with GNU gettext to
output translated messages.  The format string allows the order of the
parameters in the string to be changed if the tranlation requires it.

I've since rewritten the application in C++, but it's still using
printf() for output.  I would like to switch to iostreams, but I need
to be able to continue to use format strings for translated messages,
because 'ostream<<' does not allow reordering; it's fixed at compile
time.  I can't see anything in e.g. basic_ostream<> that allows this.

Another case is exceptions, where the string is localised and also
takes a parameter.  I could use snprintf and then create a string from
that, but ideally I'd like to output to a std::ostringstream or
std::string directly.  I can't see this supported in the standard.

Are there any GNU extensions that allow this, or could anyone suggest
an alternate solution?


Many thanks,
Roger

- -- 
Roger Leigh
                Printing on GNU/Linux?  http://gimp-print.sourceforge.net/
                Debian GNU/Linux        http://www.debian.org/
                GPG Public Key: 0x25BFB848.  Please sign and encrypt your mail.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)
Comment: Processed by Mailcrypt 3.5.8+ <http://mailcrypt.sourceforge.net/>

iD8DBQFDpFetVcFcaSW/uEgRAkY/AJ9FLAF/yDvfMDjE5bOFlrgnVJISiACeMsd/
aBGbJ1fgzMpDSXrpcbuHlec=
=JcYc
-----END PGP SIGNATURE-----
_______________________________________________
Help-gplusplus mailing list
Help-gplusplus@gnu.org
http://lists.gnu.org/mailman/listinfo/help-gplusplus

Reply via email to