ReactOS  0.4.14-dev-337-gf981a68
basic_streambuf< _CharT, _Traits > Class Template Reference

#include <_iosfwd.h>

Inheritance diagram for basic_streambuf< _CharT, _Traits >:
Collaboration diagram for basic_streambuf< _CharT, _Traits >:

Public Types

typedef _CharT char_type
 
typedef _Traits::int_type int_type
 
typedef _Traits::pos_type pos_type
 
typedef _Traits::off_type off_type
 
typedef _Traits traits_type
 

Public Member Functions

virtual ~basic_streambuf ()
 
char_type_M_eback () const
 
char_type_M_gptr () const
 
char_type_M_egptr () const
 
void _M_gbump (int __n)
 
void _M_setg (char_type *__gbegin, char_type *__gnext, char_type *__gend)
 
basic_streambuf< _CharT, _Traits > * pubsetbuf (char_type *__s, streamsize __n)
 
pos_type pubseekoff (off_type __offset, ios_base::seekdir __way, ios_base::openmode __mod=ios_base::in|ios_base::out)
 
pos_type pubseekpos (pos_type __sp, ios_base::openmode __mod=ios_base::in|ios_base::out)
 
int pubsync ()
 
int_type sputc (char_type __c)
 
streamsize sputn (const char_type *__s, streamsize __n)
 
streamsize _M_sputnc (char_type __c, streamsize __n)
 
streamsize in_avail ()
 
int_type snextc ()
 
int_type sbumpc ()
 
int_type sgetc ()
 
streamsize sgetn (char_type *__s, streamsize __n)
 
int_type sputbackc (char_type __c)
 
int_type sungetc ()
 
locale pubimbue (const locale &)
 
locale getloc () const
 
void stossc ()
 

Protected Member Functions

 basic_streambuf ()
 
char_typeeback () const
 
char_typegptr () const
 
char_typeegptr () const
 
void gbump (int __n)
 
void setg (char_type *__gbegin, char_type *__gnext, char_type *__gend)
 
char_typepbase () const
 
char_typepptr () const
 
char_typeepptr () const
 
void pbump (int __n)
 
void setp (char_type *__pbegin, char_type *__pend)
 
virtual basic_streambuf< _CharT, _Traits > * setbuf (char_type *, streamsize)
 
virtual pos_type seekoff (off_type, ios_base::seekdir, ios_base::openmode=ios_base::in|ios_base::out)
 
virtual pos_type seekpos (pos_type, ios_base::openmode=ios_base::in|ios_base::out)
 
virtual int sync ()
 
virtual streamsize showmanyc ()
 
virtual streamsize xsgetn (char_type *__s, streamsize __n)
 
virtual int_type underflow ()
 
virtual int_type uflow ()
 
virtual int_type pbackfail (int_type=traits_type::eof())
 
virtual streamsize xsputn (const char_type *__s, streamsize __n)
 
virtual streamsize _M_xsputnc (char_type __c, streamsize __n)
 
virtual int_type overflow (int_type=traits_type::eof())
 
virtual void imbue (const locale &)
 

Private Member Functions

int_type _M_snextc_aux ()
 

Private Attributes

char_type_M_gbegin
 
char_type_M_gnext
 
char_type_M_gend
 
char_type_M_pbegin
 
char_type_M_pnext
 
char_type_M_pend
 
locale _M_locale
 

Friends

class basic_istream< _CharT, _Traits >
 
class basic_ostream< _CharT, _Traits >
 

Detailed Description

template<class _CharT, class _Traits>
class basic_streambuf< _CharT, _Traits >

Definition at line 33 of file _iosfwd.h.

Member Typedef Documentation

◆ char_type

template<class _CharT, class _Traits>
typedef _CharT basic_streambuf< _CharT, _Traits >::char_type

Definition at line 53 of file _streambuf.h.

◆ int_type

template<class _CharT, class _Traits>
typedef _Traits::int_type basic_streambuf< _CharT, _Traits >::int_type

Definition at line 54 of file _streambuf.h.

◆ off_type

