00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef _IAISTRINGFORMATUTILS_H_
00023 #define _IAISTRINGFORMATUTILS_H_
00024
00025
00026 #include "IAIUnicodeString.h"
00027 #include "IAILocale.h"
00028
00029
00030 class CAINumberFormatImpl;
00031
00032 namespace ai {
00033
00037 class NumberFormat
00038 {
00039 public:
00040
00046 explicit NumberFormat (void) AINOTHROW;
00047
00053 explicit NumberFormat(const ai::LocaleID locale);
00054
00058 NumberFormat(const NumberFormat& format);
00059
00061 ~NumberFormat();
00062
00063 private:
00068 NumberFormat(bool dummyUseDefaultFormatter);
00069
00070 public:
00071
00078 static NumberFormat getFormat(const ai::LocaleID locale = ai::Locale::kDefault);
00079
00091 ai::UnicodeString& toString(const float value, const ai::int32 precision, ai::UnicodeString& str, bool padToPrecision = false);
00092
00099 ai::UnicodeString& toString(const ai::int32 value, ai::UnicodeString& str);
00100
00112 ai::UnicodeString& toString(const double value, const ai::int32 precision, ai::UnicodeString& str, bool padToPrecision = false);
00113
00120 bool parseString(const ai::UnicodeString& str, float& value);
00121
00128 bool parseString(const ai::UnicodeString& str, ai::int32& value);
00129
00136 bool parseString(const ai::UnicodeString& str, double& value);
00137
00139 ai::NumberFormat& operator= (const NumberFormat& rhs);
00140
00145 ai::UnicodeString getDecimalSeparator();
00146
00151 ai::UnicodeString getThousandsSeparator();
00152
00153 public:
00155 void deleteImpl();
00156
00158 NumberFormat& assign (const NumberFormat& format);
00159
00160 private:
00161
00162 CAINumberFormatImpl* fImpl;
00163
00164 };
00165
00166 }
00167
00168 #endif //_IAISTRINGFORMATUTILS_H_