dune-common  2.5.0
ios_state.hh
Go to the documentation of this file.
1 // -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2 // vi: set et ts=4 sw=2 sts=2:
3 #ifndef DUNE_COMMON_IOS_STATE_HH
4 #define DUNE_COMMON_IOS_STATE_HH
5 
6 #include <ios>
7 
8 namespace Dune {
32  {
33  public:
35  typedef std::ios_base state_type;
36 
46  ios_base_all_saver(state_type& ios_);
47 
52 
59  void restore();
60 
61  private:
63  state_type& ios;
65  state_type::fmtflags oldflags;
67  std::streamsize oldprec;
69  std::streamsize oldwidth;
70  };
71 
73 }
74 
75 #endif // DUNE_COMMON_IOS_STATE_HH
std::ios_base state_type
Export type of object we save the state for.
Definition: ios_state.hh:35
~ios_base_all_saver()
Destructor that restores the flags stored by the constructor.
Definition: ios_state.cc:22
Utility class for storing and resetting stream attributes.
Definition: ios_state.hh:31
ios_base_all_saver(state_type &ios_)
Constructor that stores the currently used flags.
Definition: ios_state.cc:17
void restore()
Restore flags now.
Definition: ios_state.cc:27
Dune namespace.
Definition: alignment.hh:10