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 const _Elem * pointer
 
typedef _Elem reference
 

Public Member Functions

constexpr 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>
constexpr istreambuf_iterator< _Elem, _Traits >::istreambuf_iterator ( streambuf_type _Sb = 0)
inline
500  : _Strbuf(_Sb), _Got(_Sb == 0), _Val()
501  { // construct from stream buffer _Sb
502  }
bool _Got
Definition: streambuf:591
streambuf_type * _Strbuf
Definition: streambuf:590
_Elem _Val
Definition: streambuf:592
template<class _Elem, class _Traits>
istreambuf_iterator< _Elem, _Traits >::istreambuf_iterator ( istream_type _Istr)
inline
505  : _Strbuf(_Istr.rdbuf()), _Got(_Istr.rdbuf() == 0)
506  { // construct from stream buffer in istream _Istr
507  }
bool _Got
Definition: streambuf:591
streambuf_type * _Strbuf
Definition: streambuf:590

Member Function Documentation

template<class _Elem, class _Traits>
void istreambuf_iterator< _Elem, _Traits >::_Inc ( )
inlineprivate
563  { // skip to next input element
564  if (_Strbuf == 0
565  || traits_type::eq_int_type(traits_type::eof(),
566  _Strbuf->sbumpc()))
567  {
568  _Strbuf = 0;
569  _Got = true;
570  }
571  else
572  {
573  _Got = false;
574  }
575  }
bool _Got
Definition: streambuf:591
int_type __CLR_OR_THIS_CALL sbumpc()
Definition: streambuf:147
streambuf_type * _Strbuf
Definition: streambuf:590
template<class _Elem, class _Traits>
_Elem istreambuf_iterator< _Elem, _Traits >::_Peek ( ) const
inlineprivate
578  { // peek at next input element
579  int_type _Meta;
580  if (_Strbuf == 0
581  || traits_type::eq_int_type(traits_type::eof(),
582  _Meta = _Strbuf->sgetc()))
583  _Strbuf = 0;
584  else
585  _Val = traits_type::to_char_type(_Meta);
586  _Got = true;
587  return (_Val);
588  }
int_type __CLR_OR_THIS_CALL sgetc()
Definition: streambuf:153
bool _Got
Definition: streambuf:591
streambuf_type * _Strbuf
Definition: streambuf:590
_Elem _Val
Definition: streambuf:592
traits_type::int_type int_type
Definition: streambuf:496
template<class _Elem, class _Traits>
bool istreambuf_iterator< _Elem, _Traits >::equal ( const _Myt _Right) const
inline
552  { // test for equality
553  if (!_Got)
554  _Peek();
555  if (!_Right._Got)
556  _Right._Peek();
557  return ((_Strbuf == 0 && _Right._Strbuf == 0)
558  || (_Strbuf != 0 && _Right._Strbuf != 0));
559  }
bool _Got
Definition: streambuf:591
_Elem _Peek() const
Definition: streambuf:577
streambuf_type * _Strbuf
Definition: streambuf:590
constexpr const _Ty &() _Right
Definition: algorithm:3723
template<class _Elem, class _Traits>
_Elem istreambuf_iterator< _Elem, _Traits >::operator* ( ) const
inline
510  { // return designated value
511  if (!_Got)
512  _Peek();
513 
514  #if _ITERATOR_DEBUG_LEVEL == 2
515  if (_Strbuf == 0)
516  {
517  _DEBUG_ERROR("istreambuf_iterator is not dereferencable");
518  }
519  #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
520 
521  return (_Val);
522  }
bool _Got
Definition: streambuf:591
_Elem _Peek() const
Definition: streambuf:577
streambuf_type * _Strbuf
Definition: streambuf:590
_Elem _Val
Definition: streambuf:592
#define _DEBUG_ERROR(mesg)
Definition: xutility:33
template<class _Elem, class _Traits>
_Myt& istreambuf_iterator< _Elem, _Traits >::operator++ ( )
inline
530  { // preincrement
531  #if _ITERATOR_DEBUG_LEVEL == 2
532  if (_Strbuf == 0)
533  {
534  _DEBUG_ERROR("istreambuf_iterator is not incrementable");
535  }
536  #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
537 
538  _Inc();
539  return (*this);
540  }
void _Inc()
Definition: streambuf:562
streambuf_type * _Strbuf
Definition: streambuf:590
#define _DEBUG_ERROR(mesg)
Definition: xutility:33
template<class _Elem, class _Traits>
_Myt istreambuf_iterator< _Elem, _Traits >::operator++ ( int  )
inline
543  { // postincrement
544  if (!_Got)
545  _Peek();
546  _Myt _Tmp = *this;
547  ++*this;
548  return (_Tmp);
549  }
bool _Got
Definition: streambuf:591
istreambuf_iterator< _Elem, _Traits > _Myt
Definition: streambuf:489
_Elem _Peek() const
Definition: streambuf:577
template<class _Elem, class _Traits>
const _Elem* istreambuf_iterator< _Elem, _Traits >::operator-> ( ) const
inline
525  { // return pointer to class object
526  return (pointer_traits<pointer>::pointer_to(**this));
527  }
Definition: xmemory0:254

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: