This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: [PATCH] A generic basic_filebuf::_M_underflow


Paolo Carlini wrote:
> Pétur Runólfsson wrote:
> 
> >Hi,
> >
> >This patch removes the specializations of basic_filebuf::_M_underflow
> >and adds a generic version, based on the old wchar_t specialization.
> >
> This is great stuff, but before providing a generic version 
> based on the 
> current wchar_t
> I think the latter should be polished a bit more: see my 
> recent posting 
> and another, more
> substantive, forthcoming.

Paolo,

I won't have time over the next couple of weeks to keep this patch up
to date every time you change basic_filebuf. Can I ask you to resend
this when you think it's ready?

The only changes I made to _M_underflow were:
1) Add support for codecvt_base::noconv (this is only needed when
   _CharT = char, so the wchar_t version didn't have it)

				 this->_M_in_beg + _M_buf_size, __iend);
		  if (__r == codecvt_base::ok)
		    __ilen = __iend - this->_M_in_beg;
+ 		  else if (__r == codecvt_base::noconv)
+ 		    {
+ 		      traits_type::copy(this->_M_in_beg,
+ 					reinterpret_cast<const char_type*>(__buf),
+ 					__elen);
+ 		      __ilen = __elen;
+ 		    }
		  else 
		    {
		      // Unwind.

2) Remove the block containing the _M_file.sys_ungetc() call.

3) Qualify _M_in_beg and other members of basic_streambuf with this->

Thanks in advance,
Petur


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]