ostream File Reference

#include <ios>

Include dependency graph for ostream:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  std

Functions

template<typename CharT, typename Traits>
basic_ostream< CharT, Traits > & endl (basic_ostream< CharT, Traits > &__os)
 Write a newline and flush the stream.
template<typename CharT, typename Traits>
basic_ostream< CharT, Traits > & ends (basic_ostream< CharT, Traits > &__os)
 Write a null character into the output sequence.
template<typename CharT, typename Traits>
basic_ostream< CharT, Traits > & flush (basic_ostream< CharT, Traits > &__os)
 Flushes the output stream.


Detailed Description

This is a Standard C++ Library header. You should #include this header in your programs, rather than any of the "st[dl]_*.h" implementation files.

Definition in file ostream.


Function Documentation

template<typename CharT, typename Traits>
basic_ostream<CharT, Traits>& endl basic_ostream< CharT, Traits > &  __os  ) 
 

Write a newline and flush the stream.

This manipulator is often mistakenly used when a simple newline is desired, leading to poor buffering performance. See http://gcc.gnu.org/onlinedocs/libstdc++/27_io/howto.html#2 for more on this subject.

Definition at line 505 of file ostream.

References std::flush().

template<typename CharT, typename Traits>
basic_ostream<CharT, Traits>& ends basic_ostream< CharT, Traits > &  __os  ) 
 

Write a null character into the output sequence.

"Null character" is CharT() by definition. For CharT of char, this correctly writes the ASCII NUL character string terminator.

Definition at line 516 of file ostream.

References std::basic_ostream< CharT, Traits >::put().

template<typename CharT, typename Traits>
basic_ostream<CharT, Traits>& flush basic_ostream< CharT, Traits > &  __os  ) 
 

Flushes the output stream.

This manipulator simply calls the stream's flush() member function.

Definition at line 526 of file ostream.

References std::basic_ostream< CharT, Traits >::flush().

Referenced by std::endl().

template<class Traits>
basic_ostream<char, Traits>& operator<< basic_ostream< char, Traits > &  out,
const unsigned char *  s
 

String inserters.

Parameters:
out An output stream.
s A character string.
Returns:
out
Precondition:
s must be a non-NULL pointer
Behaves like one of the formatted arithmetic inserters described in std::basic_ostream. After constructing a sentry object with good status, this function inserts traits::length(s) characters starting at s, widened if necessary, followed by any required padding (as determined by [22.2.2.2.2]). out.width(0) is then called.

Definition at line 490 of file ostream.

template<class Traits>
basic_ostream<char, Traits>& operator<< basic_ostream< char, Traits > &  out,
const signed char *  s
 

String inserters.

Parameters:
out An output stream.
s A character string.
Returns:
out
Precondition:
s must be a non-NULL pointer
Behaves like one of the formatted arithmetic inserters described in std::basic_ostream. After constructing a sentry object with good status, this function inserts traits::length(s) characters starting at s, widened if necessary, followed by any required padding (as determined by [22.2.2.2.2]). out.width(0) is then called.

Definition at line 485 of file ostream.

template<class Traits>
basic_ostream<char, Traits>& operator<< basic_ostream< char, Traits > &  out,
unsigned char  c
 

Character inserters.

Parameters:
out An output stream.
c A character.
Returns:
out
Behaves like one of the formatted arithmetic inserters described in std::basic_ostream. After constructing a sentry object with good status, this function inserts a single character and any required padding (as determined by [22.2.2.2.2]). out.width(0) is then called.

If c is of type char and the character type of the stream is not char, the character is widened before insertion.

Definition at line 451 of file ostream.

template<class Traits>
basic_ostream<char, Traits>& operator<< basic_ostream< char, Traits > &  out,
signed char  c
 

Character inserters.

Parameters:
out An output stream.
c A character.
Returns:
out
Behaves like one of the formatted arithmetic inserters described in std::basic_ostream. After constructing a sentry object with good status, this function inserts a single character and any required padding (as determined by [22.2.2.2.2]). out.width(0) is then called.

If c is of type char and the character type of the stream is not char, the character is widened before insertion.

Definition at line 446 of file ostream.

template<typename CharT, typename Traits>
basic_ostream<CharT, Traits>& operator<< basic_ostream< CharT, Traits > &  out,
char  c
 

Character inserters.

Parameters:
out An output stream.
c A character.
Returns:
out
Behaves like one of the formatted arithmetic inserters described in std::basic_ostream. After constructing a sentry object with good status, this function inserts a single character and any required padding (as determined by [22.2.2.2.2]). out.width(0) is then called.

If c is of type char and the character type of the stream is not char, the character is widened before insertion.

Definition at line 435 of file ostream.


Generated on Thu Feb 10 23:23:25 2005 for libstdc++-v3 Source by  doxygen 1.4.0