 |
C++Talk.NET C++ language newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
tom_usenet Guest
|
Posted: Mon Apr 05, 2004 6:32 pm Post subject: wbuffer_convert |
|
|
Does anyone else think that something like Dinkumware's wbuffer would
be a good candidate for standardization? Writing wide character
streambufs is currently a pain in the neck - it should be unnecessary
in most cases. See
http://www.dinkumware.com/manuals/reader.aspx?b=cx/&h=wbuffer.html
It could be generalised further to convert between arbitrary character
types I think...
Currently you have to do, e.g.
template <class CharT, class Traits>
class MyStreambuf: public basic_streambuf<CharT, Traits>
{
//scary implementation using codecvt?
};
whereas it would be much simpler to do:
class MyStreambuf: public std::streambuf
{
//simple implementation for char
};
//code conversion hidden in wbuffer_convert
typedef codecvt<wchar_t, char, mbstate_t> cvt;
typedef wbuffer_convert<cvt> wbuf;
wbuf myBuf(new MyStreambuf);
Obviously some cooperation from Dinkumware might be necessary or at
least helpful...
Tom
--
C++ FAQ: http://www.parashift.com/c++-faq-lite/
C FAQ: http://www.eskimo.com/~scs/C-faq/top.html
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html ]
|
|
| Back to top |
|
 |
P.J. Plauger Guest
|
Posted: Mon Apr 05, 2004 8:40 pm Post subject: Re: wbuffer_convert |
|
|
"tom_usenet" <tom_usenet (AT) hotmail (DOT) com> wrote
| Quote: | Does anyone else think that something like Dinkumware's wbuffer would
be a good candidate for standardization? Writing wide character
streambufs is currently a pain in the neck - it should be unnecessary
in most cases. See
http://www.dinkumware.com/manuals/reader.aspx?b=cx/&h=wbuffer.html
It could be generalised further to convert between arbitrary character
types I think...
Currently you have to do, e.g.
template <class CharT, class Traits
class MyStreambuf: public basic_streambuf
{
//scary implementation using codecvt?
};
whereas it would be much simpler to do:
class MyStreambuf: public std::streambuf
{
//simple implementation for char
};
//code conversion hidden in wbuffer_convert
typedef codecvt
typedef wbuffer_convert<cvt> wbuf;
wbuf myBuf(new MyStreambuf);
Obviously some cooperation from Dinkumware might be necessary or at
least helpful...
|
We have no problem with wbuffer_convert being proposed for standardization,
but we're in no hurry to propose that ourselves. We prefer the old
fashioned approach of getting experience, and refining design based on
user feedback, before foisting a feature on all implementations.
P.J. Plauger
Dinkumware, Ltd.
http://www.dinkumware.com
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html ]
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|