Sierra Toolkit  Version of the Day
WriterManip.cpp
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 #include <stk_util/diag/WriterManip.hpp>
10 
11 namespace stk_classic {
12 namespace diag {
13 
14 Writer &operator<<(Writer &dout, _setw set_width) {
15  if (dout.shouldPrint())
16  dout.getStream().width(set_width.m_width);
17  return dout;
18 }
19 
20 Writer &
21 operator<<(Writer &dout, _setprecision set_precision) {
22  if (dout.shouldPrint())
23  dout.getStream().precision(set_precision.m_precision);
24  return dout;
25 }
26 
27 Writer &
28 operator<<(Writer &dout, _setfill set_fill) {
29  if (dout.shouldPrint())
30  dout.getStream().fill(set_fill.m_fill);
31  return dout;
32 }
33 
34 Writer &
35 operator<<(Writer &dout, _resetiosflags reset_flags) {
36  if (dout.shouldPrint())
37  dout.getStream().setf(std::ios_base::fmtflags(0), reset_flags.m_flags);
38  return dout;
39 }
40 
41 Writer &
42 operator<<(Writer &dout, _setiosflags set_flags) {
43  if (dout.shouldPrint())
44  dout.getStream().setf(set_flags.m_flags);
45  return dout;
46 }
47 
48 Writer &
49 fixed(
50  Writer & dout)
51 {
52  if (dout.shouldPrint())
53  dout.getStream().setf(std::ios_base::fixed, std::ios_base::floatfield);
54  return dout;
55 }
56 
57 Writer &
58 scientific(
59  Writer & dout)
60 {
61  if (dout.shouldPrint())
62  dout.getStream().setf(std::ios_base::scientific, std::ios_base::floatfield);
63  return dout;
64 }
65 
66 Writer &
67 dec(
68  Writer & dout)
69 {
70  if (dout.shouldPrint())
71  dout.getStream().setf(std::ios_base::dec, std::ios_base::basefield);
72  return dout;
73 }
74 
75 Writer &
76 hex(
77  Writer & dout)
78 {
79  if (dout.shouldPrint())
80  dout.getStream().setf(std::ios_base::hex, std::ios_base::basefield);
81  return dout;
82 }
83 
84 Writer &
85 oct(
86  Writer & dout)
87 {
88  if (dout.shouldPrint())
89  dout.getStream().setf(std::ios_base::oct, std::ios_base::basefield);
90  return dout;
91 }
92 
93 } // namespace diag
94 } // namespace stk_classic
std::ostream & dout()
Diagnostic output stream.
Definition: OutputLog.cpp:674
std::ostream & operator<<(std::ostream &s, const Bucket &k)
Print the part names for which this bucket is a subset.
Definition: Bucket.cpp:239
Sierra Toolkit.