Sierra Toolkit  Version of the Day
WriterManip.hpp
1 /*------------------------------------------------------------------------*/
2 /* Copyright 2010 Sandia Corporation. */
3 /* Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive */
4 /* license for use of this work by or on behalf of the U.S. Government. */
5 /* Export of this program may require a license from the */
6 /* United States Government. */
7 /*------------------------------------------------------------------------*/
8 
9 #ifndef STK_UTIL_DIAG_MANIP_HPP
10 #define STK_UTIL_DIAG_MANIP_HPP
11 
12 #include <iomanip>
13 
14 #include <stk_util/diag/Writer_fwd.hpp>
15 #include <stk_util/diag/Writer.hpp>
16 
17 namespace stk_classic {
18 namespace diag {
19 
24 
29 struct _setw
30 {
31  _setw(int width)
32  : m_width(width)
33  {}
34 
35  int m_width;
36 };
37 
44 inline _setw setw(int width) {
45  return _setw(width);
46 }
47 
48 Writer &operator<<(Writer &dout, _setw set_width);
49 
50 
56 {
57  _setprecision(int precision)
58  : m_precision(precision)
59  {}
60 
61  int m_precision;
62 };
63 
70 inline _setprecision setprecision(int precision) {
71  return _setprecision(precision);
72 }
73 
74 Writer &operator<<(Writer &dout, _setprecision set_precision);
75 
76 
81 struct _setfill
82 {
83  _setfill(char fill)
84  : m_fill(fill)
85  {}
86 
87  char m_fill;
88 };
89 
96 inline _setfill setfill(char fill) {
97  return _setfill(fill);
98 }
99 
100 Writer &operator<<(Writer &dout, _setfill set_fill);
101 
102 
108 {
109  _setiosflags(std::ios_base::fmtflags flags)
110  : m_flags(flags)
111  {}
112 
113  std::ios_base::fmtflags m_flags;
114 };
115 
122 inline _setiosflags setiosflags(std::ios_base::fmtflags flags) {
123  return _setiosflags(flags);
124 }
125 
126 Writer &operator<<(Writer &dout, _setiosflags set_flags);
127 
128 
134 {
135  _resetiosflags(std::ios_base::fmtflags flags)
136  : m_flags(flags)
137  {}
138 
139  std::ios_base::fmtflags m_flags;
140 };
141 
148 inline _resetiosflags resetiosflags(std::ios_base::fmtflags flags) {
149  return _resetiosflags(flags);
150 }
151 
152 Writer &operator<<(Writer &dout, _resetiosflags reset_flags);
153 
154 Writer &fixed(Writer &dout);
155 Writer &scientific(Writer &dout);
156 Writer &dec(Writer &dout);
157 Writer &hex(Writer &dout);
158 Writer &oct(Writer &dout);
159 
163 
164 } // namespace diag
165 } // namespace stk_classic
166 
167 namespace sierra {
168 namespace Diag {
169 
173 
174 } // namespace Diag
175 } // namespace sierra
176 
177 #endif // STK_UTIL_DIAG_MANIP_HPP
_setfill setfill(char fill)
Function setfill sets the fill character as a manipulator.
Definition: WriterManip.hpp:96
Class _setfill is the fill character manipulator.
Definition: WriterManip.hpp:81
Definition: Env.cpp:53
_resetiosflags resetiosflags(std::ios_base::fmtflags flags)
Function resetiosflags clears the ios flags as a manipulator.
Class _setw is the width manipulator.
Definition: WriterManip.hpp:29
Class _setiosflags is the flags manipulator.
_setprecision setprecision(int precision)
Function setprecision sets the numeric precision as a manipulator.
Definition: WriterManip.hpp:70
_setw setw(int width)
Function setw sets the width for the next field as a manipulator.
Definition: WriterManip.hpp:44
Sierra Toolkit.
Class _setprecision is the precision manipulator.
Definition: WriterManip.hpp:55
_setiosflags setiosflags(std::ios_base::fmtflags flags)
Function setiosflags sets the ios flags as a manipulator.
Class _resetiosflags is the reset ios flags reset manipulator.