template<class _CharT, class _Traits>
typedef _Traits::off_type basic_streambuf< _CharT, _Traits >::off_type

Definition at line 56 of file _streambuf.h.

◆ pos_type

template<class _CharT, class _Traits>
typedef _Traits::pos_type basic_streambuf< _CharT, _Traits >::pos_type

Definition at line 55 of file _streambuf.h.

◆ traits_type

template<class _CharT, class _Traits>
typedef _Traits basic_streambuf< _CharT, _Traits >::traits_type

Definition at line 57 of file _streambuf.h.

Constructor & Destructor Documentation

◆ ~basic_streambuf()

template<class _CharT , class _Traits >
basic_streambuf< _CharT, _Traits >::~basic_streambuf ( )
virtual

Definition at line 40 of file _streambuf.c.

41 {}

◆ basic_streambuf()

template<class _CharT , class _Traits >
_STLP_BEGIN_NAMESPACE basic_streambuf< _CharT, _Traits >::basic_streambuf ( )
protected

Definition at line 31 of file _streambuf.c.

32  : _M_gbegin(0), _M_gnext(0), _M_gend(0),
33  _M_pbegin(0), _M_pnext(0), _M_pend(0),
34  _M_locale() {
35  // _M_lock._M_initialize();
36 }
locale _M_locale
Definition: _streambuf.h:69
char_type * _M_gend
Definition: _streambuf.h:63
char_type * _M_pnext
Definition: _streambuf.h:66
char_type * _M_gnext
Definition: _streambuf.h:62
char_type * _M_pend
Definition: _streambuf.h:67
char_type * _M_gbegin
Definition: _streambuf.h:61
char_type * _M_pbegin
Definition: _streambuf.h:65

Member Function Documentation

◆ _M_eback()

template<class _CharT, class _Traits>
char_type* basic_streambuf< _CharT, _Traits >::_M_eback ( ) const
inline

Definition at line 102 of file _streambuf.h.

102 { return eback(); }
char_type * eback() const
Definition: _streambuf.h:87

◆ _M_egptr()

template<class _CharT, class _Traits>
char_type* basic_streambuf< _CharT, _Traits >::_M_egptr ( ) const
inline

Definition at line 104 of file _streambuf.h.

104 { return egptr(); }
char_type * egptr() const
Definition: _streambuf.h:89

Referenced by __copy_buffered(), __read_buffered(), and _M_ignore_buffered().

◆ _M_gbump()

template<class _CharT, class _Traits>
void basic_streambuf< _CharT, _Traits >::_M_gbump ( int  __n)
inline

Definition at line 105 of file _streambuf.h.

105 { gbump(__n); }
void gbump(int __n)
Definition: _streambuf.h:91
return __n
Definition: _algo.h:75

Referenced by __copy_buffered(), __read_buffered(), and _M_ignore_buffered().

◆ _M_gptr()

template<class _CharT, class _Traits>
char_type* basic_streambuf< _CharT, _Traits >::_M_gptr ( ) const
inline

Definition at line 103 of file _streambuf.h.

103 { return gptr(); }
char_type * gptr() const
Definition: _streambuf.h:88

Referenced by __copy_buffered(), __read_buffered(), and _M_ignore_buffered().

◆ _M_setg()

template<class _CharT, class _Traits>
void basic_streambuf< _CharT, _Traits >::_M_setg ( char_type __gbegin,
char_type __gnext,
char_type __gend 
)
inline

Definition at line 106 of file _streambuf.h.

107  { this->setg(__gbegin, __gnext, __gend); }
void setg(char_type *__gbegin, char_type *__gnext, char_type *__gend)
Definition: _streambuf.h:92

◆ _M_snextc_aux()

template<class _CharT , class _Traits >
_STLP_TYPENAME_ON_RETURN_TYPE basic_streambuf< _CharT, _Traits >::int_type basic_streambuf< _CharT, _Traits >::_M_snextc_aux ( )
private

Definition at line 137 of file _streambuf.c.

