dune-common  2.2.0
ios_state.hh
Go to the documentation of this file.
00001 // -*- tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
00002 // vi: set ts=8 sw=2 et sts=2:
00003 #ifndef DUNE_COMMON_IOS_STATE_HH
00004 #define DUNE_COMMON_IOS_STATE_HH
00005 
00006 #include<ios>
00007 
00008 namespace Dune{
00031   class ios_base_all_saver
00032   {
00033   public:
00035     typedef std::ios_base state_type;
00036 
00046     ios_base_all_saver(state_type& ios_);
00047 
00051     ~ios_base_all_saver();
00052 
00059     void restore();
00060 
00061   private:
00063     state_type& ios;
00065     state_type::fmtflags oldflags;
00067     std::streamsize oldprec;
00069     std::streamsize oldwidth;
00070   };
00071 
00073 }
00074 
00075 #endif // DUNE_COMMON_IOS_STATE_HH