9 Resets the format to the default. Mainly used by constructors.
28 Applies the format to the given ostream. All existing formatting information
31 void Fmt::apply(ostream &out) const
33 out.flags(((base==HEX) ? ios_base::hex : (base==OCT) ? ios_base::oct : ios_base::dec)
34 | ((fmode==SCI) ? ios_base::scientific : (fmode==FIXED) ? ios_base::fixed : ios_base::fmtflags(0))
35 | (fillc=='0' ? ios_base::internal : (align==LEFT) ? ios_base::left : ios_base::right)
36 | (sbase ? ios_base::showbase : ios_base::fmtflags(0))
37 | (spoint ? ios_base::showpoint : ios_base::fmtflags(0))
38 | (spos ? ios_base::showpos : ios_base::fmtflags(0))
39 | (ucase ? ios_base::uppercase : ios_base::fmtflags(0)));
46 Parses a printf-style conversion specification. Called from constructors.
48 void Fmt::parse(const char *f)
72 if(*f>='0' && *f<='9')
84 if(*f>='0' && *f<='9')
85 prec=prec*10+(*f-'0');
91 if(*f=='x' || *f=='X')
95 else if(*f=='e' || *f=='E')
97 else if(*f=='f' || *f=='F')
99 else if(*f=='g' || *f=='G')
106 else if(*f=='d' || *f=='i' || *f=='u' || *f=='c' || *f=='s')
109 throw InvalidParameterValue("Invalid conversion specifier");
111 if(*f=='E' || *f=='F' || *f=='G' || *f=='X')
117 throw InvalidParameterValue("Extra characters in conversion specification");