currfmt.h 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. // © 2016 and later: Unicode, Inc. and others.
  2. // License & terms of use: http://www.unicode.org/copyright.html
  3. /*
  4. **********************************************************************
  5. * Copyright (c) 2004-2014, International Business Machines
  6. * Corporation and others. All Rights Reserved.
  7. **********************************************************************
  8. * Author: Alan Liu
  9. * Created: April 20, 2004
  10. * Since: ICU 3.0
  11. **********************************************************************
  12. */
  13. #ifndef CURRENCYFORMAT_H
  14. #define CURRENCYFORMAT_H
  15. #include "unicode/utypes.h"
  16. #if !UCONFIG_NO_FORMATTING
  17. #include "unicode/measfmt.h"
  18. U_NAMESPACE_BEGIN
  19. class NumberFormat;
  20. /**
  21. * Temporary internal concrete subclass of MeasureFormat implementing
  22. * parsing and formatting of currency amount objects. This class is
  23. * likely to be redesigned and rewritten in the near future.
  24. *
  25. * <p>This class currently delegates to DecimalFormat for parsing and
  26. * formatting.
  27. *
  28. * @see MeasureFormat
  29. * @author Alan Liu
  30. * @internal
  31. */
  32. class CurrencyFormat : public MeasureFormat {
  33. public:
  34. /**
  35. * Construct a CurrencyFormat for the given locale.
  36. */
  37. CurrencyFormat(const Locale& locale, UErrorCode& ec);
  38. /**
  39. * Copy constructor.
  40. */
  41. CurrencyFormat(const CurrencyFormat& other);
  42. /**
  43. * Destructor.
  44. */
  45. virtual ~CurrencyFormat();
  46. /**
  47. * Override Format API.
  48. */
  49. virtual CurrencyFormat* clone() const;
  50. using MeasureFormat::format;
  51. /**
  52. * Override Format API.
  53. */
  54. virtual UnicodeString& format(const Formattable& obj,
  55. UnicodeString& appendTo,
  56. FieldPosition& pos,
  57. UErrorCode& ec) const;
  58. /**
  59. * Override Format API.
  60. */
  61. virtual void parseObject(const UnicodeString& source,
  62. Formattable& result,
  63. ParsePosition& pos) const;
  64. /**
  65. * Override Format API.
  66. */
  67. virtual UClassID getDynamicClassID() const;
  68. /**
  69. * Returns the class ID for this class.
  70. */
  71. static UClassID U_EXPORT2 getStaticClassID();
  72. };
  73. U_NAMESPACE_END
  74. #endif // #if !UCONFIG_NO_FORMATTING
  75. #endif // #ifndef CURRENCYFORMAT_H