138 {
139  int_type __eof = _Traits::eof();
140  if (_M_gend == _M_gnext)
141  return _Traits::eq_int_type(this->uflow(), __eof) ? __eof : this->sgetc();
142  else {
143  _M_gnext = _M_gend;
144  return this->underflow();
145  }
146 }
_Traits::int_type int_type
Definition: _streambuf.h:54
char_type * _M_gend
Definition: _streambuf.h:63
char_type * _M_gnext
Definition: _streambuf.h:62
_Check_return_ _CRTIMP int __cdecl __cdecl eof(_In_ int _FileHandle)
virtual int_type uflow()
Definition: _streambuf.c:162
int_type sgetc()
Definition: _streambuf.h:233
virtual int_type underflow()
Definition: _streambuf.c:170

Referenced by basic_streambuf< char, char_traits< char > >::snextc().

◆ _M_sputnc()

template<class _CharT, class _Traits>
streamsize basic_streambuf< _CharT, _Traits >::_M_sputnc ( char_type  __c,
streamsize  __n 
)
inline

Definition at line 208 of file _streambuf.h.

209  { return this->_M_xsputnc(__c, __n); }
return __n
Definition: _algo.h:75
#define __c
Definition: schilyio.h:209
virtual streamsize _M_xsputnc(char_type __c, streamsize __n)
Definition: _streambuf.c:112

◆ _M_xsputnc()

template<class _CharT , class _Traits >
streamsize basic_streambuf< _CharT, _Traits >::_M_xsputnc ( char_type  __c,
streamsize  __n 
)
protectedvirtual

Reimplemented in basic_stringbuf< _CharT, _Traits, _Alloc >.

Definition at line 112 of file _streambuf.c.

113 {
114  streamsize __result = 0;
115  const int_type __eof = _Traits::eof();
116 
117  while (__result < __n) {
118  if (_M_pnext < _M_pend) {
119  size_t __chunk = (min) (__STATIC_CAST(size_t,_M_pend - _M_pnext),
120  __STATIC_CAST(size_t,__n - __result));
121  _Traits::assign(_M_pnext, __chunk, __c);
122  __result += __chunk;
123  _M_pnext += __chunk;
124  }
125 
126  else if (!_Traits::eq_int_type(this->overflow(_Traits::to_int_type(__c)),
127  __eof))
128  ++__result;
129  else
130  break;
131  }
132  return __result;
133 }
_Traits::int_type int_type
Definition: _streambuf.h:54
return __n
Definition: _algo.h:75
#define __STATIC_CAST(__x, __y)
Definition: features.h:585
#define __c
Definition: schilyio.h:209
char_type * _M_pnext
Definition: _streambuf.h:66
virtual int_type overflow(int_type=traits_type::eof())
Definition: _streambuf.c:156
_Check_return_ _CRTIMP int __cdecl __cdecl eof(_In_ int _FileHandle)
#define min(a, b)
Definition: monoChain.cc:55
ptrdiff_t streamsize
Definition: char_traits.h:81
char_type * _M_pend
Definition: _streambuf.h:67

Referenced by basic_streambuf< char, char_traits< char > >::_M_sputnc().

◆ eback()

template<class _CharT, class _Traits>
char_type* basic_streambuf< _CharT, _Traits >::eback ( ) const
inlineprotected

Definition at line 87 of file _streambuf.h.

87 { return _M_gbegin; } // Beginning
char_type * _M_gbegin
Definition: _streambuf.h:61

Referenced by basic_streambuf< char, char_traits< char > >::_M_eback().

◆ egptr()

◆ epptr()

template<class _CharT, class _Traits>
char_type* basic_streambuf< _CharT, _Traits >::epptr ( ) const
inlineprotected

Definition at line 113 of file _streambuf.h.

113 { return _M_pend; } // End
char_type * _M_pend
Definition: _streambuf.h:67

◆ gbump()

template<class _CharT, class _Traits>
void basic_streambuf< _CharT, _Traits >::gbump ( int  __n)
inlineprotected

◆ getloc()

template<class _CharT, class _Traits>
locale basic_streambuf< _CharT, _Traits >::getloc ( ) const
inline

Definition at line 263 of file _streambuf.h.

