Loading...
Searching...
No Matches
ios_state.hh
Go to the documentation of this file.
// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
// vi: set et ts=4 sw=2 sts=2:
// SPDX-FileCopyrightInfo: Copyright © DUNE Project contributors, see file LICENSE.md in module root
// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
#ifndef DUNE_COMMON_IOS_STATE_HH
#define DUNE_COMMON_IOS_STATE_HH
#include <ios>
namespace Dune {
class ios_base_all_saver
{
public:
typedef std::ios_base state_type;
ios_base_all_saver(state_type& ios_);
~ios_base_all_saver();
void restore();
private:
state_type& ios;
state_type::fmtflags oldflags;
std::streamsize oldprec;
std::streamsize oldwidth;
};
}
#endif // DUNE_COMMON_IOS_STATE_HH
Dune::ios_base_all_saver::~ios_base_all_saver
~ios_base_all_saver()
Destructor that restores the flags stored by the constructor.
Definition ios_state.cc:20
Dune::ios_base_all_saver::restore
void restore()
Restore flags now.
Definition ios_state.cc:25
Dune::ios_base_all_saver::state_type
std::ios_base state_type
Export type of object we save the state for.
Definition ios_state.hh:37
Dune::ios_base_all_saver::ios_base_all_saver
ios_base_all_saver(state_type &ios_)
Constructor that stores the currently used flags.
Definition ios_state.cc:15
Dune
Dune namespace
Definition alignedallocator.hh:13