STLdoc
STLdocumentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Types | Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
istreambuf_iterator< _Elem, _Traits > Class Template Reference
Inheritance diagram for istreambuf_iterator< _Elem, _Traits >:
iterator< input_iterator_tag, _Elem, _Traits::off_type, const _Elem *, _Elem >

Public Types

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

Public Member Functions

 istreambuf_iterator (streambuf_type *_Sb=0) _THROW0()
 
 istreambuf_iterator (istream_type &_Istr) _THROW0()
 
_Elem operator* () const
 
const _Elem * operator-> () const
 
_Mytoperator++ ()
 
_Myt operator++ (int)
 
bool equal (const _Myt &_Right) const
 

Private Types

typedef istreambuf_iterator< _Elem, _Traits > _Myt
 

Private Member Functions

void _Inc ()
 
_Elem _Peek () const
 

Private Attributes

streambuf_type_Strbuf
 
bool _Got
 
_Elem _Val
 

Member Typedef Documentation

template<class _Elem, class _Traits>
typedef istreambuf_iterator<_Elem, _Traits> istreambuf_iterator< _Elem, _Traits >::_Myt
private
template<class _Elem, class _Traits>
typedef _Elem istreambuf_iterator< _Elem, _Traits >::char_type
template<class _Elem, class _Traits>
typedef traits_type::int_type istreambuf_iterator< _Elem, _Traits >::int_type
template<class _Elem, class _Traits>
typedef basic_istream<_Elem, _Traits> istreambuf_iterator< _Elem, _Traits >::istream_type
template<class _Elem, class _Traits>
typedef const _Elem* istreambuf_iterator< _Elem, _Traits >::pointer
template<class _Elem, class _Traits>
typedef basic_streambuf<_Elem, _Traits> istreambuf_iterator< _Elem, _Traits >::streambuf_type
template<class _Elem, class _Traits>
typedef _Traits istreambuf_iterator< _Elem, _Traits >::traits_type

Constructor & Destructor Documentation

template<class _Elem, class _Traits>
istreambuf_iterator< _Elem, _Traits >::istreambuf_iterator ( streambuf_type _Sb = 0)
inline
495  : _Strbuf(_Sb), _Got(_Sb == 0)
496  { // construct from stream buffer _Sb
497  }
bool _Got
Definition: streambuf:577
streambuf_type * _Strbuf
Definition: streambuf:576
template<class _Elem, class _Traits>
istreambuf_iterator< _Elem, _Traits >::istreambuf_iterator ( istream_type _Istr)
inline
500  : _Strbuf(_Istr.rdbuf()), _Got(_Istr.rdbuf() == 0)
501  { // construct from stream buffer in istream _Istr
502  }
bool _Got
Definition: streambuf:577
streambuf_type * _Strbuf
Definition: streambuf:576

Member Function Documentation

template<class _Elem, class _Traits>
void istreambuf_iterator< _Elem, _Traits >::_Inc ( )
inlineprivate
554  { // skip to next input element
555  if (_Strbuf == 0
556  || traits_type::eq_int_type(traits_type::eof(),
557  _Strbuf->sbumpc()))
558  _Strbuf = 0, _Got = true;
559  else
560  _Got = false;
561  }
bool _Got
Definition: streambuf:577
int_type __CLR_OR_THIS_CALL sbumpc()
Definition: streambuf:144
streambuf_type * _Strbuf
Definition: streambuf:576
template<class _Elem, class _Traits>
_Elem istreambuf_iterator< _Elem, _Traits >::_Peek ( ) const
inlineprivate
564  { // peek at next input element
565  int_type _Meta;
566  if (_Strbuf == 0
567  || traits_type::eq_int_type(traits_type::eof(),
568  _Meta = _Strbuf->sgetc()))
569  _Strbuf = 0;
570  else
571  _Val = traits_type::to_char_type(_Meta);
572  _Got = true;
573  return (_Val);
574  }
int_type __CLR_OR_THIS_CALL sgetc()
Definition: streambuf:150
bool _Got
Definition: streambuf:577
streambuf_type * _Strbuf
Definition: streambuf:576
_Elem _Val
Definition: streambuf:578
traits_type::int_type int_type
Definition: streambuf:491
template<class _Elem, class _Traits>
bool istreambuf_iterator< _Elem, _Traits >::equal ( const _Myt _Right) const
inline
543  { // test for equality
544  if (!_Got)
545  _Peek();
546  if (!_Right._Got)
547  _Right._Peek();
548  return ((_Strbuf == 0 && _Right._Strbuf == 0)
549  || (_Strbuf != 0 && _Right._Strbuf != 0));
550  }
bool _Got
Definition: streambuf:577
_Elem _Peek() const
Definition: streambuf:563
streambuf_type * _Strbuf
Definition: streambuf:576
const _Ty & _Right
Definition: algorithm:4087
template<class _Elem, class _Traits>
_Elem istreambuf_iterator< _Elem, _Traits >::operator* ( ) const
inline
505  { // return designated value
506  if (!_Got)
507  _Peek();
508 
509  #if _ITERATOR_DEBUG_LEVEL == 2
510  if (_Strbuf == 0)
511  _DEBUG_ERROR("istreambuf_iterator is not dereferencable");
512  #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
513 
514  return (_Val);
515  }
bool _Got
Definition: streambuf:577
_Elem _Peek() const
Definition: streambuf:563
streambuf_type * _Strbuf
Definition: streambuf:576
_Elem _Val
Definition: streambuf:578
#define _DEBUG_ERROR(mesg)
Definition: xutility:32
template<class _Elem, class _Traits>
_Myt& istreambuf_iterator< _Elem, _Traits >::operator++ ( )
inline
523  { // preincrement
524  #if _ITERATOR_DEBUG_LEVEL == 2
525  if (_Strbuf == 0)
526  _DEBUG_ERROR("istreambuf_iterator is not incrementable");
527  #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
528 
529  _Inc();
530  return (*this);
531  }
void _Inc()
Definition: streambuf:553
streambuf_type * _Strbuf
Definition: streambuf:576
#define _DEBUG_ERROR(mesg)
Definition: xutility:32
template<class _Elem, class _Traits>
_Myt istreambuf_iterator< _Elem, _Traits >::operator++ ( int  )
inline
534  { // postincrement
535  if (!_Got)
536  _Peek();
537  _Myt _Tmp = *this;
538  ++*this;
539  return (_Tmp);
540  }
bool _Got
Definition: streambuf:577
istreambuf_iterator< _Elem, _Traits > _Myt
Definition: streambuf:484
_Elem _Peek() const
Definition: streambuf:563
template<class _Elem, class _Traits>
const _Elem* istreambuf_iterator< _Elem, _Traits >::operator-> ( ) const
inline
518  { // return pointer to class object
519  return (_STD pointer_traits<pointer>::pointer_to(**this));
520  }
Definition: xmemory0:198

Member Data Documentation

template<class _Elem, class _Traits>
bool istreambuf_iterator< _Elem, _Traits >::_Got
mutableprivate
template<class _Elem, class _Traits>
streambuf_type* istreambuf_iterator< _Elem, _Traits >::_Strbuf
mutableprivate
template<class _Elem, class _Traits>
_Elem istreambuf_iterator< _Elem, _Traits >::_Val
mutableprivate

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