263 { return _M_locale; }
locale _M_locale
Definition: _streambuf.h:69

◆ gptr()

◆ imbue()

template<class _CharT , class _Traits >
void basic_streambuf< _CharT, _Traits >::imbue ( const locale )
protectedvirtual

Reimplemented in basic_filebuf< _CharT, _Traits >, and basic_filebuf< char, char_traits< char > >.

Definition at line 180 of file _streambuf.c.

180 {}

◆ in_avail()

template<class _CharT, class _Traits>
streamsize basic_streambuf< _CharT, _Traits >::in_avail ( )
inline

Definition at line 215 of file _streambuf.h.

215  {
216  return (_M_gnext < _M_gend) ? (_M_gend - _M_gnext) : this->showmanyc();
217  }
char_type * _M_gend
Definition: _streambuf.h:63
char_type * _M_gnext
Definition: _streambuf.h:62
virtual streamsize showmanyc()
Definition: _streambuf.c:175

Referenced by basic_istream< char, char_traits< char > >::readsome().

◆ overflow()

template<class _CharT , class _Traits >
_STLP_TYPENAME_ON_RETURN_TYPE basic_streambuf< _CharT, _Traits >::int_type basic_streambuf< _CharT, _Traits >::overflow ( int_type  = traits_type::eof())
protectedvirtual

Reimplemented in basic_filebuf< _CharT, _Traits >, basic_filebuf< char, char_traits< char > >, and basic_stringbuf< _CharT, _Traits, _Alloc >.

Definition at line 156 of file _streambuf.c.

156  {
157  return _Traits::eof();
158 }
_Check_return_ _CRTIMP int __cdecl __cdecl eof(_In_ int _FileHandle)

Referenced by basic_streambuf< char, char_traits< char > >::sputc().

◆ pbackfail()

template<class _CharT , class _Traits >
_STLP_TYPENAME_ON_RETURN_TYPE basic_streambuf< _CharT, _Traits >::int_type basic_streambuf< _CharT, _Traits >::pbackfail ( int_type  = traits_type::eof())
protectedvirtual

Reimplemented in basic_filebuf< _CharT, _Traits >, basic_filebuf< char, char_traits< char > >, and basic_stringbuf< _CharT, _Traits, _Alloc >.

Definition at line 150 of file _streambuf.c.

150  {
151  return _Traits::eof();
152 }
_Check_return_ _CRTIMP int __cdecl __cdecl eof(_In_ int _FileHandle)

Referenced by basic_streambuf< char, char_traits< char > >::sputbackc(), and basic_streambuf< char, char_traits< char > >::sungetc().

◆ pbase()

template<class _CharT, class _Traits>
char_type* basic_streambuf< _CharT, _Traits >::pbase ( ) const
inlineprotected

Definition at line 111 of file _streambuf.h.

111 { return _M_pbegin; } // Beginning
char_type * _M_pbegin
Definition: _streambuf.h:65

◆ pbump()

template<class _CharT, class _Traits>
void basic_streambuf< _CharT, _Traits >::pbump ( int  __n)
inlineprotected

Definition at line 115 of file _streambuf.h.

115 { _M_pnext += __n; }
return __n
Definition: _algo.h:75
char_type * _M_pnext
Definition: _streambuf.h:66

◆ pptr()

template<class _CharT, class _Traits>
char_type* basic_streambuf< _CharT, _Traits >::pptr ( ) const
inlineprotected

Definition at line 112 of file _streambuf.h.

112 { return _M_pnext; } // Current position
char_type * _M_pnext
Definition: _streambuf.h:66

◆ pubimbue()

template<class _CharT , class _Traits >
locale basic_streambuf< _CharT, _Traits >::pubimbue ( const locale __loc)

Definition at line 45 of file _streambuf.c.

45  {
46  this->imbue(__loc);
47  locale __tmp = _M_locale;
48  _M_locale = __loc;
49  return __tmp;
50 }
virtual void imbue(const locale &)
Definition: _streambuf.c:180
Definition: _locale.h:75
locale _M_locale
Definition: _streambuf.h:69

