/* $Id$
This file is part of libmspstrings
-Copyright © 2006-2007 Mikko Rasa
+Copyright © 2006-2008 Mikko Rasa
Distributed under the LGPL
*/
+
#include <msp/core/except.h>
#include "fmt.h"
fillc=' ';
base=DEC;
sbase=false;
- fmode=EXP;
+ fmode=AUTOFLT;
spoint=false;
align=RIGHT;
ucase=false;
+ type=STR;
return *this;
}
}
}
- if(*f=='x' || *f=='X')
+ type=NUM;
+ if(*f=='d' || *f=='u')
+ base=DEC;
+ else if(*f=='x' || *f=='X')
base=HEX;
else if(*f=='o')
base=OCT;
+ else if(*f=='b')
+ base=BIN;
else if(*f=='e' || *f=='E')
fmode=SCI;
else if(*f=='f' || *f=='F')
fmode=FIXED;
else if(*f=='g' || *f=='G')
- fmode=EXP;
- else if(*f=='p')
+ fmode=AUTOFLT;
+ else if(*f=='p' || *f=='P')
{
base=HEX;
sbase=true;
}
- else if(*f=='d' || *f=='i' || *f=='u' || *f=='c' || *f=='s')
- ;
+ else if(*f=='c')
+ type=CHAR;
+ else if(*f=='s')
+ type=STR;
+ else if(*f=='i')
+ base=AUTOBASE;
else
throw InvalidParameterValue("Invalid conversion specifier");
- if(*f=='E' || *f=='F' || *f=='G' || *f=='X')
+ if(*f=='E' || *f=='F' || *f=='G' || *f=='X' || *f=='P')
ucase=true;
++f;