33 fOldFlags(fStream.flags()),
66 bool b_dollar =
false;
67 bool b_internal =
false;
72 if (form ==
nullptr) form =
"";
74 for (c = *form++; ; c = *form++) {
75 if (c ==
'+') { b_plus =
true;
continue;}
76 if (c ==
'-') { b_minus =
true;
continue;}
77 if (c ==
'.') { b_point =
true;
continue;}
78 if (c ==
'$') { b_dollar =
true;
continue;}
82 if (c != 0 && isalpha(c)) { c_ctype = c; c = *form++; }
83 if (c != 0) c_fill = c;
86 int i_old_precision =
fStream.precision(prec);
90 char c_old_fill =
fStream.fill(c_fill);
98 b_internal = !b_minus & (c_fill ==
'0');
99 fStream.setf(ios::dec,ios::basefield);
102 b_internal = !b_minus & (c_fill ==
'0');
103 fStream.setf(ios::oct,ios::basefield);
107 b_internal = !b_minus & (c_fill ==
'0');
108 fStream.setf(ios::hex,ios::basefield);
109 if (isupper(c_ctype))
fStream.setf(ios::uppercase);
113 b_internal = !b_minus & (c_fill ==
'0');
114 fStream.setf(ios_base::fmtflags(0),ios::floatfield);
115 if (isupper(c_ctype))
fStream.setf(ios::uppercase);
118 b_internal = !b_minus & (c_fill ==
'0');
119 fStream.setf(ios::fixed,ios::floatfield);
123 b_internal = !b_minus & (c_fill ==
'0');
124 fStream.setf(ios::scientific,ios::floatfield);
125 if (isupper(c_ctype))
fStream.setf(ios::uppercase);
134 ios_base::fmtflags l_flags = ios_base::fmtflags(0);
135 if (b_plus) l_flags |= ios::showpos;
136 if (b_point) l_flags |= ios::showpoint;
137 if (b_dollar) l_flags |= ios::showbase;
139 fStream.setf(b_internal ? ios::internal :
140 (b_minus ? ios::left : ios::right), ios::adjustfield);
Stack object for ostream state. **.
void SetFormat(const char *form, int prec=-1)
Setup format.
std::ios_base::fmtflags fOldFlags
Declaration of class ReventLoop.