◆ pubseekoff()

template<class _CharT, class _Traits>
pos_type basic_streambuf< _CharT, _Traits >::pubseekoff ( off_type  __offset,
ios_base::seekdir  __way,
ios_base::openmode  __mod = ios_base::in | ios_base::out 
)
inline

Definition at line 145 of file _streambuf.h.

147  { return this->seekoff(__offset, __way, __mod); }
virtual pos_type seekoff(off_type, ios_base::seekdir, ios_base::openmode=ios_base::in|ios_base::out)
Definition: _streambuf.c:193

Referenced by basic_istream< char, char_traits< char > >::seekg(), and basic_istream< char, char_traits< char > >::tellg().

◆ pubseekpos()

template<class _CharT, class _Traits>
pos_type basic_streambuf< _CharT, _Traits >::pubseekpos ( pos_type  __sp,
ios_base::openmode  __mod = ios_base::in | ios_base::out 
)
inline

Definition at line 149 of file _streambuf.h.

151  { return this->seekpos(__sp, __mod); }
virtual pos_type seekpos(pos_type, ios_base::openmode=ios_base::in|ios_base::out)
Definition: _streambuf.c:188

Referenced by basic_istream< char, char_traits< char > >::seekg().

◆ pubsetbuf()

template<class _CharT, class _Traits>
basic_streambuf<_CharT, _Traits>* basic_streambuf< _CharT, _Traits >::pubsetbuf ( char_type __s,
streamsize  __n 
)
inline

Definition at line 142 of file _streambuf.h.

143  { return this->setbuf(__s, __n); }
return __n
Definition: _algo.h:75
virtual basic_streambuf< _CharT, _Traits > * setbuf(char_type *, streamsize)
Definition: _streambuf.c:199

◆ pubsync()

template<class _CharT, class _Traits>
int basic_streambuf< _CharT, _Traits >::pubsync ( )
inline

Definition at line 153 of file _streambuf.h.

153 { return this->sync(); }
virtual int sync()
Definition: _streambuf.c:184

Referenced by basic_istream< char, char_traits< char > >::sync().

◆ sbumpc()

template<class _CharT, class _Traits>
int_type basic_streambuf< _CharT, _Traits >::sbumpc ( )
inline

◆ seekoff()

template<class _CharT , class _Traits >
_STLP_TYPENAME_ON_RETURN_TYPE basic_streambuf< _CharT, _Traits >::pos_type basic_streambuf< _CharT, _Traits >::seekoff ( off_type  ,
ios_base::seekdir  ,
ios_base::openmode  = ios_base::in | ios_base::out 
)
protectedvirtual

◆ seekpos()

template<class _CharT , class _Traits >
_STLP_TYPENAME_ON_RETURN_TYPE basic_streambuf< _CharT, _Traits >::pos_type basic_streambuf< _CharT, _Traits >::seekpos ( pos_type  ,
ios_base::openmode  = ios_base::in | ios_base::out 
)
protectedvirtual

◆ setbuf()

template<class _CharT , class _Traits >
basic_streambuf< _CharT, _Traits > * basic_streambuf< _CharT, _Traits >::setbuf ( char_type ,
streamsize   
)
protectedvirtual

◆ setg()

template<class _CharT, class _Traits>
void basic_streambuf< _CharT, _Traits >::setg ( char_type __gbegin,
char_type __gnext,
char_type __gend 
)
inlineprotected

◆ setp()

template<class _CharT, class _Traits>
void basic_streambuf< _CharT, _Traits >::setp ( char_type __pbegin,
char_type __pend 
)
inlineprotected

Definition at line 116 of file _streambuf.h.

116  {
117  _M_pbegin = __pbegin;
118  _M_pnext = __pbegin;
119  _M_pend = __pend;
120  }
char_type * _M_pnext
Definition: _streambuf.h:66
char_type * _M_pend
Definition: _streambuf.h:67
char_type * _M_pbegin
Definition: _streambuf.h:65

Referenced by basic_filebuf< char, char_traits< char > >::_M_seek_return().

◆ sgetc()

