Dune Core Modules (2.9.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// SPDX-FileCopyrightInfo: Copyright (C) DUNE Project contributors, see file LICENSE.md in module root
4// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
5#ifndef DUNE_COMMON_IOS_STATE_HH
6#define DUNE_COMMON_IOS_STATE_HH
7
8#include <ios>
9
10namespace Dune {
34 {
35 public:
37 typedef std::ios_base state_type;
38
49
54
61 void restore();
62
63 private:
65 state_type& ios;
67 state_type::fmtflags oldflags;
69 std::streamsize oldprec;
71 std::streamsize oldwidth;
72 };
73
75}
76
77#endif // DUNE_COMMON_IOS_STATE_HH
Utility class for storing and resetting stream attributes.
Definition: ios_state.hh:34
~ios_base_all_saver()
Destructor that restores the flags stored by the constructor.
Definition: ios_state.cc:24
void restore()
Restore flags now.
Definition: ios_state.cc:29
std::ios_base state_type
Export type of object we save the state for.
Definition: ios_state.hh:37
ios_base_all_saver(state_type &ios_)
Constructor that stores the currently used flags.
Definition: ios_state.cc:19
Dune namespace.
Definition: alignedallocator.hh:13
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Dec 21, 23:30, 2024)