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

Member Function Documentation

template<class _Elem, class _Traits>
void istreambuf_iterator< _Elem, _Traits >::_Inc ( )
inlineprivate
560  { // skip to next input element
561  if (_Strbuf == 0
562  || traits_type::eq_int_type(traits_type::eof(),
563  _Strbuf->sbumpc()))
564  _Strbuf = 0, _Got = true;
565  else
566  _Got = false;
567  }
bool _Got
Definition: streambuf:583
int_type __CLR_OR_THIS_CALL sbumpc()
Definition: streambuf:148
streambuf_type * _Strbuf
Definition: streambuf:582
template<class _Elem, class _Traits>
_Elem istreambuf_iterator< _Elem, _Traits >::_Peek ( ) const
inlineprivate
570  { // peek at next input element
571  int_type _Meta;
572  if (_Strbuf == 0
573  || traits_type::eq_int_type(traits_type::eof(),
574  _Meta = _Strbuf->sgetc()))
575  _Strbuf = 0;
576  else
577  _Val = traits_type::to_char_type(_Meta);
578  _Got = true;
579  return (_Val);
580  }
int_type __CLR_OR_THIS_CALL sgetc()
Definition: streambuf:154
bool _Got
Definition: streambuf:583
streambuf_type * _Strbuf
Definition: streambuf:582
_Elem _Val
Definition: streambuf:584
traits_type::int_type int_type
Definition: streambuf:497
template<class _Elem, class _Traits>
bool istreambuf_iterator< _Elem, _Traits >::equal ( const _Myt _Right) const
inline
549  { // test for equality
550  if (!_Got)
551  _Peek();
552  if (!_Right._Got)
553  _Right._Peek();
554  return ((_Strbuf == 0 && _Right._Strbuf == 0)
555  || (_Strbuf != 0 && _Right._Strbuf != 0));
556  }
bool _Got
Definition: streambuf:583
_Elem _Peek() const
Definition: streambuf:569
streambuf_type * _Strbuf
Definition: streambuf:582
constexpr const _Ty &() _Right
Definition: algorithm:3591
template<class _Elem, class _Traits>
_Elem istreambuf_iterator< _Elem, _Traits >::operator* ( ) const
inline
511  { // return designated value
512  if (!_Got)
513  _Peek();
514 
515  #if _ITERATOR_DEBUG_LEVEL == 2
516  if (_Strbuf == 0)
517  _DEBUG_ERROR("istreambuf_iterator is not dereferencable");
518  #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
519 
520  return (_Val);
521  }
bool _Got
Definition: streambuf:583
_Elem _Peek() const
Definition: streambuf:569
streambuf_type * _Strbuf
Definition: streambuf:582
_Elem _Val
Definition: streambuf:584
#define _DEBUG_ERROR(mesg)
Definition: xutility:32
template<class _Elem, class _Traits>
_Myt& istreambuf_iterator< _Elem, _Traits >::operator++ ( )
inline
529  { // preincrement
530  #if _ITERATOR_DEBUG_LEVEL == 2
531  if (_Strbuf == 0)
532  _DEBUG_ERROR("istreambuf_iterator is not incrementable");
533  #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
534 
535  _Inc();
536  return (*this);
537  }
void _Inc()
Definition: streambuf:559
streambuf_type * _Strbuf
Definition: streambuf:582
#define _DEBUG_ERROR(mesg)
Definition: xutility:32
template<class _Elem, class _Traits>
_Myt istreambuf_iterator< _Elem, _Traits >::operator++ ( int  )
inline
540  { // postincrement
541  if (!_Got)
542  _Peek();
543  _Myt _Tmp = *this;
544  ++*this;
545  return (_Tmp);
546  }
bool _Got
Definition: streambuf:583
istreambuf_iterator< _Elem, _Traits > _Myt
Definition: streambuf:490
_Elem _Peek() const
Definition: streambuf:569
template<class _Elem, class _Traits>
const _Elem* istreambuf_iterator< _Elem, _Traits >::operator-> ( ) const
inline
524  { // return pointer to class object
525  return (pointer_traits<pointer>::pointer_to(**this));
526  }
Definition: xmemory0:244

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: