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);
109 void Fmt::apply(ostream &out) const
111 out.flags(((base==HEX) ? ios_base::hex : (base==OCT) ? ios_base::oct : ios_base::dec)
112 | ((fmode==SCI) ? ios_base::scientific : (fmode==FIXED) ? ios_base::fixed : ios_base::fmtflags(0))
113 | (fillc=='0' ? ios_base::internal : (align==LEFT) ? ios_base::left : ios_base::right)
114 | (sbase ? ios_base::showbase : ios_base::fmtflags(0))
115 | (spoint ? ios_base::showpoint : ios_base::fmtflags(0))
116 | (spos ? ios_base::showpos : ios_base::fmtflags(0))
117 | (ucase ? ios_base::uppercase : ios_base::fmtflags(0)));