template<class _CharT, class _Traits>
int_type basic_streambuf< _CharT, _Traits >::sgetc ( )
inline

Definition at line 233 of file _streambuf.h.

233  {
234  return _M_gnext < _M_gend ? _Traits::to_int_type(*_M_gnext)
235  : this->underflow();
236  }
char_type * _M_gend
Definition: _streambuf.h:63
char_type * _M_gnext
Definition: _streambuf.h:62
virtual int_type underflow()
Definition: _streambuf.c:170

Referenced by __copy_buffered(), __read_buffered(), basic_ostream< char, char_traits< char > >::_M_copy_buffered(), istreambuf_iterator< _CharT, _Traits >::_M_getc(), and _M_ignore_buffered().

◆ sgetn()

template<class _CharT, class _Traits>
streamsize basic_streambuf< _CharT, _Traits >::sgetn ( char_type __s,
streamsize  __n 
)
inline

Definition at line 238 of file _streambuf.h.

239  { return this->xsgetn(__s, __n); }
return __n
Definition: _algo.h:75
virtual streamsize xsgetn(char_type *__s, streamsize __n)
Definition: _streambuf.c:54

◆ showmanyc()

template<class _CharT , class _Traits >
streamsize basic_streambuf< _CharT, _Traits >::showmanyc ( )
protectedvirtual

◆ snextc()

template<class _CharT, class _Traits>
int_type basic_streambuf< _CharT, _Traits >::snextc ( )
inline

Definition at line 220 of file _streambuf.h.

220  {
221  return ( _M_gend - _M_gnext > 1 ?
222  _Traits::to_int_type(*++_M_gnext) :
223  this->_M_snextc_aux());
224  }
int_type _M_snextc_aux()
Definition: _streambuf.c:137
char_type * _M_gend
Definition: _streambuf.h:63
char_type * _M_gnext
Definition: _streambuf.h:62

◆ sputbackc()

template<class _CharT, class _Traits>
int_type basic_streambuf< _CharT, _Traits >::sputbackc ( char_type  __c)
inline

Definition at line 241 of file _streambuf.h.

241  {
242  return ((_M_gbegin < _M_gnext) && _Traits::eq(__c, *(_M_gnext - 1)))
243  ? _Traits::to_int_type(*--_M_gnext)
244  : this->pbackfail(_Traits::to_int_type(__c));
245  }
virtual int_type pbackfail(int_type=traits_type::eof())
Definition: _streambuf.c:150
#define eq(received, expected, label, type)
Definition: locale.c:144
#define __c
Definition: schilyio.h:209
char_type * _M_gnext
Definition: _streambuf.h:62
char_type * _M_gbegin
Definition: _streambuf.h:61

Referenced by __pushback(), _M_ignore_unbuffered(), operator >>(), operator>>(), basic_istream< char, char_traits< char > >::putback(), and _SPutBackC< _CharT, _Traits >::~_SPutBackC().

◆ sputc()

template<class _CharT, class _Traits>
int_type basic_streambuf< _CharT, _Traits >::sputc ( char_type  __c)
inline

Definition at line 198 of file _streambuf.h.

198  {
199  return ((_M_pnext < _M_pend) ? _Traits::to_int_type(*_M_pnext++ = __c)
200  : this->overflow(_Traits::to_int_type(__c)));
201  }
#define __c
Definition: schilyio.h:209
char_type * _M_pnext
Definition: _streambuf.h:66
virtual int_type overflow(int_type=traits_type::eof())
Definition: _streambuf.c:156
char_type * _M_pend
Definition: _streambuf.h:67

Referenced by __copy_unbuffered(), __stlp_string_fill(), basic_ostream< char, char_traits< char > >::_M_copy_unbuffered(), basic_ostream< char, char_traits< char > >::_M_put_widen_aux(), and ostreambuf_iterator< _CharT, _Traits >::operator=().

◆ sputn()

template<class _CharT, class _Traits>
streamsize basic_streambuf< _CharT, _Traits >::sputn ( const char_type __s,
streamsize  __n 
)
inline

