C++Talk.NET Forum Index C++Talk.NET
C++ language newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

wbuffer_convert

 
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ language, library and standards
View previous topic :: View next topic  
Author Message
tom_usenet
Guest





PostPosted: Mon Apr 05, 2004 6:32 pm    Post subject: wbuffer_convert Reply with 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<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





PostPosted: Mon Apr 05, 2004 8:40 pm    Post subject: Re: wbuffer_convert Reply with quote



"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
Display posts from previous:   
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ language, library and standards All times are GMT
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.