annotate liboctave/util/octave-preserve-stream-state.h @ 29358:0a5b15007766 stable

update Octave Project Developers copyright for the new year In files that have the "Octave Project Developers" copyright notice, update for 2021.
author John W. Eaton <jwe@octave.org>
date Wed, 10 Feb 2021 09:52:15 -0500
parents bd51beb6205e
children 796f54d4ddbf
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
27923
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
1 ////////////////////////////////////////////////////////////////////////
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
2 //
29358
0a5b15007766 update Octave Project Developers copyright for the new year
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
3 // Copyright (C) 1993-2021 The Octave Project Developers
27923
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
4 //
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
5 // See the file COPYRIGHT.md in the top-level directory of this
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
6 // distribution or <https://octave.org/copyright/>.
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
7 //
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
8 // This file is part of Octave.
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
9 //
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
10 // Octave is free software: you can redistribute it and/or modify it
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
11 // under the terms of the GNU General Public License as published by
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
12 // the Free Software Foundation, either version 3 of the License, or
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
13 // (at your option) any later version.
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
14 //
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
15 // Octave is distributed in the hope that it will be useful, but
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
16 // WITHOUT ANY WARRANTY; without even the implied warranty of
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
18 // GNU General Public License for more details.
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
19 //
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
20 // You should have received a copy of the GNU General Public License
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
21 // along with Octave; see the file COPYING. If not, see
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
22 // <https://www.gnu.org/licenses/>.
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
23 //
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
24 ////////////////////////////////////////////////////////////////////////
20925
667861ffffab Extracted header class octave-preserve-stream-state from utils.{cc/h}.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
diff changeset
25
21213
f7d1050b9b53 maint: Clean up various usages of #ifdef.
Rik <rik@octave.org>
parents: 20925
diff changeset
26 #if ! defined (octave_octave_preserve_stream_state_h)
f7d1050b9b53 maint: Clean up various usages of #ifdef.
Rik <rik@octave.org>
parents: 20925
diff changeset
27 #define octave_octave_preserve_stream_state_h 1
20925
667861ffffab Extracted header class octave-preserve-stream-state from utils.{cc/h}.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
diff changeset
28
21244
1473547f50f5 include octave-config.h in public header files
John W. Eaton <jwe@octave.org>
parents: 21213
diff changeset
29 #include "octave-config.h"
1473547f50f5 include octave-config.h in public header files
John W. Eaton <jwe@octave.org>
parents: 21213
diff changeset
30
23442
53f5f8231c37 allow most header files to be compiled separately
John W. Eaton <jwe@octave.org>
parents: 23220
diff changeset
31 #include <ios>
53f5f8231c37 allow most header files to be compiled separately
John W. Eaton <jwe@octave.org>
parents: 23220
diff changeset
32
23675
f71c0195b19d move octave_preserve_stream_state to octave namespace
John W. Eaton <jwe@octave.org>
parents: 23674
diff changeset
33 namespace octave
20925
667861ffffab Extracted header class octave-preserve-stream-state from utils.{cc/h}.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
diff changeset
34 {
23675
f71c0195b19d move octave_preserve_stream_state to octave namespace
John W. Eaton <jwe@octave.org>
parents: 23674
diff changeset
35 class
f71c0195b19d move octave_preserve_stream_state to octave namespace
John W. Eaton <jwe@octave.org>
parents: 23674
diff changeset
36 preserve_stream_state
20925
667861ffffab Extracted header class octave-preserve-stream-state from utils.{cc/h}.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
diff changeset
37 {
23675
f71c0195b19d move octave_preserve_stream_state to octave namespace
John W. Eaton <jwe@octave.org>
parents: 23674
diff changeset
38 public:
f71c0195b19d move octave_preserve_stream_state to octave namespace
John W. Eaton <jwe@octave.org>
parents: 23674
diff changeset
39
f71c0195b19d move octave_preserve_stream_state to octave namespace
John W. Eaton <jwe@octave.org>
parents: 23674
diff changeset
40 preserve_stream_state (std::ios& s)
27379
3db033e86376 use m_ prefix for data members in most liboctave/util classes
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
41 : m_stream (s), m_oflags (s.flags ()), m_oprecision (s.precision ()),
3db033e86376 use m_ prefix for data members in most liboctave/util classes
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
42 m_owidth (s.width ()), m_ofill (s.fill ())
23675
f71c0195b19d move octave_preserve_stream_state to octave namespace
John W. Eaton <jwe@octave.org>
parents: 23674
diff changeset
43 { }
20925
667861ffffab Extracted header class octave-preserve-stream-state from utils.{cc/h}.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
diff changeset
44
23675
f71c0195b19d move octave_preserve_stream_state to octave namespace
John W. Eaton <jwe@octave.org>
parents: 23674
diff changeset
45 ~preserve_stream_state (void)
f71c0195b19d move octave_preserve_stream_state to octave namespace
John W. Eaton <jwe@octave.org>
parents: 23674
diff changeset
46 {
27379
3db033e86376 use m_ prefix for data members in most liboctave/util classes
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
47 m_stream.flags (m_oflags);
3db033e86376 use m_ prefix for data members in most liboctave/util classes
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
48 m_stream.precision (m_oprecision);
3db033e86376 use m_ prefix for data members in most liboctave/util classes
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
49 m_stream.width (m_owidth);
3db033e86376 use m_ prefix for data members in most liboctave/util classes
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
50 m_stream.fill (m_ofill);
23675
f71c0195b19d move octave_preserve_stream_state to octave namespace
John W. Eaton <jwe@octave.org>
parents: 23674
diff changeset
51 }
20925
667861ffffab Extracted header class octave-preserve-stream-state from utils.{cc/h}.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
diff changeset
52
23675
f71c0195b19d move octave_preserve_stream_state to octave namespace
John W. Eaton <jwe@octave.org>
parents: 23674
diff changeset
53 private:
f71c0195b19d move octave_preserve_stream_state to octave namespace
John W. Eaton <jwe@octave.org>
parents: 23674
diff changeset
54
27379
3db033e86376 use m_ prefix for data members in most liboctave/util classes
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
55 std::ios& m_stream;
3db033e86376 use m_ prefix for data members in most liboctave/util classes
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
56 std::ios::fmtflags m_oflags;
3db033e86376 use m_ prefix for data members in most liboctave/util classes
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
57 std::streamsize m_oprecision;
3db033e86376 use m_ prefix for data members in most liboctave/util classes
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
58 int m_owidth;
3db033e86376 use m_ prefix for data members in most liboctave/util classes
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
59 char m_ofill;
23675
f71c0195b19d move octave_preserve_stream_state to octave namespace
John W. Eaton <jwe@octave.org>
parents: 23674
diff changeset
60 };
f71c0195b19d move octave_preserve_stream_state to octave namespace
John W. Eaton <jwe@octave.org>
parents: 23674
diff changeset
61 }
20925
667861ffffab Extracted header class octave-preserve-stream-state from utils.{cc/h}.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
diff changeset
62
667861ffffab Extracted header class octave-preserve-stream-state from utils.{cc/h}.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
diff changeset
63 #endif