Definition at line 204 of file _streambuf.h.

205  { return this->xsputn(__s, __n); }
return __n
Definition: _algo.h:75
virtual streamsize xsputn(const char_type *__s, streamsize __n)
Definition: _streambuf.c:84

Referenced by __copy_buffered(), basic_ostream< char, char_traits< char > >::_M_copy_buffered(), and operator<<().

◆ stossc()

template<class _CharT, class _Traits>
void basic_streambuf< _CharT, _Traits >::stossc ( )
inline

Definition at line 266 of file _streambuf.h.

266 { this->sbumpc(); }
int_type sbumpc()
Definition: _streambuf.h:227

◆ sungetc()

template<class _CharT, class _Traits>
int_type basic_streambuf< _CharT, _Traits >::sungetc ( )
inline

Definition at line 247 of file _streambuf.h.

247  {
248  return (_M_gbegin < _M_gnext)
249  ? _Traits::to_int_type(*--_M_gnext)
250  : this->pbackfail();
251  }
virtual int_type pbackfail(int_type=traits_type::eof())
Definition: _streambuf.c:150
char_type * _M_gnext
Definition: _streambuf.h:62
char_type * _M_gbegin
Definition: _streambuf.h:61

Referenced by basic_istream< char, char_traits< char > >::unget().

◆ sync()

template<class _CharT , class _Traits >
int basic_streambuf< _CharT, _Traits >::sync ( )
protectedvirtual

◆ uflow()

template<class _CharT , class _Traits >
_STLP_TYPENAME_ON_RETURN_TYPE basic_streambuf< _CharT, _Traits >::int_type basic_streambuf< _CharT, _Traits >::uflow ( )
protectedvirtual

Reimplemented in stdio_istreambuf, and basic_stringbuf< _CharT, _Traits, _Alloc >.

Definition at line 162 of file _streambuf.c.

162  {
163  return ( _Traits::eq_int_type(this->underflow(),_Traits::eof()) ?
164  _Traits::eof() :
165  _Traits::to_int_type(*_M_gnext++));
166 }
char_type * _M_gnext
Definition: _streambuf.h:62
_Check_return_ _CRTIMP int __cdecl __cdecl eof(_In_ int _FileHandle)
virtual int_type underflow()
Definition: _streambuf.c:170

Referenced by basic_streambuf< char, char_traits< char > >::sbumpc().

◆ underflow()

template<class _CharT , class _Traits >
_STLP_TYPENAME_ON_RETURN_TYPE basic_streambuf< _CharT, _Traits >::int_type basic_streambuf< _CharT, _Traits >::underflow ( )
protectedvirtual

Reimplemented in basic_filebuf< _CharT, _Traits >, basic_filebuf< char, char_traits< char > >, stdio_istreambuf, basic_stringbuf< _CharT, _Traits, _Alloc >, and strstreambuf.

Definition at line 170 of file _streambuf.c.

171 { return _Traits::eof(); }
_Check_return_ _CRTIMP int __cdecl __cdecl eof(_In_ int _FileHandle)

Referenced by basic_streambuf< char, char_traits< char > >::sgetc().

◆ xsgetn()

template<class _CharT , class _Traits >
streamsize basic_streambuf< _CharT, _Traits >::xsgetn ( char_type __s,
streamsize  __n 
)
protectedvirtual

Definition at line 54 of file _streambuf.c.

