| OLD | NEW |
| 1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
| 6 | 6 |
| 7 #ifndef XFA_FGAS_LOCALIZATION_FGAS_LOCALEIMP_H_ | 7 #ifndef XFA_FGAS_LOCALIZATION_FGAS_LOCALEIMP_H_ |
| 8 #define XFA_FGAS_LOCALIZATION_FGAS_LOCALEIMP_H_ | 8 #define XFA_FGAS_LOCALIZATION_FGAS_LOCALEIMP_H_ |
| 9 | 9 |
| 10 #include "xfa/fgas/localization/fgas_locale.h" | 10 #include "xfa/fgas/localization/fgas_locale.h" |
| 11 | 11 |
| 12 class CFX_LCNumeric; | 12 class CFX_LCNumeric; |
| 13 | 13 |
| 14 class CFX_FormatString { | 14 class CFX_FormatString { |
| 15 public: | 15 public: |
| 16 CFX_FormatString(IFX_LocaleMgr* pLocaleMgr, bool bUseLCID); | 16 CFX_FormatString(IFX_LocaleMgr* pLocaleMgr, bool bUseLCID); |
| 17 | 17 ~CFX_FormatString(); |
| 18 void Release() { delete this; } | |
| 19 | 18 |
| 20 void SplitFormatString(const CFX_WideString& wsFormatString, | 19 void SplitFormatString(const CFX_WideString& wsFormatString, |
| 21 CFX_WideStringArray& wsPatterns); | 20 CFX_WideStringArray& wsPatterns); |
| 22 FX_LOCALECATEGORY GetCategory(const CFX_WideString& wsPattern); | 21 FX_LOCALECATEGORY GetCategory(const CFX_WideString& wsPattern); |
| 23 uint16_t GetLCID(const CFX_WideString& wsPattern); | 22 uint16_t GetLCID(const CFX_WideString& wsPattern); |
| 24 CFX_WideString GetLocaleName(const CFX_WideString& wsPattern); | 23 CFX_WideString GetLocaleName(const CFX_WideString& wsPattern); |
| 25 bool ParseText(const CFX_WideString& wsSrcText, | 24 bool ParseText(const CFX_WideString& wsSrcText, |
| 26 const CFX_WideString& wsPattern, | 25 const CFX_WideString& wsPattern, |
| 27 CFX_WideString& wsValue); | 26 CFX_WideString& wsValue); |
| 28 bool ParseNum(const CFX_WideString& wsSrcNum, | 27 bool ParseNum(const CFX_WideString& wsSrcNum, |
| (...skipping 26 matching lines...) Expand all Loading... |
| 55 const CFX_WideString& wsPattern, | 54 const CFX_WideString& wsPattern, |
| 56 CFX_WideString& wsOutput, | 55 CFX_WideString& wsOutput, |
| 57 FX_DATETIMETYPE eDateTimeType); | 56 FX_DATETIMETYPE eDateTimeType); |
| 58 bool FormatDateTime(const CFX_Unitime& dt, | 57 bool FormatDateTime(const CFX_Unitime& dt, |
| 59 const CFX_WideString& wsPattern, | 58 const CFX_WideString& wsPattern, |
| 60 CFX_WideString& wsOutput); | 59 CFX_WideString& wsOutput); |
| 61 bool FormatZero(const CFX_WideString& wsPattern, CFX_WideString& wsOutput); | 60 bool FormatZero(const CFX_WideString& wsPattern, CFX_WideString& wsOutput); |
| 62 bool FormatNull(const CFX_WideString& wsPattern, CFX_WideString& wsOutput); | 61 bool FormatNull(const CFX_WideString& wsPattern, CFX_WideString& wsOutput); |
| 63 | 62 |
| 64 protected: | 63 protected: |
| 65 ~CFX_FormatString(); | |
| 66 | |
| 67 IFX_Locale* GetTextFormat(const CFX_WideString& wsPattern, | 64 IFX_Locale* GetTextFormat(const CFX_WideString& wsPattern, |
| 68 const CFX_WideStringC& wsCategory, | 65 const CFX_WideStringC& wsCategory, |
| 69 CFX_WideString& wsPurgePattern); | 66 CFX_WideString& wsPurgePattern); |
| 70 IFX_Locale* GetNumericFormat(const CFX_WideString& wsPattern, | 67 IFX_Locale* GetNumericFormat(const CFX_WideString& wsPattern, |
| 71 int32_t& iDotIndex, | 68 int32_t& iDotIndex, |
| 72 uint32_t& dwStyle, | 69 uint32_t& dwStyle, |
| 73 CFX_WideString& wsPurgePattern); | 70 CFX_WideString& wsPurgePattern); |
| 74 bool FormatStrNum(const CFX_WideStringC& wsInputNum, | 71 bool FormatStrNum(const CFX_WideStringC& wsInputNum, |
| 75 const CFX_WideString& wsPattern, | 72 const CFX_WideString& wsPattern, |
| 76 CFX_WideString& wsOutput); | 73 CFX_WideString& wsOutput); |
| 77 bool FormatLCNumeric(CFX_LCNumeric& lcNum, | 74 bool FormatLCNumeric(CFX_LCNumeric& lcNum, |
| 78 const CFX_WideString& wsPattern, | 75 const CFX_WideString& wsPattern, |
| 79 CFX_WideString& wsOutput); | 76 CFX_WideString& wsOutput); |
| 80 FX_DATETIMETYPE GetDateTimeFormat(const CFX_WideString& wsPattern, | 77 FX_DATETIMETYPE GetDateTimeFormat(const CFX_WideString& wsPattern, |
| 81 IFX_Locale*& pLocale, | 78 IFX_Locale*& pLocale, |
| 82 CFX_WideString& wsDatePattern, | 79 CFX_WideString& wsDatePattern, |
| 83 CFX_WideString& wsTimePattern); | 80 CFX_WideString& wsTimePattern); |
| 84 IFX_Locale* GetPatternLocale(const CFX_WideString& wsLocale); | 81 IFX_Locale* GetPatternLocale(const CFX_WideString& wsLocale); |
| 85 | 82 |
| 86 IFX_LocaleMgr* m_pLocaleMgr; | 83 IFX_LocaleMgr* m_pLocaleMgr; |
| 87 bool m_bUseLCID; | 84 bool m_bUseLCID; |
| 88 }; | 85 }; |
| 89 | 86 |
| 90 #endif // XFA_FGAS_LOCALIZATION_FGAS_LOCALEIMP_H_ | 87 #endif // XFA_FGAS_LOCALIZATION_FGAS_LOCALEIMP_H_ |
| OLD | NEW |