Adobe.com
Contents Suites Classes Class Index Member Index

IAIStringFormatUtils.h

Go to the documentation of this file.
00001 /*
00002  *        Name: IAIStringFormatUtils.h
00003  *   $Revision: 1 $
00004  *      Author:
00005  *        Date:
00006  *     Purpose: Interface to the wrapper class for AIStringFormatUtilsSuite & the
00007  *                              primary interface for the AI core to the ai::NumberFormat object.
00008  *
00009  * ADOBE SYSTEMS INCORPORATED
00010  * Copyright 2004-2007 Adobe Systems Incorporated.
00011  * All rights reserved.
00012  *
00013  * NOTICE:  Adobe permits you to use, modify, and distribute this file 
00014  * in accordance with the terms of the Adobe license agreement 
00015  * accompanying it. If you have received this file from a source other 
00016  * than Adobe, then your use, modification, or distribution of it 
00017  * requires the prior written permission of Adobe.
00018  *
00019  */
00020 
00021 
00022 #ifndef _IAISTRINGFORMATUTILS_H_
00023 #define _IAISTRINGFORMATUTILS_H_
00024 
00025 
00026 #include "IAIUnicodeString.h"
00027 #include "IAILocale.h"
00028 
00029 class CAINumberFormatImpl;
00030 
00031 namespace ai {
00032 
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 
00060 #ifdef AI_HAS_RVALUE_REFERENCES
00061 
00064         NumberFormat(NumberFormat&& format) AINOEXCEPT : fImpl{format.fImpl}
00065         {
00066                 format.fImpl = nullptr;
00067         }
00068 #endif
00069 
00071         ~NumberFormat();
00072 
00073 private:
00078         NumberFormat(bool dummyUseDefaultFormatter);
00079 
00080 public:
00081 
00088         static NumberFormat getFormat(const ai::LocaleID locale = ai::Locale::kDefault);
00089 
00101         ai::UnicodeString& toString(const float value, const ai::int32 precision, ai::UnicodeString& str, bool padToPrecision = false);
00102 
00109         ai::UnicodeString& toString(const ai::int32 value, ai::UnicodeString& str);
00110 
00122         ai::UnicodeString& toString(const double value, const ai::int32 precision, ai::UnicodeString& str, bool padToPrecision = false);
00123 
00130         bool parseString(const ai::UnicodeString& str, float& value);
00131 
00138         bool parseString(const ai::UnicodeString& str, ai::int32& value);
00139 
00146         bool parseString(const ai::UnicodeString& str, double& value);
00147 
00149         ai::NumberFormat& operator= (const NumberFormat& rhs);
00150 
00151 #ifdef AI_HAS_RVALUE_REFERENCES
00152 
00153         ai::NumberFormat& operator= (NumberFormat&& rhs) AINOEXCEPT
00154         {
00155                 std::swap(fImpl, rhs.fImpl);
00156                 return *this;
00157         }
00158 #endif
00159 
00164         ai::UnicodeString getDecimalSeparator();
00165 
00170         ai::UnicodeString getThousandsSeparator();
00171 
00172 public: // internal use public interface
00174         void deleteImpl();
00175 
00177         NumberFormat& assign (const NumberFormat& format);
00178 
00179 private:
00180 
00181         CAINumberFormatImpl* fImpl;
00182 
00183 };
00184 
00185 } // end of namespace ai
00186 
00187 #endif //_IAISTRINGFORMATUTILS_H_


Contents Suites Classes Class Index Member Index
Adobe Solutions Network
 
Copyright © 2014 Adobe Systems Incorporated. All rights reserved.
Terms of Use Online Privacy Policy Adobe and accessibility Avoid software piracy Permissions and Trademarks