currfmt.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. // Copyright (C) 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 Format* 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. private:
  73. NumberFormat* fmt;
  74. };
  75. U_NAMESPACE_END
  76. #endif // #if !UCONFIG_NO_FORMATTING
  77. #endif // #ifndef CURRENCYFORMAT_H