34template <
class _CharT,
class _Traits>
35basic_streambuf<_CharT, _Traits>::
36basic_streambuf (ios_base::openmode __mode )
51template <
class _CharT,
class _Traits>
52typename basic_streambuf<_CharT, _Traits>::int_type
53basic_streambuf<_CharT, _Traits>::
58 const int_type __c = underflow ();
60 if (traits_type::eq_int_type (__c, traits_type::eof ()))
61 return traits_type::eof ();
64 if (_C_gptr < _C_egptr)
65 return traits_type::to_int_type (*_C_gptr++);
71template <
class _CharT,
class _Traits>
73basic_streambuf<_CharT, _Traits>::
74xsgetn (char_type* __buf, streamsize __n)
79 streamsize __nget = 0;
87 const int_type __c = gptr () == egptr () ?
88 underflow () : traits_type::not_eof (traits_type::eof ());
91 streamsize __navail = egptr () - gptr ();
98 traits_type::copy (__buf + __nget, gptr (), __navail);
106 else if (traits_type::eq_int_type (__c, traits_type::eof ())) {
115 traits_type::assign (__buf [__nget],
116 traits_type::to_char_type (__c));
128template<
class _CharT,
class _Traits>
130basic_streambuf<_CharT, _Traits>::
131xsputn (
const char_type* __buf, streamsize __n)
136 if (__n <= 0 || !_C_is_out ())
139 streamsize __nput = 0;
141 for (; ; ++__buf, --__n, ++__nput) {
142 const streamsize __navail = epptr () - pptr ();
143 const streamsize __nwrite = __navail < __n ? __navail : __n;
145 traits_type::copy (pptr (), __buf, __nwrite);
157 const int_type __c = overflow (traits_type::to_int_type (*__buf));
159 if (traits_type::eq_int_type (traits_type::eof (), __c))
#define _RWSTD_NAMESPACE(name)
#define _RWSTD_ASSERT(ignore)