32 #ifndef DRAIN_IOS_FORMAT_H_
33 #define DRAIN_IOS_FORMAT_H_
35 #include <drain/Log.h>
50 IosFormat(
const std::ostream & ostr = std::cout){
55 void copyFrom(
const std::ostream & ostr){
56 precision = ostr.precision();
57 fillChar = ostr.fill();
58 fieldWidth = ostr.width();
63 void copyTo(std::ostream & ostr)
const {
64 ostr.precision(precision);
66 ostr.width(fieldWidth);
71 char getFillChar()
const {
76 void setFillChar(
char c) {
81 std::streamsize getFieldWidth()
const {
86 void setFieldWidth(std::streamsize w) {
90 std::streamsize getPrecision()
const {
94 void setPrecision(std::streamsize precision) {
95 this->precision = precision;
101 std::streamsize precision;
102 std::streamsize fieldWidth;
109 std::ostream & operator<<(std::ostream & ostr,
const IosFormat & iosformat){
110 if (iosformat.getFillChar())
111 ostr << iosformat.getFillChar();
112 ostr << iosformat.getFieldWidth() <<
"d";
113 ostr <<
"/0." << iosformat.getPrecision() <<
"f";
Definition: DataSelector.cpp:1277