7 void Fmt::parse(const char *s)
32 if(*f>='0' && *f<='9')
44 if(*f>='0' && *f<='9')
45 prec = prec*10+(*f-'0');
52 if(*f=='d' || *f=='u')
54 else if(*f=='x' || *f=='X')
60 else if(*f=='e' || *f=='E')
62 else if(*f=='f' || *f=='F')
64 else if(*f=='g' || *f=='G')
66 else if(*f=='p' || *f=='P')
78 throw format_error(s);
80 if(*f=='E' || *f=='F' || *f=='G' || *f=='X' || *f=='P')
86 throw format_error(s);
106 void Fmt::apply(ostream &out) const
108 out.flags(((base==HEX) ? ios_base::hex : (base==OCT) ? ios_base::oct : ios_base::dec)
109 | ((fmode==SCI) ? ios_base::scientific : (fmode==FIXED) ? ios_base::fixed : ios_base::fmtflags(0))
110 | (fillc=='0' ? ios_base::internal : (align==LEFT) ? ios_base::left : ios_base::right)
111 | (sbase ? ios_base::showbase : ios_base::fmtflags(0))
112 | (spoint ? ios_base::showpoint : ios_base::fmtflags(0))
113 | (spos ? ios_base::showpos : ios_base::fmtflags(0))
114 | (ucase ? ios_base::uppercase : ios_base::fmtflags(0)));