ReactOS 0.4.15-dev-7924-g5949c20
istreambuf_iterator< _CharT, _Traits > Class Template Reference

#include <_istreambuf_iterator.h>

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

Public Types

typedef _CharT char_type
 
typedef _Traits traits_type
 
typedef _Traits::int_type int_type
 
typedef basic_streambuf< _CharT, _Traits > streambuf_type
 
typedef basic_istream< _CharT, _Traits > istream_type
 
typedef input_iterator_tag iterator_category
 
typedef _CharT value_type
 
typedef _Traits::off_type difference_type
 
typedef const _CharT * pointer
 
typedef const _CharT & reference
 
- Public Types inherited from iterator< input_iterator_tag, _CharT, _Traits::off_type, _CharT *, _CharT & >
typedef input_iterator_tag iterator_category
 
typedef _CharT value_type
 
typedef _Distance difference_type
 
typedef _Pointer pointer
 
typedef _Reference reference
 

Public Member Functions

 istreambuf_iterator (streambuf_type *__p=0)
 
 istreambuf_iterator (basic_istream< _CharT, _Traits > &__is)
 
char_type operator* () const
 
istreambuf_iterator< _CharT, _Traits > & operator++ ()
 
istreambuf_iterator< _CharT, _Traits > operator++ (int)
 
bool equal (const istreambuf_iterator< _CharT, _Traits > &__i) const
 

Private Member Functions

void _M_init (streambuf_type *__p)
 
void _M_getc () const
 

Private Attributes

streambuf_type_M_buf
 
_CharT _M_c
 
bool _M_eof
 
bool _M_have_c
 

Detailed Description

template<class _CharT, class _Traits>
class istreambuf_iterator< _CharT, _Traits >

Definition at line 45 of file _istreambuf_iterator.h.

Member Typedef Documentation

◆ char_type

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

Definition at line 49 of file _istreambuf_iterator.h.

◆ difference_type

template<class _CharT , class _Traits >
typedef _Traits::off_type istreambuf_iterator< _CharT, _Traits >::difference_type

Definition at line 57 of file _istreambuf_iterator.h.

◆ int_type

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

Definition at line 51 of file _istreambuf_iterator.h.

◆ istream_type

template<class _CharT , class _Traits >
typedef basic_istream<_CharT, _Traits> istreambuf_iterator< _CharT, _Traits >::istream_type

Definition at line 53 of file _istreambuf_iterator.h.

◆ iterator_category

template<class _CharT , class _Traits >
typedef input_iterator_tag istreambuf_iterator< _CharT, _Traits >::iterator_category

Definition at line 55 of file _istreambuf_iterator.h.

◆ pointer

template<class _CharT , class _Traits >
typedef const _CharT* istreambuf_iterator< _CharT, _Traits >::pointer

Definition at line 58 of file _istreambuf_iterator.h.

◆ reference

template<class _CharT , class _Traits >
typedef const _CharT& istreambuf_iterator< _CharT, _Traits >::reference

Definition at line 59 of file _istreambuf_iterator.h.

◆ streambuf_type

template<class _CharT , class _Traits >
typedef basic_streambuf<_CharT, _Traits> istreambuf_iterator< _CharT, _Traits >::streambuf_type

Definition at line 52 of file _istreambuf_iterator.h.

◆ traits_type

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

Definition at line 50 of file _istreambuf_iterator.h.

◆ value_type

template<class _CharT , class _Traits >
typedef _CharT istreambuf_iterator< _CharT, _Traits >::value_type

Definition at line 56 of file _istreambuf_iterator.h.

Constructor & Destructor Documentation

◆ istreambuf_iterator() [1/2]

template<class _CharT , class _Traits >
istreambuf_iterator< _CharT, _Traits >::istreambuf_iterator ( streambuf_type __p = 0)
inline

Definition at line 62 of file _istreambuf_iterator.h.

62{ this->_M_init(__p); }
void _M_init(streambuf_type *__p)