54  {
55  streamsize __result = 0;
56  const int_type __eof = _Traits::eof();
57 
58  while (__result < __n) {
59  if (_M_gnext < _M_gend) {
60  size_t __chunk = (min) (__STATIC_CAST(size_t,_M_gend - _M_gnext),
61  __STATIC_CAST(size_t,__n - __result));
62  _Traits::copy(__s, _M_gnext, __chunk);
63  __result += __chunk;
64  __s += __chunk;
65  _M_gnext += __chunk;
66  }
67  else {
68  int_type __c = this->sbumpc();
69  if (!_Traits::eq_int_type(__c, __eof)) {
70  *__s = _Traits::to_char_type(__c);
71  ++__result;
72  ++__s;
73  }
74  else
75  break;
76  }
77  }
78 
79  return __result;
80 }
_Traits::int_type int_type
Definition: _streambuf.h:54
return __n
Definition: _algo.h:75
#define __STATIC_CAST(__x, __y)
Definition: features.h:585
#define __c
Definition: schilyio.h:209
char_type * _M_gend
Definition: _streambuf.h:63
int_type sbumpc()
Definition: _streambuf.h:227
char_type * _M_gnext
Definition: _streambuf.h:62
_Check_return_ _CRTIMP int __cdecl __cdecl eof(_In_ int _FileHandle)
INT copy(TCHAR source[MAX_PATH], TCHAR dest[MAX_PATH], INT append, DWORD lpdwFlags, BOOL bTouch)
Definition: copy.c:51
#define min(a, b)
Definition: monoChain.cc:55
ptrdiff_t streamsize
Definition: char_traits.h:81

Referenced by basic_streambuf< char, char_traits< char > >::sgetn().

◆ xsputn()

template<class _CharT , class _Traits >
streamsize basic_streambuf< _CharT, _Traits >::xsputn ( const char_type __s,
streamsize  __n 
)
protectedvirtual

Reimplemented in basic_stringbuf< _CharT, _Traits, _Alloc >.

Definition at line 84 of file _streambuf.c.

85 {
86  streamsize __result = 0;
87  const int_type __eof = _Traits::eof();
88 
89  while (__result < __n) {
90  if (_M_pnext < _M_pend) {
91  size_t __chunk = (min) (__STATIC_CAST(size_t,_M_pend - _M_pnext),
92  __STATIC_CAST(size_t,__n - __result));
93  _Traits::copy(_M_pnext, __s, __chunk);
94  __result += __chunk;
95  __s += __chunk;
96  _M_pnext += __chunk;
97  }
98 
99  else if (!_Traits::eq_int_type(this->overflow(_Traits::to_int_type(*__s)),
100  __eof)) {
101  ++__result;
102  ++__s;
103  }
104  else
105  break;
106  }
107  return __result;
108 }
_Traits::int_type int_type
Definition: _streambuf.h:54
return __n
Definition: _algo.h:75
#define __STATIC_CAST(__x, __y)
Definition: features.h:585
char_type * _M_pnext
Definition: _streambuf.h:66
virtual int_type overflow(int_type=traits_type::eof())
Definition: _streambuf.c:156
_Check_return_ _CRTIMP int __cdecl __cdecl eof(_In_ int _FileHandle)
INT copy(TCHAR source[MAX_PATH], TCHAR dest[MAX_PATH], INT append, DWORD lpdwFlags, BOOL bTouch)
Definition: copy.c:51
#define min(a, b)
Definition: monoChain.cc:55
ptrdiff_t streamsize
Definition: char_traits.h:81
char_type * _M_pend
Definition: _streambuf.h:67

Referenced by basic_streambuf< char, char_traits< char > >::sputn().

Friends And Related Function Documentation

◆ basic_istream< _CharT, _Traits >

template<class _CharT, class _Traits>
friend class basic_istream< _CharT, _Traits >
friend

Definition at line 49 of file _streambuf.h.

◆ basic_ostream< _CharT, _Traits >

template<class _CharT, class _Traits>
friend class basic_ostream< _CharT, _Traits >
friend

Definition at line 50 of file _streambuf.h.

Member Data Documentation

◆ _M_gbegin

◆ _M_gend

◆ _M_gnext

◆ _M_locale

template<class _CharT, class _Traits>
locale basic_streambuf< _CharT, _Traits >::_M_locale
private

Definition at line 69 of file _streambuf.h.

Referenced by basic_streambuf< char, char_traits< char > >::getloc().

◆ _M_pbegin

template<class _CharT, class _Traits>
char_type* basic_streambuf< _CharT, _Traits >::_M_pbegin
private

◆ _M_pend

template<class _CharT, class _Traits>
char_type* basic_streambuf< _CharT, _Traits >::_M_pend
private

◆ _M_pnext


The documentation for this class was generated from the following files: