7 void Fmt::parse(const char *s)
35 if(*f>='0' && *f<='9')
47 if(*f>='0' && *f<='9')
48 prec = prec*10+(*f-'0');
55 if(*f=='d' || *f=='u')
57 else if(*f=='x' || *f=='X')
63 else if(*f=='e' || *f=='E')
65 else if(*f=='f' || *f=='F')
67 else if(*f=='g' || *f=='G')
69 else if(*f=='p' || *f=='P')
81 throw format_error(s);
83 if(*f=='E' || *f=='F' || *f=='G' || *f=='X' || *f=='P')
89 throw format_error(s);
97 void Fmt::apply(ostream &out) const
99 out.flags(((base==HEX) ? ios_base::hex : (base==OCT) ? ios_base::oct : ios_base::dec)
100 | ((fmode==SCI) ? ios_base::scientific : (fmode==FIXED) ? ios_base::fixed : ios_base::fmtflags(0))
101 | (fillc=='0' ? ios_base::internal : (align==LEFT) ? ios_base::left : ios_base::right)
102 | (sbase ? ios_base::showbase : ios_base::fmtflags(0))
103 | (spoint ? ios_base::showpoint : ios_base::fmtflags(0))
104 | (spos ? ios_base::showpos : ios_base::fmtflags(0))
105 | (ucase ? ios_base::uppercase : ios_base::fmtflags(0)));