◆ istreambuf_iterator() [2/2]

template<class _CharT , class _Traits >
istreambuf_iterator< _CharT, _Traits >::istreambuf_iterator ( basic_istream< _CharT, _Traits > &  __is)
inline

Definition at line 106 of file _istreambuf_iterator.h.

107{ this->_M_init(_M_get_istreambuf(__is)); }
_STLP_BEGIN_NAMESPACE basic_streambuf< _CharT, _Traits > *_STLP_CALL _M_get_istreambuf(basic_istream< _CharT, _Traits > &)
Definition: _istream.h:346

Member Function Documentation

◆ _M_getc()

template<class _CharT , class _Traits >
void istreambuf_iterator< _CharT, _Traits >::_M_getc ( ) const
inlineprivate

Definition at line 89 of file _istreambuf_iterator.h.

89 {
90 if (_M_have_c)
91 return;
93 _STLP_MUTABLE(_Self, _M_c) = traits_type::to_char_type(__c);
94 _STLP_MUTABLE(_Self, _M_eof) = traits_type::eq_int_type(__c, traits_type::eof());
95 _STLP_MUTABLE(_Self, _M_have_c) = true;
96 }
int_type sgetc()
Definition: _streambuf.h:233
_Traits::int_type int_type
streambuf_type * _M_buf
#define _STLP_MUTABLE(type, x)
Definition: features.h:634
#define __c
Definition: schilyio.h:209

Referenced by istreambuf_iterator< _CharT, _Traits >::equal(), and istreambuf_iterator< _CharT, _Traits >::operator*().

◆ _M_init()

template<class _CharT , class _Traits >
void istreambuf_iterator< _CharT, _Traits >::_M_init ( streambuf_type __p)
inlineprivate

Definition at line 83 of file _istreambuf_iterator.h.

83 {
84 _M_buf = __p;
85 _M_eof = (__p == 0);
86 _M_have_c = false;
87 }

Referenced by istreambuf_iterator< _CharT, _Traits >::istreambuf_iterator().

◆ equal()

template<class _CharT , class _Traits >
bool istreambuf_iterator< _CharT, _Traits >::equal ( const istreambuf_iterator< _CharT, _Traits > &  __i) const
inline

Definition at line 74 of file _istreambuf_iterator.h.

74 {
75 if (this->_M_buf)
76 this->_M_getc();
77 if (__i._M_buf)
78 __i._M_getc();
79 return this->_M_eof == __i._M_eof;
80 }

Referenced by operator==().

◆ operator*()

template<class _CharT , class _Traits >
char_type istreambuf_iterator< _CharT, _Traits >::operator* ( ) const
inline

Definition at line 66 of file _istreambuf_iterator.h.

66{ this->_M_getc(); return _M_c; }

◆ operator++() [1/2]

template<class _CharT , class _Traits >
istreambuf_iterator< _CharT, _Traits > & istreambuf_iterator< _CharT, _Traits >::operator++ ( )
inline

Definition at line 67 of file _istreambuf_iterator.h.

67 {
68 _M_buf->sbumpc();
69 _M_have_c = false;
70 return *this;
71 }
int_type sbumpc()
Definition: _streambuf.h:227

◆ operator++() [2/2]

template<class _CharT , class _Traits >
istreambuf_iterator< _CharT, _Traits > istreambuf_iterator< _CharT, _Traits >::operator++ ( int  )

Definition at line 144 of file _istreambuf_iterator.h.

144 {
145 _M_getc(); // __tmp should avoid any future actions under
146 // underlined buffer---during call of operator *()
147 // (due to buffer for *this and __tmp are the same).
149 _M_buf->sbumpc();
150 _M_have_c = false;
151 return __tmp;
152}

Member Data Documentation

◆ _M_buf

◆ _M_c

template<class _CharT , class _Traits >
_CharT istreambuf_iterator< _CharT, _Traits >::_M_c
mutableprivate

◆ _M_eof

◆ _M_have_c


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