ioflags Class Reference

#include <ioflags.hpp>

List of all members.

Public Member Functions

 ioflags (std::basic_ios< char > &stream)
 ~ioflags ()
 Restore the formatting flags.

Private Attributes

std::basic_ios< char > & stream_
std::ios_base::fmtflags flags_


Detailed Description

Save and restore I/O stream flags. When a function needs to temporarily alter an I/O stream flags, simply define an object of type ioflags. Set whatever flags you want. When the block exits or function returns, the original flags are restored.

Definition at line 15 of file ioflags.hpp.


Constructor & Destructor Documentation

ioflags::ioflags ( std::basic_ios< char > &  stream  )  [inline]

Save the formatting flags from stream.

Parameters:
stream The stream that will have its flags modified and restored.

Definition at line 20 of file ioflags.hpp.

00020 : stream_(stream), flags_(stream.flags()) {}

ioflags::~ioflags (  )  [inline]

Restore the formatting flags.

Definition at line 22 of file ioflags.hpp.

References flags_, and stream_.

00022 { stream_.flags(flags_); }


Member Data Documentation

std::basic_ios<char>& ioflags::stream_ [private]

Definition at line 24 of file ioflags.hpp.

Referenced by ~ioflags().

std::ios_base::fmtflags ioflags::flags_ [private]

Definition at line 25 of file ioflags.hpp.

Referenced by ~ioflags().


The documentation for this class was generated from the following file:
Generated on Sun Nov 30 10:06:53 2008 for Calculator by  doxygen 1.5.3