+// © 2016 and later: Unicode, Inc. and others.
+// License & terms of use: http://www.unicode.org/copyright.html
/*
********************************************************************************
-* Copyright (C) 1997-2015, International Business Machines
+* Copyright (C) 1997-2016, International Business Machines
* Corporation and others. All Rights Reserved.
********************************************************************************
*
#include "unicode/uobject.h"
#include "unicode/locid.h"
#include "unicode/unum.h"
+#include "unicode/unistr.h"
/**
* \file
*/
+#if U_SHOW_CPLUSPLUS_API
U_NAMESPACE_BEGIN
/**
* @stable ICU 4.6
*/
kNineDigitSymbol,
-#ifndef U_HIDE_DRAFT_API
/** Multiplication sign.
- * @draft ICU 54
+ * @stable ICU 54
*/
kExponentMultiplicationSymbol,
-#endif /* U_HIDE_DRAFT_API */
/** count symbol constants */
kFormatSymbolCount = kNineDigitSymbol + 2
};
void setCurrencyForSymbols();
public:
+
+#ifndef U_HIDE_INTERNAL_API
+ /**
+ * @internal For ICU use only
+ */
+ inline UBool isCustomCurrencySymbol() const {
+ return fIsCustomCurrencySymbol;
+ }
+
+ /**
+ * @internal For ICU use only
+ */
+ inline UBool isCustomIntlCurrencySymbol() const {
+ return fIsCustomIntlCurrencySymbol;
+ }
+#endif /* U_HIDE_INTERNAL_API */
+
/**
* _Internal_ function - more efficient version of getSymbol,
* returning a const reference to one of the symbol strings.
* Returns that pattern stored in currecy info. Internal API for use by NumberFormat API.
* @internal
*/
- inline const UChar* getCurrencyPattern(void) const;
+ inline const char16_t* getCurrencyPattern(void) const;
#endif /* U_HIDE_INTERNAL_API */
private:
char actualLocale[ULOC_FULLNAME_CAPACITY];
char validLocale[ULOC_FULLNAME_CAPACITY];
- const UChar* currPattern;
+ const char16_t* currPattern;
UnicodeString currencySpcBeforeSym[UNUM_CURRENCY_SPACING_COUNT];
UnicodeString currencySpcAfterSym[UNUM_CURRENCY_SPACING_COUNT];
+ UBool fIsCustomCurrencySymbol;
+ UBool fIsCustomIntlCurrencySymbol;
};
// -------------------------------------
return *strPtr;
}
-//#ifndef U_HIDE_INTERNAL_API
-// See comments above for this function. Not hidden.
+// See comments above for this function. Not hidden with #ifndef U_HIDE_INTERNAL_API
inline const UnicodeString &
DecimalFormatSymbols::getConstSymbol(ENumberFormatSymbol symbol) const {
const UnicodeString *strPtr;
return *strPtr;
}
-//#endif /* U_HIDE_INTERNAL_API */
-
-
// -------------------------------------
inline void
DecimalFormatSymbols::setSymbol(ENumberFormatSymbol symbol, const UnicodeString &value, const UBool propogateDigits = TRUE) {
+ if (symbol == kCurrencySymbol) {
+ fIsCustomCurrencySymbol = TRUE;
+ }
+ else if (symbol == kIntlCurrencySymbol) {
+ fIsCustomIntlCurrencySymbol = TRUE;
+ }
if(symbol<kFormatSymbolCount) {
fSymbols[symbol]=value;
}
}
#ifndef U_HIDE_INTERNAL_API
-inline const UChar*
+inline const char16_t*
DecimalFormatSymbols::getCurrencyPattern() const {
return currPattern;
}
#endif /* U_HIDE_INTERNAL_API */
U_NAMESPACE_END
+#endif // U_SHOW_CPLUSPLUS_API
#endif /* #if !UCONFIG_NO_FORMATTING */