Go to the documentation of this file.
29 #ifndef __BASE_CPRINTF_FORMATS_HH__
30 #define __BASE_CPRINTF_FORMATS_HH__
89 ios::fmtflags flags(out.flags());
93 out.setf(std::ios::hex, std::ios::basefield);
97 out.setf(std::ios::oct, std::ios::basefield);
101 out.setf(std::ios::dec, std::ios::basefield);
107 out.setf(std::ios::showbase);
128 out.width(fmt.
width);
131 out.setf(std::ios::left);
134 out.setf(std::ios::showpos);
137 out.setf(std::ios::uppercase);
144 template <
typename T>
150 ios::fmtflags flags(out.flags());
159 out.width(fmt.
width);
164 out.setf(std::ios::scientific);
169 out.width(fmt.
width);
172 out.setf(std::ios::uppercase);
178 out.width(fmt.
width);
180 out.setf(std::ios::fixed);
184 out.width(fmt.
width);
193 out.width(fmt.
width);
203 template <
typename T>
209 #if defined(__GNUC__) && (__GNUC__ < 3) || 1
211 std::stringstream
foo;
213 int flen =
foo.str().size();
215 if (fmt.
width > flen) {
216 char *spaces =
new char[fmt.
width - flen + 1];
217 memset(spaces,
' ', fmt.
width - flen);
218 spaces[fmt.
width - flen] = 0;
221 out <<
foo.str() << spaces;
223 out << spaces <<
foo.str();
232 out.width(fmt.
width);
234 out.setf(std::ios::left);
248 template <
typename T>
251 { out <<
"<bad arg type for char format>"; }
300 template <
typename T>
323 template <
typename T>
326 { out <<
"<bad arg type for float format>"; }
339 template <
typename T>
346 #endif // __CPRINTF_FORMATS_HH__
void format_float(std::ostream &out, const T &data, Format &fmt)
void _format_float(std::ostream &out, const T &data, Format &fmt)
void format_char(std::ostream &out, const T &data, Format &fmt)
void _format_string(std::ostream &out, const T &data, Format &fmt)
void format_string(std::ostream &out, const T &data, Format &fmt)
void _format_char(std::ostream &out, const T &data, Format &fmt)
void _format_integer(std::ostream &out, const T &data, Format &fmt)
Overload hash function for BasicBlockRange type.
std::true_type foo(void(*)(ThreadContext *, const Ret &ret, State &state))
void format_integer(std::ostream &out, const T &data, Format &fmt)
Generated on Wed Sep 30 2020 14:02:07 for gem5 by doxygen 1.8.17