rpa::istream_iterator_delimiter< _Tp, _CharT, _Traits, _Dist > Class Template Reference

#include <istream_iterator_delimiter.h>

List of all members.

Public Types

typedef _CharT char_type
typedef _Traits traits_type
typedef std::basic_istream<
_CharT, _Traits > 
istream_type

Public Member Functions

 istream_iterator_delimiter ()
 Construct end of input stream iterator.
 istream_iterator_delimiter (istream_type &__s, const char_type *aDelim)
 istream_iterator_delimiter (const istream_iterator_delimiter &__obj)
const _Tp & operator * () const
const _Tp * operator-> () const
istream_iterator_delimiteroperator++ ()
istream_iterator_delimiter operator++ (int)
bool _M_equal (const istream_iterator_delimiter &__x) const

Private Member Functions

void _M_read ()

Private Attributes

istream_type_M_stream
const char_type_M_delimiter
_Tp _M_value


Detailed Description

template<typename _Tp, typename _CharT = char, typename _Traits = std::char_traits<_CharT>, typename _Dist = ptrdiff_t>
class rpa::istream_iterator_delimiter< _Tp, _CharT, _Traits, _Dist >

Provides input iterator semantics for streams. Equivalent to istream_iterator, but with an arbitrary delimiter. Can be of general purpose, but used here for tests only. NOTE: When buffering the input, it would be extremely fine to avoid an extra copy and storage of the data type. See member _M_value.


Member Typedef Documentation

template<typename _Tp, typename _CharT = char, typename _Traits = std::char_traits<_CharT>, typename _Dist = ptrdiff_t>
typedef _CharT rpa::istream_iterator_delimiter< _Tp, _CharT, _Traits, _Dist >::char_type

template<typename _Tp, typename _CharT = char, typename _Traits = std::char_traits<_CharT>, typename _Dist = ptrdiff_t>
typedef std::basic_istream<_CharT, _Traits> rpa::istream_iterator_delimiter< _Tp, _CharT, _Traits, _Dist >::istream_type

template<typename _Tp, typename _CharT = char, typename _Traits = std::char_traits<_CharT>, typename _Dist = ptrdiff_t>
typedef _Traits rpa::istream_iterator_delimiter< _Tp, _CharT, _Traits, _Dist >::traits_type


Constructor & Destructor Documentation

template<typename _Tp, typename _CharT = char, typename _Traits = std::char_traits<_CharT>, typename _Dist = ptrdiff_t>
rpa::istream_iterator_delimiter< _Tp, _CharT, _Traits, _Dist >::istream_iterator_delimiter (  )  [inline]

Construct end of input stream iterator.

template<typename _Tp, typename _CharT = char, typename _Traits = std::char_traits<_CharT>, typename _Dist = ptrdiff_t>
rpa::istream_iterator_delimiter< _Tp, _CharT, _Traits, _Dist >::istream_iterator_delimiter ( istream_type __s,
const char_type aDelim 
) [inline]

Construct start of input stream iterator. If the delimiter is NULL, we assume an empty string.

template<typename _Tp, typename _CharT = char, typename _Traits = std::char_traits<_CharT>, typename _Dist = ptrdiff_t>
rpa::istream_iterator_delimiter< _Tp, _CharT, _Traits, _Dist >::istream_iterator_delimiter ( const istream_iterator_delimiter< _Tp, _CharT, _Traits, _Dist > &  __obj  )  [inline]


Member Function Documentation

template<typename _Tp, typename _CharT = char, typename _Traits = std::char_traits<_CharT>, typename _Dist = ptrdiff_t>
bool rpa::istream_iterator_delimiter< _Tp, _CharT, _Traits, _Dist >::_M_equal ( const istream_iterator_delimiter< _Tp, _CharT, _Traits, _Dist > &  __x  )  const [inline]

template<typename _Tp, typename _CharT = char, typename _Traits = std::char_traits<_CharT>, typename _Dist = ptrdiff_t>
void rpa::istream_iterator_delimiter< _Tp, _CharT, _Traits, _Dist >::_M_read (  )  [inline, private]

Does the same as for a plain std::istream_iterator, but after the value is read, it attemps to read the delimiter, and fails if it is not there.

Now reads the delimiter if there is one. If we cannot read a full delimiter, the iterator is left as invalid.

This indicates the end of stream.

template<typename _Tp, typename _CharT = char, typename _Traits = std::char_traits<_CharT>, typename _Dist = ptrdiff_t>
const _Tp& rpa::istream_iterator_delimiter< _Tp, _CharT, _Traits, _Dist >::operator * (  )  const [inline]

template<typename _Tp, typename _CharT = char, typename _Traits = std::char_traits<_CharT>, typename _Dist = ptrdiff_t>
istream_iterator_delimiter rpa::istream_iterator_delimiter< _Tp, _CharT, _Traits, _Dist >::operator++ ( int   )  [inline]

template<typename _Tp, typename _CharT = char, typename _Traits = std::char_traits<_CharT>, typename _Dist = ptrdiff_t>
istream_iterator_delimiter& rpa::istream_iterator_delimiter< _Tp, _CharT, _Traits, _Dist >::operator++ (  )  [inline]

template<typename _Tp, typename _CharT = char, typename _Traits = std::char_traits<_CharT>, typename _Dist = ptrdiff_t>
const _Tp* rpa::istream_iterator_delimiter< _Tp, _CharT, _Traits, _Dist >::operator-> (  )  const [inline]


Member Data Documentation

template<typename _Tp, typename _CharT = char, typename _Traits = std::char_traits<_CharT>, typename _Dist = ptrdiff_t>
const char_type* rpa::istream_iterator_delimiter< _Tp, _CharT, _Traits, _Dist >::_M_delimiter [private]

template<typename _Tp, typename _CharT = char, typename _Traits = std::char_traits<_CharT>, typename _Dist = ptrdiff_t>
istream_type* rpa::istream_iterator_delimiter< _Tp, _CharT, _Traits, _Dist >::_M_stream [private]

template<typename _Tp, typename _CharT = char, typename _Traits = std::char_traits<_CharT>, typename _Dist = ptrdiff_t>
_Tp rpa::istream_iterator_delimiter< _Tp, _CharT, _Traits, _Dist >::_M_value [private]


The documentation for this class was generated from the following file:
Generated on Tue Sep 25 10:20:38 2007 for rpa by  doxygen 1.4.7