Previous fileTop of DocumentContentsIndex pageNext file
Apache C++ Standard Library Reference Guide

istreambuf_iterator

Library:  Iterators


istreambuf_iterator input_iterator

Local Index

Members

Non-Members

Summary

Iterator that reads successive characters from the stream buffer for which it was constructed

Synopsis

#include <streambuf> 

namespace std {
  template<class charT, class traits = char_traits<charT> >
  class istreambuf_iterator;
}

Description

The class template istreambuf_iterator reads successive characters from the stream buffer for which it was constructed. operator*() gives access to the current input character, if any, and operator++() advances to the next input character. If the end of stream is reached, the iterator becomes equal to the end of stream iterator value, which is constructed by the default constructor, istreambuf_iterator(). An istreambuf_iterator object can be used only for one-pass-algorithms.

Interface

Member Types

char_type
int_type
istream_type
streambuf_type
traits_type

Member Class proxy

Class istreambuf_iterator<charT,traits>::proxy is a temporary placeholder for the return value of the post-increment operator. It keeps the character pointed to by the previous value of the iterator for some possible future access.

Constructors

istreambuf_iterator() throw();
istreambuf_iterator(istream_type& s) throw();
istreambuf_iterator(streambuf_type *s) throw();
istreambuf_iterator(const proxy& p) throw();

Member Operators

char_type 
operator*() const;
istreambuf_iterator& 
operator++();
proxy 
operator++(int); 

Public Member Functions

bool 
equal(istreambuf_iterator& b) const; 

Nonmember Functions

template<class charT, class traits>
bool 
operator==(const istreambuf_iterator<charT, traits>& a,
           const istreambuf_iterator<charT, traits>& b); 
template<class charT, class traits>
bool 
operator!=(const istreambuf_iterator<charT, traits>& a,
           const istreambuf_iterator<charT, traits>& b); 

Example

See Also

basic_streambuf, basic_istream, ostreambuf_iterator

Standards Conformance

ISO/IEC 14882:1998 -- International Standard for Information Systems --Programming Language C++, Section 24.5.3



Previous fileTop of DocumentContentsIndex pageNext file