www.mooseframework.org
Public Types | Public Member Functions | Private Attributes | List of all members
infix_ostream_iterator< T, charT, traits > Class Template Reference

#include <InfixIterator.h>

Inheritance diagram for infix_ostream_iterator< T, charT, traits >:
[legend]

Public Types

typedef charT char_type
 
typedef traits traits_type
 
typedef std::basic_ostream< charT, traits > ostream_type
 

Public Member Functions

 infix_ostream_iterator (ostream_type &s)
 
 infix_ostream_iterator (ostream_type &s, charT const *d, bool first=true)
 
infix_ostream_iterator< T, charT, traits > & operator= (T const &item)
 
infix_ostream_iterator< T, charT, traits > & operator* ()
 
infix_ostream_iterator< T, charT, traits > & operator++ ()
 
infix_ostream_iterator< T, charT, traits > & operator++ (int)
 

Private Attributes

std::basic_ostream< charT, traits > * os
 
charT const * delimiter
 
bool first_elem
 

Detailed Description

template<class T, class charT = char, class traits = std::char_traits<charT>>
class infix_ostream_iterator< T, charT, traits >

Definition at line 20 of file InfixIterator.h.

Member Typedef Documentation

◆ char_type

template<class T, class charT = char, class traits = std::char_traits<charT>>
typedef charT infix_ostream_iterator< T, charT, traits >::char_type

Definition at line 28 of file InfixIterator.h.

◆ ostream_type

template<class T, class charT = char, class traits = std::char_traits<charT>>
typedef std::basic_ostream<charT, traits> infix_ostream_iterator< T, charT, traits >::ostream_type

Definition at line 30 of file InfixIterator.h.

◆ traits_type

template<class T, class charT = char, class traits = std::char_traits<charT>>
typedef traits infix_ostream_iterator< T, charT, traits >::traits_type

Definition at line 29 of file InfixIterator.h.

Constructor & Destructor Documentation

◆ infix_ostream_iterator() [1/2]

template<class T, class charT = char, class traits = std::char_traits<charT>>
infix_ostream_iterator< T, charT, traits >::infix_ostream_iterator ( ostream_type s)
inline

Definition at line 31 of file InfixIterator.h.

31 : os(&s), delimiter(0), first_elem(true) {}
charT const * delimiter
Definition: InfixIterator.h:24
std::basic_ostream< charT, traits > * os
Definition: InfixIterator.h:23

◆ infix_ostream_iterator() [2/2]

template<class T, class charT = char, class traits = std::char_traits<charT>>
infix_ostream_iterator< T, charT, traits >::infix_ostream_iterator ( ostream_type s,
charT const *  d,
bool  first = true 
)
inline

Definition at line 32 of file InfixIterator.h.

33  : os(&s), delimiter(d), first_elem(first)
34  {
35  }
charT const * delimiter
Definition: InfixIterator.h:24
std::basic_ostream< charT, traits > * os
Definition: InfixIterator.h:23

Member Function Documentation

◆ operator*()

template<class T, class charT = char, class traits = std::char_traits<charT>>
infix_ostream_iterator<T, charT, traits>& infix_ostream_iterator< T, charT, traits >::operator* ( )
inline

Definition at line 46 of file InfixIterator.h.

46 { return *this; }

◆ operator++() [1/2]

template<class T, class charT = char, class traits = std::char_traits<charT>>
infix_ostream_iterator<T, charT, traits>& infix_ostream_iterator< T, charT, traits >::operator++ ( )
inline

Definition at line 47 of file InfixIterator.h.

47 { return *this; }

◆ operator++() [2/2]

template<class T, class charT = char, class traits = std::char_traits<charT>>
infix_ostream_iterator<T, charT, traits>& infix_ostream_iterator< T, charT, traits >::operator++ ( int  )
inline

Definition at line 48 of file InfixIterator.h.

48 { return *this; }

◆ operator=()

template<class T, class charT = char, class traits = std::char_traits<charT>>
infix_ostream_iterator<T, charT, traits>& infix_ostream_iterator< T, charT, traits >::operator= ( T const &  item)
inline

Definition at line 36 of file InfixIterator.h.

37  {
38  // Here's the only real change from ostream_iterator:
39  // Normally, the '*os << item;' would come before the 'if'.
40  if (!first_elem && delimiter != 0)
41  *os << delimiter;
42  *os << item;
43  first_elem = false;
44  return *this;
45  }
charT const * delimiter
Definition: InfixIterator.h:24
std::basic_ostream< charT, traits > * os
Definition: InfixIterator.h:23

Member Data Documentation

◆ delimiter

template<class T, class charT = char, class traits = std::char_traits<charT>>
charT const* infix_ostream_iterator< T, charT, traits >::delimiter
private

◆ first_elem

template<class T, class charT = char, class traits = std::char_traits<charT>>
bool infix_ostream_iterator< T, charT, traits >::first_elem
private

◆ os

template<class T, class charT = char, class traits = std::char_traits<charT>>
std::basic_ostream<charT, traits>* infix_ostream_iterator< T, charT, traits >::os
private

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