ICU-4072 Explicitly use U_EXPORT2 to specify calling convention of static C++ code.

X-SVN-Rev: 16183
This commit is contained in:
George Rhoten 2004-08-24 17:38:33 +00:00
parent 254eea3c6e
commit 7c225a89aa
63 changed files with 671 additions and 711 deletions

View File

@ -50,7 +50,7 @@ class U_I18N_API AnyTransliterator : public Transliterator {
UScriptCode targetScript;
public:
/**
* Destructor.
*/
@ -71,7 +71,7 @@ public:
*/
virtual void handleTransliterate(Replaceable& text, UTransPosition& index,
UBool incremental) const;
/**
* ICU "poor man's RTTI", returns a UClassID for the actual class.
*
@ -84,7 +84,7 @@ public:
*
* @draft ICU 2.2
*/
static UClassID getStaticClassID();
static UClassID U_EXPORT2 getStaticClassID();
private:
@ -124,7 +124,7 @@ private:
static void registerIDs();
friend class Transliterator; // for registerIDs()
/**
* Return the script code for a given name, or
* USCRIPT_INVALID_CODE if not found.

View File

@ -22,7 +22,7 @@
U_NAMESPACE_BEGIN
const char BuddhistCalendar::fgClassID = 0; // Value is irrelevant
UOBJECT_DEFINE_RTTI_IMPLEMENTATION(BuddhistCalendar)
static const int32_t kMaxEra = 0; // only 1 era

View File

@ -116,7 +116,7 @@ public:
* @return The class ID for all objects of this class.
* @internal
*/
static inline UClassID getStaticClassID(void);
static UClassID U_EXPORT2 getStaticClassID(void);
/**
* return the calendar type, "buddhist".
@ -176,8 +176,6 @@ public:
private:
BuddhistCalendar(); // default constructor not implemented
static const char fgClassID;
protected:
/**
* Return the extended year defined by the current fields. This will
@ -304,15 +302,6 @@ private:
static void initializeSystemDefaultCentury(void);
};
inline UClassID
BuddhistCalendar::getStaticClassID(void)
{ return (UClassID)&fgClassID; }
inline UClassID
BuddhistCalendar::getDynamicClassID(void) const
{ return BuddhistCalendar::getStaticClassID(); }
U_NAMESPACE_END
#endif /* #if !UCONFIG_NO_FORMATTING */

View File

@ -571,7 +571,7 @@ Calendar::operator=(const Calendar &right)
// -------------------------------------
Calendar*
Calendar* U_EXPORT2
Calendar::createInstance(UErrorCode& success)
{
return createInstance(TimeZone::createDefault(), Locale::getDefault(), success);
@ -579,7 +579,7 @@ Calendar::createInstance(UErrorCode& success)
// -------------------------------------
Calendar*
Calendar* U_EXPORT2
Calendar::createInstance(const TimeZone& zone, UErrorCode& success)
{
return createInstance(zone, Locale::getDefault(), success);
@ -587,7 +587,7 @@ Calendar::createInstance(const TimeZone& zone, UErrorCode& success)
// -------------------------------------
Calendar*
Calendar* U_EXPORT2
Calendar::createInstance(const Locale& aLocale, UErrorCode& success)
{
return createInstance(TimeZone::createDefault(), aLocale, success);
@ -597,7 +597,7 @@ Calendar::createInstance(const Locale& aLocale, UErrorCode& success)
// Note: this is the bottleneck that actually calls the service routines.
Calendar*
Calendar* U_EXPORT2
Calendar::createInstance(TimeZone* zone, const Locale& aLocale, UErrorCode& success)
{
Locale actualLoc;
@ -711,7 +711,7 @@ Calendar::createInstance(TimeZone* zone, const Locale& aLocale, UErrorCode& succ
// -------------------------------------
Calendar*
Calendar* U_EXPORT2
Calendar::createInstance(const TimeZone& zone, const Locale& aLocale, UErrorCode& success)
{
Calendar* c = createInstance(aLocale, success);
@ -772,7 +772,7 @@ Calendar::after(const Calendar& when, UErrorCode& status) const
// -------------------------------------
const Locale*
const Locale* U_EXPORT2
Calendar::getAvailableLocales(int32_t& count)
{
return Locale::getAvailableLocales(count);
@ -780,7 +780,7 @@ Calendar::getAvailableLocales(int32_t& count)
// -------------------------------------
UDate
UDate U_EXPORT2
Calendar::getNow()
{
return uprv_getUTCtime(); // return as milliseconds

View File

@ -227,14 +227,12 @@ Collator::createUCollator(const char *loc,
// Collator public methods -----------------------------------------------
Collator* Collator::createInstance(UErrorCode& success)
Collator* U_EXPORT2 Collator::createInstance(UErrorCode& success)
{
if (U_FAILURE(success))
return 0;
return createInstance(Locale::getDefault(), success);
}
Collator* Collator::createInstance(const Locale& desiredLocale,
Collator* U_EXPORT2 Collator::createInstance(const Locale& desiredLocale,
UErrorCode& status)
{
if (U_FAILURE(status))
@ -379,12 +377,12 @@ UBool Collator::greater(const UnicodeString& source,
// this API ignores registered collators, since it returns an
// array of indefinite lifetime
const Locale* Collator::getAvailableLocales(int32_t& count)
const Locale* U_EXPORT2 Collator::getAvailableLocales(int32_t& count)
{
return Locale::getAvailableLocales(count);
}
UnicodeString& Collator::getDisplayName(const Locale& objectLocale,
UnicodeString& U_EXPORT2 Collator::getDisplayName(const Locale& objectLocale,
const Locale& displayLocale,
UnicodeString& name)
{
@ -396,7 +394,7 @@ UnicodeString& Collator::getDisplayName(const Locale& objectLocale,
return objectLocale.getDisplayName(displayLocale, name);
}
UnicodeString& Collator::getDisplayName(const Locale& objectLocale,
UnicodeString& U_EXPORT2 Collator::getDisplayName(const Locale& objectLocale,
UnicodeString& name)
{
return getDisplayName(objectLocale, Locale::getDefault(), name);
@ -457,7 +455,7 @@ UBool Collator::operator!=(const Collator& other) const
return (UBool)!(*this == other);
}
int32_t Collator::getBound(const uint8_t *source,
int32_t U_EXPORT2 Collator::getBound(const uint8_t *source,
int32_t sourceLength,
UColBoundMode boundType,
uint32_t noOfLevels,
@ -484,7 +482,7 @@ UnicodeSet *Collator::getTailoredSet(UErrorCode &status) const
// -------------------------------------
#if !UCONFIG_NO_SERVICE
URegistryKey
URegistryKey U_EXPORT2
Collator::registerInstance(Collator* toAdopt, const Locale& locale, UErrorCode& status)
{
if (U_SUCCESS(status)) {
@ -574,7 +572,7 @@ CFactory::getDisplayName(const UnicodeString& id, const Locale& locale, UnicodeS
return result;
}
URegistryKey
URegistryKey U_EXPORT2
Collator::registerFactory(CollatorFactory* toAdopt, UErrorCode& status)
{
if (U_SUCCESS(status)) {
@ -589,7 +587,7 @@ Collator::registerFactory(CollatorFactory* toAdopt, UErrorCode& status)
// -------------------------------------
UBool
UBool U_EXPORT2
Collator::unregister(URegistryKey key, UErrorCode& status)
{
if (U_SUCCESS(status)) {
@ -603,14 +601,14 @@ Collator::unregister(URegistryKey key, UErrorCode& status)
// -------------------------------------
StringEnumeration*
StringEnumeration* U_EXPORT2
Collator::getAvailableLocales(void)
{
return getService()->getAvailableLocales();
}
#endif /* UCONFIG_NO_SERVICE */
StringEnumeration*
StringEnumeration* U_EXPORT2
Collator::getKeywords(UErrorCode& status) {
// This is a wrapper over ucol_getKeywords
UEnumeration* uenum = ucol_getKeywords(&status);
@ -621,7 +619,7 @@ Collator::getKeywords(UErrorCode& status) {
return new UStringEnumeration(uenum);
}
StringEnumeration*
StringEnumeration* U_EXPORT2
Collator::getKeywordValues(const char *keyword, UErrorCode& status) {
// This is a wrapper over ucol_getKeywordValues
UEnumeration* uenum = ucol_getKeywordValues(keyword, &status);
@ -632,7 +630,7 @@ Collator::getKeywordValues(const char *keyword, UErrorCode& status) {
return new UStringEnumeration(uenum);
}
Locale
Locale U_EXPORT2
Collator::getFunctionalEquivalent(const char* keyword, const Locale& locale,
UBool& isAvailable, UErrorCode& status) {
// This is a wrapper over ucol_getFunctionalEquivalent

View File

@ -195,7 +195,7 @@ public:
*
* @draft ICU 2.2
*/
static UClassID getStaticClassID();
static UClassID U_EXPORT2 getStaticClassID();
private:

View File

@ -99,7 +99,7 @@ class U_I18N_API CurrencyFormat : public MeasureFormat {
/**
* Returns the class ID for this class.
*/
static UClassID getStaticClassID();
static UClassID U_EXPORT2 getStaticClassID();
private:

View File

@ -218,7 +218,7 @@ DateFormat::parseObject(const UnicodeString& source,
//----------------------------------------------------------------------
DateFormat*
DateFormat* U_EXPORT2
DateFormat::createTimeInstance(DateFormat::EStyle style,
const Locale& aLocale)
{
@ -227,36 +227,36 @@ DateFormat::createTimeInstance(DateFormat::EStyle style,
//----------------------------------------------------------------------
DateFormat*
DateFormat* U_EXPORT2
DateFormat::createDateInstance(DateFormat::EStyle style,
const Locale& aLocale)
{
// +4 to set the correct index for getting data out of
// LocaleElements.
if(style != kNone)
{
style = (EStyle) (style + kDateOffset);
}
return create(kNone, (EStyle) (style), aLocale);
// +4 to set the correct index for getting data out of
// LocaleElements.
if(style != kNone)
{
style = (EStyle) (style + kDateOffset);
}
return create(kNone, (EStyle) (style), aLocale);
}
//----------------------------------------------------------------------
DateFormat*
DateFormat* U_EXPORT2
DateFormat::createDateTimeInstance(EStyle dateStyle,
EStyle timeStyle,
const Locale& aLocale)
{
if(dateStyle != kNone)
{
dateStyle = (EStyle) (dateStyle + kDateOffset);
}
return create(timeStyle, dateStyle, aLocale);
if(dateStyle != kNone)
{
dateStyle = (EStyle) (dateStyle + kDateOffset);
}
return create(timeStyle, dateStyle, aLocale);
}
//----------------------------------------------------------------------
DateFormat*
DateFormat* U_EXPORT2
DateFormat::createInstance()
{
return create(kShort, (EStyle) (kShort + kDateOffset), Locale::getDefault());
@ -264,7 +264,7 @@ DateFormat::createInstance()
//----------------------------------------------------------------------
DateFormat*
DateFormat* U_EXPORT2
DateFormat::create(EStyle timeStyle, EStyle dateStyle, const Locale& locale)
{
// Try to create a SimpleDateFormat of the desired style.
@ -288,7 +288,7 @@ DateFormat::create(EStyle timeStyle, EStyle dateStyle, const Locale& locale)
//----------------------------------------------------------------------
const Locale*
const Locale* U_EXPORT2
DateFormat::getAvailableLocales(int32_t& count)
{
// Get the list of installed locales.

View File

@ -485,7 +485,7 @@ DateFormatSymbols::setZoneStrings(const UnicodeString* const *strings, int32_t r
//------------------------------------------------------
const UChar *
const UChar * U_EXPORT2
DateFormatSymbols::getPatternUChars(void)
{
return gPatternChars;

View File

@ -127,7 +127,7 @@ class U_I18N_API EscapeTransliterator : public Transliterator {
*
* @draft ICU 2.2
*/
static UClassID getStaticClassID();
static UClassID U_EXPORT2 getStaticClassID();
protected:

View File

@ -112,7 +112,7 @@ class U_I18N_API FunctionReplacer : public UnicodeFunctor, public UnicodeReplace
*
* @draft ICU 2.2
*/
static UClassID getStaticClassID();
static UClassID U_EXPORT2 getStaticClassID();
};
U_NAMESPACE_END

View File

@ -346,7 +346,7 @@ class U_I18N_API CalendarData : public UObject {
* @return The class ID for all objects of this class.
* @stable ICU 2.0
*/
static UClassID getStaticClassID(void);
static UClassID U_EXPORT2 getStaticClassID(void);
private:
void initData(const char *locale, const char *type, UErrorCode& status);

View File

@ -214,7 +214,7 @@ public:
* @return The class ID for all objects of this class.
* @internal
*/
static UClassID getStaticClassID(void);
static UClassID U_EXPORT2 getStaticClassID(void);
/**
* return the calendar type, "hebrew".

View File

@ -362,7 +362,7 @@ class U_I18N_API IslamicCalendar : public Calendar {
* @return The class ID for all objects of this class.
* @internal
*/
static UClassID getStaticClassID(void);
static UClassID U_EXPORT2 getStaticClassID(void);
/**
* return the calendar type, "buddhist".

View File

@ -28,7 +28,7 @@
U_NAMESPACE_BEGIN
const char JapaneseCalendar::fgClassID = 0; // Value is irrelevant
UOBJECT_DEFINE_RTTI_IMPLEMENTATION(JapaneseCalendar)
// Gregorian date of each emperor's ascension
// Years are AD, months are 1-based.

View File

@ -130,7 +130,7 @@ public:
* @return The class ID for all objects of this class.
* @internal
*/
static inline UClassID getStaticClassID(void);
static UClassID U_EXPORT2 getStaticClassID(void);
/**
* return the calendar type, "japanese".
@ -160,8 +160,6 @@ public:
private:
JapaneseCalendar(); // default constructor not implemented
static const char fgClassID;
protected:
/**
* Calculate the era for internal computation
@ -198,15 +196,6 @@ protected:
virtual int32_t getDefaultDayInMonth(int32_t month);
};
inline UClassID
JapaneseCalendar::getStaticClassID(void)
{ return (UClassID)&fgClassID; }
inline UClassID
JapaneseCalendar::getDynamicClassID(void) const
{ return JapaneseCalendar::getStaticClassID(); }
U_NAMESPACE_END
#endif /* #if !UCONFIG_NO_FORMATTING */

View File

@ -19,7 +19,7 @@ U_NAMESPACE_BEGIN
MeasureFormat::MeasureFormat() {}
MeasureFormat* MeasureFormat::createCurrencyFormat(const Locale& locale,
MeasureFormat* U_EXPORT2 MeasureFormat::createCurrencyFormat(const Locale& locale,
UErrorCode& ec) {
CurrencyFormat* fmt = NULL;
if (U_SUCCESS(ec)) {
@ -32,7 +32,7 @@ MeasureFormat* MeasureFormat::createCurrencyFormat(const Locale& locale,
return fmt;
}
MeasureFormat* MeasureFormat::createCurrencyFormat(UErrorCode& ec) {
MeasureFormat* U_EXPORT2 MeasureFormat::createCurrencyFormat(UErrorCode& ec) {
if (U_FAILURE(ec)) {
return NULL;
}

View File

@ -65,7 +65,7 @@ public:
*
* @draft ICU 2.2
*/
static UClassID getStaticClassID();
static UClassID U_EXPORT2 getStaticClassID();
protected:

View File

@ -70,7 +70,7 @@ class U_I18N_API NormalizationTransliterator : public Transliterator {
*
* @draft ICU 2.2
*/
static UClassID getStaticClassID();
static UClassID U_EXPORT2 getStaticClassID();
protected:

View File

@ -76,7 +76,7 @@ public:
*
* @draft ICU 2.2
*/
static UClassID getStaticClassID();
static UClassID U_EXPORT2 getStaticClassID();
};

View File

@ -372,7 +372,7 @@ NumberFormat::setParseIntegerOnly(UBool value)
// -------------------------------------
// Create a number style NumberFormat instance with the default locale.
NumberFormat*
NumberFormat* U_EXPORT2
NumberFormat::createInstance(UErrorCode& status)
{
return createInstance(Locale::getDefault(), kNumberStyle, status);
@ -381,7 +381,7 @@ NumberFormat::createInstance(UErrorCode& status)
// -------------------------------------
// Create a number style NumberFormat instance with the inLocale locale.
NumberFormat*
NumberFormat* U_EXPORT2
NumberFormat::createInstance(const Locale& inLocale, UErrorCode& status)
{
return createInstance(inLocale, kNumberStyle, status);
@ -390,7 +390,7 @@ NumberFormat::createInstance(const Locale& inLocale, UErrorCode& status)
// -------------------------------------
// Create a currency style NumberFormat instance with the default locale.
NumberFormat*
NumberFormat* U_EXPORT2
NumberFormat::createCurrencyInstance(UErrorCode& status)
{
return createCurrencyInstance(Locale::getDefault(), status);
@ -399,7 +399,7 @@ NumberFormat::createCurrencyInstance(UErrorCode& status)
// -------------------------------------
// Create a currency style NumberFormat instance with the inLocale locale.
NumberFormat*
NumberFormat* U_EXPORT2
NumberFormat::createCurrencyInstance(const Locale& inLocale, UErrorCode& status)
{
return createInstance(inLocale, kCurrencyStyle, status);
@ -408,7 +408,7 @@ NumberFormat::createCurrencyInstance(const Locale& inLocale, UErrorCode& status)
// -------------------------------------
// Create a percent style NumberFormat instance with the default locale.
NumberFormat*
NumberFormat* U_EXPORT2
NumberFormat::createPercentInstance(UErrorCode& status)
{
return createInstance(Locale::getDefault(), kPercentStyle, status);
@ -417,7 +417,7 @@ NumberFormat::createPercentInstance(UErrorCode& status)
// -------------------------------------
// Create a percent style NumberFormat instance with the inLocale locale.
NumberFormat*
NumberFormat* U_EXPORT2
NumberFormat::createPercentInstance(const Locale& inLocale, UErrorCode& status)
{
return createInstance(inLocale, kPercentStyle, status);
@ -426,7 +426,7 @@ NumberFormat::createPercentInstance(const Locale& inLocale, UErrorCode& status)
// -------------------------------------
// Create a scientific style NumberFormat instance with the default locale.
NumberFormat*
NumberFormat* U_EXPORT2
NumberFormat::createScientificInstance(UErrorCode& status)
{
return createInstance(Locale::getDefault(), kScientificStyle, status);
@ -435,7 +435,7 @@ NumberFormat::createScientificInstance(UErrorCode& status)
// -------------------------------------
// Create a scientific style NumberFormat instance with the inLocale locale.
NumberFormat*
NumberFormat* U_EXPORT2
NumberFormat::createScientificInstance(const Locale& inLocale, UErrorCode& status)
{
return createInstance(inLocale, kScientificStyle, status);
@ -443,7 +443,7 @@ NumberFormat::createScientificInstance(const Locale& inLocale, UErrorCode& statu
// -------------------------------------
const Locale*
const Locale* U_EXPORT2
NumberFormat::getAvailableLocales(int32_t& count)
{
return Locale::getAvailableLocales(count);
@ -462,99 +462,99 @@ static ICULocaleService* gService = NULL;
class ICUNumberFormatFactory : public ICUResourceBundleFactory {
protected:
virtual UObject* handleCreate(const Locale& loc, int32_t kind, const ICUService* /* service */, UErrorCode& status) const {
// !!! kind is not an EStyles, need to determine how to handle this
return NumberFormat::makeInstance(loc, (NumberFormat::EStyles)kind, status);
}
virtual UObject* handleCreate(const Locale& loc, int32_t kind, const ICUService* /* service */, UErrorCode& status) const {
// !!! kind is not an EStyles, need to determine how to handle this
return NumberFormat::makeInstance(loc, (NumberFormat::EStyles)kind, status);
}
};
// -------------------------------------
class NFFactory : public LocaleKeyFactory {
private:
NumberFormatFactory* _delegate;
Hashtable* _ids;
NumberFormatFactory* _delegate;
Hashtable* _ids;
public:
NFFactory(NumberFormatFactory* delegate)
: LocaleKeyFactory(delegate->visible() ? VISIBLE : INVISIBLE)
, _delegate(delegate)
, _ids(NULL)
{
}
virtual ~NFFactory()
{
delete _delegate;
delete _ids;
}
virtual UObject* create(const ICUServiceKey& key, const ICUService* service, UErrorCode& status) const
{
if (handlesKey(key, status)) {
const LocaleKey& lkey = (const LocaleKey&)key;
Locale loc;
lkey.canonicalLocale(loc);
int32_t kind = lkey.kind();
UObject* result = _delegate->createFormat(loc, (UNumberFormatStyle)(kind+1));
if (result == NULL) {
result = service->getKey((ICUServiceKey&)key /* cast away const */, NULL, this, status);
}
return result;
NFFactory(NumberFormatFactory* delegate)
: LocaleKeyFactory(delegate->visible() ? VISIBLE : INVISIBLE)
, _delegate(delegate)
, _ids(NULL)
{
}
virtual ~NFFactory()
{
delete _delegate;
delete _ids;
}
virtual UObject* create(const ICUServiceKey& key, const ICUService* service, UErrorCode& status) const
{
if (handlesKey(key, status)) {
const LocaleKey& lkey = (const LocaleKey&)key;
Locale loc;
lkey.canonicalLocale(loc);
int32_t kind = lkey.kind();
UObject* result = _delegate->createFormat(loc, (UNumberFormatStyle)(kind+1));
if (result == NULL) {
result = service->getKey((ICUServiceKey&)key /* cast away const */, NULL, this, status);
}
return result;
}
return NULL;
}
return NULL;
}
protected:
/**
* Return the set of ids that this factory supports (visible or
* otherwise). This can be called often and might need to be
* cached if it is expensive to create.
*/
virtual const Hashtable* getSupportedIDs(UErrorCode& status) const
{
if (U_SUCCESS(status)) {
if (!_ids) {
int32_t count = 0;
const UnicodeString * const idlist = _delegate->getSupportedIDs(count, status);
((NFFactory*)this)->_ids = new Hashtable(status); /* cast away const */
if (_ids) {
for (int i = 0; i < count; ++i) {
_ids->put(idlist[i], (void*)this, status);
}
/**
* Return the set of ids that this factory supports (visible or
* otherwise). This can be called often and might need to be
* cached if it is expensive to create.
*/
virtual const Hashtable* getSupportedIDs(UErrorCode& status) const
{
if (U_SUCCESS(status)) {
if (!_ids) {
int32_t count = 0;
const UnicodeString * const idlist = _delegate->getSupportedIDs(count, status);
((NFFactory*)this)->_ids = new Hashtable(status); /* cast away const */
if (_ids) {
for (int i = 0; i < count; ++i) {
_ids->put(idlist[i], (void*)this, status);
}
}
}
return _ids;
}
}
return _ids;
return NULL;
}
return NULL;
}
};
class ICUNumberFormatService : public ICULocaleService {
public:
ICUNumberFormatService()
: ICULocaleService("Number Format")
{
UErrorCode status = U_ZERO_ERROR;
registerFactory(new ICUNumberFormatFactory(), status);
}
ICUNumberFormatService()
: ICULocaleService("Number Format")
{
UErrorCode status = U_ZERO_ERROR;
registerFactory(new ICUNumberFormatFactory(), status);
}
virtual UObject* cloneInstance(UObject* instance) const {
return ((NumberFormat*)instance)->clone();
}
virtual UObject* cloneInstance(UObject* instance) const {
return ((NumberFormat*)instance)->clone();
}
virtual UObject* handleDefault(const ICUServiceKey& key, UnicodeString* /* actualID */, UErrorCode& status) const {
LocaleKey& lkey = (LocaleKey&)key;
int32_t kind = lkey.kind();
Locale loc;
lkey.currentLocale(loc);
return NumberFormat::makeInstance(loc, (NumberFormat::EStyles)kind, status);
}
virtual UObject* handleDefault(const ICUServiceKey& key, UnicodeString* /* actualID */, UErrorCode& status) const {
LocaleKey& lkey = (LocaleKey&)key;
int32_t kind = lkey.kind();
Locale loc;
lkey.currentLocale(loc);
return NumberFormat::makeInstance(loc, (NumberFormat::EStyles)kind, status);
}
virtual UBool isDefault() const {
return countFactories() == 1;
}
virtual UBool isDefault() const {
return countFactories() == 1;
}
};
// -------------------------------------
@ -588,7 +588,7 @@ getNumberFormatService(void)
// -------------------------------------
URegistryKey
URegistryKey U_EXPORT2
NumberFormat::registerFactory(NumberFormatFactory* toAdopt, UErrorCode& status)
{
ICULocaleService *service = getNumberFormatService();
@ -601,7 +601,7 @@ NumberFormat::registerFactory(NumberFormatFactory* toAdopt, UErrorCode& status)
// -------------------------------------
UBool
UBool U_EXPORT2
NumberFormat::unregister(URegistryKey key, UErrorCode& status)
{
if (U_SUCCESS(status)) {
@ -617,7 +617,7 @@ NumberFormat::unregister(URegistryKey key, UErrorCode& status)
}
// -------------------------------------
StringEnumeration*
StringEnumeration* U_EXPORT2
NumberFormat::getAvailableLocales(void)
{
ICULocaleService *service = getNumberFormatService();
@ -629,7 +629,7 @@ NumberFormat::getAvailableLocales(void)
#endif /* UCONFIG_NO_SERVICE */
// -------------------------------------
NumberFormat*
NumberFormat* U_EXPORT2
NumberFormat::createInstance(const Locale& loc, EStyles kind, UErrorCode& status)
{
#if !UCONFIG_NO_SERVICE

View File

@ -153,7 +153,7 @@ class U_I18N_API OlsonTimeZone: public TimeZone {
/**
* TimeZone API.
*/
static UClassID getStaticClassID();
static UClassID U_EXPORT2 getStaticClassID();
/**
* TimeZone API.

View File

@ -108,7 +108,7 @@ class Quantifier : public UnicodeFunctor, public UnicodeMatcher {
*
* @draft ICU 2.2
*/
static UClassID getStaticClassID();
static UClassID U_EXPORT2 getStaticClassID();
private:

View File

@ -443,7 +443,7 @@ public:
* @return The class ID for all objects of this class.
* @internal Use transliterator factory methods instead since this class will be removed in that release.
*/
static UClassID getStaticClassID(void);
static UClassID U_EXPORT2 getStaticClassID(void);
/**
* Returns a unique class ID <b>polymorphically</b>. This method
@ -451,18 +451,6 @@ public:
* compilers support genuine RTTI. Polymorphic operator==() and
* clone() methods call this method.
*
* <p>Concrete subclasses of Transliterator that wish clients to
* be able to identify them should implement getDynamicClassID()
* and also a static method and data member:
*
* <pre>
* static UClassID getStaticClassID() { return (UClassID)&fgClassID; }
* static char fgClassID;
* </pre>
*
* Subclasses that do not implement this method will have a
* dynamic class ID of Transliterator::getStatisClassID().
*
* @return The class ID for this object. All objects of a given
* class have the same class ID. Objects of other classes have
* different class IDs.

View File

@ -71,7 +71,7 @@ public:
*
* @draft ICU 2.2
*/
static UClassID getStaticClassID();
static UClassID U_EXPORT2 getStaticClassID();
private:

View File

@ -232,11 +232,12 @@ UBool RegexPattern::operator ==(const RegexPattern &other) const {
// compile
//
//---------------------------------------------------------------------
RegexPattern *RegexPattern::compile(
const UnicodeString &regex,
uint32_t flags,
UParseError &pe,
UErrorCode &status) {
RegexPattern * U_EXPORT2
RegexPattern::compile(const UnicodeString &regex,
uint32_t flags,
UParseError &pe,
UErrorCode &status)
{
if (U_FAILURE(status)) {
return NULL;
@ -275,9 +276,10 @@ RegexPattern *RegexPattern::compile(
//
// compile with default flags.
//
RegexPattern *RegexPattern::compile( const UnicodeString &regex,
UParseError &pe,
UErrorCode &err)
RegexPattern * U_EXPORT2
RegexPattern::compile(const UnicodeString &regex,
UParseError &pe,
UErrorCode &err)
{
return compile(regex, 0, pe, err);
}
@ -287,7 +289,8 @@ RegexPattern *RegexPattern::compile( const UnicodeString &regex,
//
// compile with no UParseErr parameter.
//
RegexPattern *RegexPattern::compile( const UnicodeString &regex,
RegexPattern * U_EXPORT2
RegexPattern::compile( const UnicodeString &regex,
uint32_t flags,
UErrorCode &err)
{
@ -355,7 +358,7 @@ RegexMatcher *RegexPattern::matcher(UErrorCode &status) const {
// with a pattern string and a data string.
//
//---------------------------------------------------------------------
UBool RegexPattern::matches(const UnicodeString &regex,
UBool U_EXPORT2 RegexPattern::matches(const UnicodeString &regex,
const UnicodeString &input,
UParseError &pe,
UErrorCode &status) {

View File

@ -205,7 +205,7 @@ class StringMatcher : public UnicodeFunctor, public UnicodeMatcher, public Unico
*
* @draft ICU 2.2
*/
static UClassID getStaticClassID();
static UClassID U_EXPORT2 getStaticClassID();
/**
* Union the set of all characters that may output by this object

View File

@ -146,7 +146,7 @@ class StringReplacer : public UnicodeFunctor, public UnicodeReplacer {
*
* @draft ICU 2.2
*/
static UClassID getStaticClassID();
static UClassID U_EXPORT2 getStaticClassID();
/**
* ICU "poor man's RTTI", returns a UClassID for the actual class.

View File

@ -354,7 +354,7 @@ static UBool loadOlsonIDs() {
// -------------------------------------
const TimeZone*
const TimeZone* U_EXPORT2
TimeZone::getGMT(void)
{
umtx_init(&LOCK); /* This is here to prevent race conditions. */
@ -419,7 +419,7 @@ TimeZone::operator==(const TimeZone& that) const
// -------------------------------------
TimeZone*
TimeZone* U_EXPORT2
TimeZone::createTimeZone(const UnicodeString& ID)
{
/* We first try to lookup the zone ID in our system list. If this
@ -585,7 +585,7 @@ TimeZone::initDefault()
// -------------------------------------
TimeZone*
TimeZone* U_EXPORT2
TimeZone::createDefault()
{
umtx_init(&LOCK); /* This is here to prevent race conditions. */
@ -602,7 +602,7 @@ TimeZone::createDefault()
// -------------------------------------
void
void U_EXPORT2
TimeZone::adoptDefault(TimeZone* zone)
{
if (zone != NULL)
@ -621,7 +621,7 @@ TimeZone::adoptDefault(TimeZone* zone)
}
// -------------------------------------
void
void U_EXPORT2
TimeZone::setDefault(const TimeZone& zone)
{
adoptDefault(zone.clone());
@ -824,26 +824,24 @@ private:
return U_SUCCESS(ec);
}
static const char fgClassID;
public:
static inline UClassID getStaticClassID(void) { return (UClassID)&fgClassID; }
virtual UClassID getDynamicClassID(void) const { return getStaticClassID(); }
static UClassID U_EXPORT2 getStaticClassID(void);
virtual UClassID getDynamicClassID(void) const;
};
const char TZEnumeration::fgClassID = '\0';
UOBJECT_DEFINE_RTTI_IMPLEMENTATION(TZEnumeration)
StringEnumeration*
StringEnumeration* U_EXPORT2
TimeZone::createEnumeration() {
return new TZEnumeration();
}
StringEnumeration*
StringEnumeration* U_EXPORT2
TimeZone::createEnumeration(int32_t rawOffset) {
return new TZEnumeration(rawOffset);
}
StringEnumeration*
StringEnumeration* U_EXPORT2
TimeZone::createEnumeration(const char* country) {
return new TZEnumeration(country);
}
@ -976,7 +974,7 @@ TimeZone::createAvailableIDs(int32_t& numIDs)
// ---------------------------------------
int32_t
int32_t U_EXPORT2
TimeZone::countEquivalentIDs(const UnicodeString& id) {
int32_t result = 0;
UErrorCode ec = U_ZERO_ERROR;
@ -1006,7 +1004,7 @@ TimeZone::countEquivalentIDs(const UnicodeString& id) {
// ---------------------------------------
const UnicodeString
const UnicodeString U_EXPORT2
TimeZone::getEquivalentID(const UnicodeString& id, int32_t index) {
U_DEBUG_TZ_MSG(("gEI(%d)\n", index));
UnicodeString result;

View File

@ -68,7 +68,7 @@ class U_I18N_API TitlecaseTransliterator : public Transliterator {
*
* @draft ICU 2.2
*/
static UClassID getStaticClassID();
static UClassID U_EXPORT2 getStaticClassID();
protected:

View File

@ -67,7 +67,7 @@ class U_I18N_API LowercaseTransliterator : public Transliterator {
*
* @draft ICU 2.2
*/
static UClassID getStaticClassID();
static UClassID U_EXPORT2 getStaticClassID();
protected:

View File

@ -67,7 +67,7 @@ class U_I18N_API UppercaseTransliterator : public Transliterator {
*
* @draft ICU 2.2
*/
static UClassID getStaticClassID();
static UClassID U_EXPORT2 getStaticClassID();
protected:

View File

@ -697,7 +697,7 @@ const UnicodeString& Transliterator::getID(void) const {
* display to the user in the default locale. See {@link
* #getDisplayName(Locale)} for details.
*/
UnicodeString& Transliterator::getDisplayName(const UnicodeString& ID,
UnicodeString& U_EXPORT2 Transliterator::getDisplayName(const UnicodeString& ID,
UnicodeString& result) {
return getDisplayName(ID, Locale::getDefault(), result);
}
@ -720,7 +720,7 @@ UnicodeString& Transliterator::getDisplayName(const UnicodeString& ID,
* localized.
* @see java.text.MessageFormat
*/
UnicodeString& Transliterator::getDisplayName(const UnicodeString& id,
UnicodeString& U_EXPORT2 Transliterator::getDisplayName(const UnicodeString& id,
const Locale& inLocale,
UnicodeString& result) {
UErrorCode status = U_ZERO_ERROR;
@ -872,9 +872,11 @@ Transliterator* Transliterator::createInverse(UErrorCode& status) const {
return Transliterator::createInstance(ID, UTRANS_REVERSE,parseError,status);
}
Transliterator* Transliterator::createInstance(const UnicodeString& ID,
UTransDirection dir,
UErrorCode& status) {
Transliterator* U_EXPORT2
Transliterator::createInstance(const UnicodeString& ID,
UTransDirection dir,
UErrorCode& status)
{
UParseError parseError;
return createInstance(ID, dir, parseError, status);
}
@ -890,10 +892,12 @@ Transliterator* Transliterator::createInstance(const UnicodeString& ID,
* @see #getAvailableIDs
* @see #getID
*/
Transliterator* Transliterator::createInstance(const UnicodeString& ID,
UTransDirection dir,
UParseError& parseError,
UErrorCode& status) {
Transliterator* U_EXPORT2
Transliterator::createInstance(const UnicodeString& ID,
UTransDirection dir,
UParseError& parseError,
UErrorCode& status)
{
if (U_FAILURE(status)) {
return 0;
}
@ -1027,11 +1031,13 @@ Transliterator* Transliterator::createBasicInstance(const UnicodeString& id,
* NullTransliterator, if it contains ID blocks which parse as
* empty for the given direction.
*/
Transliterator* Transliterator::createFromRules(const UnicodeString& ID,
const UnicodeString& rules,
UTransDirection dir,
UParseError& parseError,
UErrorCode& status) {
Transliterator* U_EXPORT2
Transliterator::createFromRules(const UnicodeString& ID,
const UnicodeString& rules,
UTransDirection dir,
UParseError& parseError,
UErrorCode& status)
{
Transliterator* t = NULL;
TransliteratorParser parser;
@ -1174,7 +1180,7 @@ UnicodeSet& Transliterator::getTargetSet(UnicodeSet& result) const {
}
// For public consumption
void Transliterator::registerFactory(const UnicodeString& id,
void U_EXPORT2 Transliterator::registerFactory(const UnicodeString& id,
Transliterator::Factory factory,
Transliterator::Token context) {
umtx_init(&registryMutex);
@ -1213,7 +1219,7 @@ void Transliterator::_registerSpecialInverse(const UnicodeString& target,
* @see #getInstance
* @see #unregister
*/
void Transliterator::registerInstance(Transliterator* adoptedPrototype) {
void U_EXPORT2 Transliterator::registerInstance(Transliterator* adoptedPrototype) {
umtx_init(&registryMutex);
Mutex lock(&registryMutex);
if (HAVE_REGISTRY) {
@ -1233,7 +1239,7 @@ void Transliterator::_registerInstance(Transliterator* adoptedPrototype) {
* @see #registerInstance
*/
void Transliterator::unregister(const UnicodeString& ID) {
void U_EXPORT2 Transliterator::unregister(const UnicodeString& ID) {
umtx_init(&registryMutex);
Mutex lock(&registryMutex);
if (HAVE_REGISTRY) {
@ -1247,7 +1253,7 @@ void Transliterator::unregister(const UnicodeString& ID) {
* To retrieve the actual IDs, call getAvailableID(i) with
* i from 0 to countAvailableIDs() - 1.
*/
int32_t Transliterator::countAvailableIDs(void) {
int32_t U_EXPORT2 Transliterator::countAvailableIDs(void) {
umtx_init(&registryMutex);
Mutex lock(&registryMutex);
return HAVE_REGISTRY ? registry->countAvailableIDs() : 0;
@ -1259,7 +1265,7 @@ int32_t Transliterator::countAvailableIDs(void) {
* and countAvailableIDs() - 1, inclusive. If index is out of
* range, the result of getAvailableID(0) is returned.
*/
const UnicodeString& Transliterator::getAvailableID(int32_t index) {
const UnicodeString& U_EXPORT2 Transliterator::getAvailableID(int32_t index) {
const UnicodeString* result = NULL;
umtx_init(&registryMutex);
umtx_lock(&registryMutex);
@ -1271,7 +1277,7 @@ const UnicodeString& Transliterator::getAvailableID(int32_t index) {
return *result;
}
StringEnumeration* Transliterator::getAvailableIDs(UErrorCode& ec) {
StringEnumeration* U_EXPORT2 Transliterator::getAvailableIDs(UErrorCode& ec) {
if (U_FAILURE(ec)) return NULL;
StringEnumeration* result = NULL;
umtx_init(&registryMutex);
@ -1286,13 +1292,13 @@ StringEnumeration* Transliterator::getAvailableIDs(UErrorCode& ec) {
return result;
}
int32_t Transliterator::countAvailableSources(void) {
int32_t U_EXPORT2 Transliterator::countAvailableSources(void) {
umtx_init(&registryMutex);
Mutex lock(&registryMutex);
return HAVE_REGISTRY ? _countAvailableSources() : 0;
}
UnicodeString& Transliterator::getAvailableSource(int32_t index,
UnicodeString& U_EXPORT2 Transliterator::getAvailableSource(int32_t index,
UnicodeString& result) {
umtx_init(&registryMutex);
Mutex lock(&registryMutex);
@ -1302,13 +1308,13 @@ UnicodeString& Transliterator::getAvailableSource(int32_t index,
return result;
}
int32_t Transliterator::countAvailableTargets(const UnicodeString& source) {
int32_t U_EXPORT2 Transliterator::countAvailableTargets(const UnicodeString& source) {
umtx_init(&registryMutex);
Mutex lock(&registryMutex);
return HAVE_REGISTRY ? _countAvailableTargets(source) : 0;
}
UnicodeString& Transliterator::getAvailableTarget(int32_t index,
UnicodeString& U_EXPORT2 Transliterator::getAvailableTarget(int32_t index,
const UnicodeString& source,
UnicodeString& result) {
umtx_init(&registryMutex);
@ -1319,14 +1325,14 @@ UnicodeString& Transliterator::getAvailableTarget(int32_t index,
return result;
}
int32_t Transliterator::countAvailableVariants(const UnicodeString& source,
int32_t U_EXPORT2 Transliterator::countAvailableVariants(const UnicodeString& source,
const UnicodeString& target) {
umtx_init(&registryMutex);
Mutex lock(&registryMutex);
return HAVE_REGISTRY ? _countAvailableVariants(source, target) : 0;
}
UnicodeString& Transliterator::getAvailableVariant(int32_t index,
UnicodeString& U_EXPORT2 Transliterator::getAvailableVariant(int32_t index,
const UnicodeString& source,
const UnicodeString& target,
UnicodeString& result) {

View File

@ -45,7 +45,7 @@ class TransliteratorAlias : public UMemory {
* @param aliasID the given id.
*/
TransliteratorAlias(const UnicodeString& aliasID);
/**
* Construct a compound RBT alias (type == COMPOUND)
*/
@ -61,7 +61,7 @@ class TransliteratorAlias : public UMemory {
UTransDirection dir);
~TransliteratorAlias();
/**
* The whole point of create() is that the caller must invoke
* it when the registry mutex is NOT held, to prevent deadlock.
@ -93,7 +93,7 @@ class TransliteratorAlias : public UMemory {
*/
void parse(TransliteratorParser& parser,
UParseError& pe, UErrorCode& ec) const;
private:
// We actually come in three flavors:
// 1. Simple alias
@ -168,7 +168,7 @@ class TransliteratorRegistry : public UMemory {
* @param ID the given ID
* @param aliasReturn output param to receive TransliteratorAlias;
* should be NULL on entry
* @param parseError Struct to recieve information on position
* @param parseError Struct to recieve information on position
* of error if an error is encountered
* @param status Output param set to success/failure code.
*/
@ -282,7 +282,7 @@ class TransliteratorRegistry : public UMemory {
* @return the number of registered source specifiers.
*/
int32_t countAvailableSources(void) const;
/**
* Return a registered source specifier.
* @param index which specifier to return, from 0 to n-1, where
@ -293,7 +293,7 @@ class TransliteratorRegistry : public UMemory {
*/
UnicodeString& getAvailableSource(int32_t index,
UnicodeString& result) const;
/**
* Return the number of registered target specifiers for a given
* source specifier.
@ -302,7 +302,7 @@ class TransliteratorRegistry : public UMemory {
* source specifier.
*/
int32_t countAvailableTargets(const UnicodeString& source) const;
/**
* Return a registered target specifier for a given source.
* @param index which specifier to return, from 0 to n-1, where
@ -316,7 +316,7 @@ class TransliteratorRegistry : public UMemory {
UnicodeString& getAvailableTarget(int32_t index,
const UnicodeString& source,
UnicodeString& result) const;
/**
* Return the number of registered variant specifiers for a given
* source-target pair. There is always at least one variant: If
@ -330,7 +330,7 @@ class TransliteratorRegistry : public UMemory {
*/
int32_t countAvailableVariants(const UnicodeString& source,
const UnicodeString& target) const;
/**
* Return a registered variant specifier for a given source-target
* pair. If NO_VARIANT is one of the variants, then it will be
@ -356,7 +356,7 @@ class TransliteratorRegistry : public UMemory {
//----------------------------------------------------------------
Entry* find(const UnicodeString& ID);
Entry* find(UnicodeString& source,
UnicodeString& target,
UnicodeString& variant);
@ -415,7 +415,7 @@ class TransliteratorRegistry : public UMemory {
virtual int32_t count(UErrorCode& status) const;
virtual const UnicodeString* snext(UErrorCode& status);
virtual void reset(UErrorCode& status);
static UClassID getStaticClassID();
static UClassID U_EXPORT2 getStaticClassID();
virtual UClassID getDynamicClassID() const;
private:
int32_t index;
@ -432,7 +432,7 @@ class TransliteratorRegistry : public UMemory {
* specDAG or not.
*/
Hashtable registry;
/**
* DAG of visible IDs by spec. Hashtable: source => (Hashtable:
* target => (UVector: variant)) The UVector of variants is never
@ -441,7 +441,7 @@ class TransliteratorRegistry : public UMemory {
* the UVector.
*/
Hashtable specDAG;
/**
* Vector of public full IDs.
*/

View File

@ -89,7 +89,7 @@ class U_I18N_API UnescapeTransliterator : public Transliterator {
*
* @draft ICU 2.2
*/
static UClassID getStaticClassID();
static UClassID U_EXPORT2 getStaticClassID();
protected:

View File

@ -65,7 +65,7 @@ class U_I18N_API UnicodeNameTransliterator : public Transliterator {
*
* @draft ICU 2.2
*/
static UClassID getStaticClassID();
static UClassID U_EXPORT2 getStaticClassID();
protected:

View File

@ -58,19 +58,19 @@ typedef int32_t UFieldResolutionTable[12][8];
*
* <p>
* Subclasses of <code>Calendar</code> interpret a <code>UDate</code>
* according to the rules of a specific calendar system.
* according to the rules of a specific calendar system.
* The most commonly used subclass of <code>Calendar</code> is
* <code>GregorianCalendar</code>. Other subclasses could represent
* the various types of lunar calendars in use in many parts of the world.
*
*
* <p>
* <b>NOTE</b>: (ICU 2.6) The subclass interface should be considered unstable
* - it WILL change.
* - it WILL change.
*
* <p>
* Like other locale-sensitive classes, <code>Calendar</code> provides a
* static method, <code>createInstance</code>, for getting a generally useful
* object of this type. <code>Calendar</code>'s <code>createInstance</code> method
* object of this type. <code>Calendar</code>'s <code>createInstance</code> method
* returns the appropriate <code>Calendar</code> subclass whose
* time fields have been initialized with the current date and time:
* \htmlonly<blockquote>\endhtmlonly
@ -189,7 +189,7 @@ public:
MILLISECOND, // Example: 0..999
ZONE_OFFSET, // Example: -12*U_MILLIS_PER_HOUR..12*U_MILLIS_PER_HOUR
DST_OFFSET, // Example: 0 or U_MILLIS_PER_HOUR
YEAR_WOY, // 'Y' Example: 1..big number - Year of Week of Year
YEAR_WOY, // 'Y' Example: 1..big number - Year of Week of Year
DOW_LOCAL, // 'e' Example: 1..7 - Day of Week / Localized
FIELD_COUNT = UCAL_FIELD_COUNT // See ucal.h for other fields.
@ -265,7 +265,7 @@ public:
* @return A Calendar if created successfully. NULL otherwise.
* @stable ICU 2.0
*/
static Calendar* createInstance(UErrorCode& success);
static Calendar* U_EXPORT2 createInstance(UErrorCode& success);
/**
* Creates a Calendar using the given timezone and the default locale.
@ -279,7 +279,7 @@ public:
* @return A Calendar if created successfully. NULL otherwise.
* @stable ICU 2.0
*/
static Calendar* createInstance(TimeZone* zoneToAdopt, UErrorCode& success);
static Calendar* U_EXPORT2 createInstance(TimeZone* zoneToAdopt, UErrorCode& success);
/**
* Creates a Calendar using the given timezone and the default locale. The TimeZone
@ -292,7 +292,7 @@ public:
* @return A Calendar if created successfully. NULL otherwise.
* @stable ICU 2.0
*/
static Calendar* createInstance(const TimeZone& zone, UErrorCode& success);
static Calendar* U_EXPORT2 createInstance(const TimeZone& zone, UErrorCode& success);
/**
* Creates a Calendar using the default timezone and the given locale.
@ -304,7 +304,7 @@ public:
* @return A Calendar if created successfully. NULL otherwise.
* @stable ICU 2.0
*/
static Calendar* createInstance(const Locale& aLocale, UErrorCode& success);
static Calendar* U_EXPORT2 createInstance(const Locale& aLocale, UErrorCode& success);
/**
* Creates a Calendar using the given timezone and given locale.
@ -319,7 +319,7 @@ public:
* @return A Calendar if created successfully. NULL otherwise.
* @stable ICU 2.0
*/
static Calendar* createInstance(TimeZone* zoneToAdopt, const Locale& aLocale, UErrorCode& success);
static Calendar* U_EXPORT2 createInstance(TimeZone* zoneToAdopt, const Locale& aLocale, UErrorCode& success);
/**
* Gets a Calendar using the given timezone and given locale. The TimeZone
@ -333,7 +333,7 @@ public:
* @return A Calendar if created successfully. NULL otherwise.
* @stable ICU 2.0
*/
static Calendar* createInstance(const TimeZone& zoneToAdopt, const Locale& aLocale, UErrorCode& success);
static Calendar* U_EXPORT2 createInstance(const TimeZone& zoneToAdopt, const Locale& aLocale, UErrorCode& success);
/**
* Returns a list of the locales for which Calendars are installed.
@ -344,16 +344,16 @@ public:
* the caller must NOT delete it. Does not include user-registered Calendars.
* @stable ICU 2.0
*/
static const Locale* getAvailableLocales(int32_t& count);
static const Locale* U_EXPORT2 getAvailableLocales(int32_t& count);
/**
* Returns the current UTC (GMT) time measured in milliseconds since 0:00:00 on 1/1/70
* Returns the current UTC (GMT) time measured in milliseconds since 0:00:00 on 1/1/70
* (derived from the system time).
*
* @return The current UTC time in milliseconds.
* @stable ICU 2.0
*/
static UDate getNow(void);
static UDate U_EXPORT2 getNow(void);
/**
* Gets this Calendar's time as milliseconds. May involve recalculation of time due
@ -412,7 +412,7 @@ public:
* the operator==() method to return TRUE, the other Calendar must
* be set to the same time.
*
* @param other the Calendar to be compared with this Calendar
* @param other the Calendar to be compared with this Calendar
* @stable ICU 2.4
*/
virtual UBool isEquivalentTo(const Calendar& other) const;
@ -1144,7 +1144,7 @@ public:
/**
* Returns the resource key string used for this calendar type.
* For example, prepending "Eras_" to this string could return "Eras_japanese"
* or "Eras_gregorian".
* or "Eras_gregorian".
*
* @returns static string, for example, "gregorian" or "japanese"
* @internal
@ -1318,19 +1318,19 @@ protected:
* @internal
*/
virtual void prepareGetActual(UCalendarDateFields field, UBool isMinimum, UErrorCode &status);
/**
* Limit enums. Not in sync with UCalendarLimitType (refers to internal fields).
* @internal
* @internal
*/
enum ELimitType {
UCAL_LIMIT_MINIMUM = 0,
UCAL_LIMIT_GREATEST_MINIMUM,
UCAL_LIMIT_LEAST_MAXIMUM,
UCAL_LIMIT_MAXIMUM,
enum ELimitType {
UCAL_LIMIT_MINIMUM = 0,
UCAL_LIMIT_GREATEST_MINIMUM,
UCAL_LIMIT_LEAST_MAXIMUM,
UCAL_LIMIT_MAXIMUM,
UCAL_LIMIT_COUNT
};
/**
* Subclass API for defining limits of different types.
* Subclasses must implement this method to return limits for the
@ -1413,14 +1413,14 @@ protected:
* Subclasses may override this. This method calls
* handleGetMonthLength() to obtain the calendar-specific month
* length.
* @param bestField which field to use to calculate the date
* @param bestField which field to use to calculate the date
* @return julian day specified by calendar fields.
* @internal
*/
virtual int32_t handleComputeJulianDay(UCalendarDateFields bestField);
/**
* Subclasses must override this to convert from week fields
/**
* Subclasses must override this to convert from week fields
* (YEAR_WOY and WEEK_OF_YEAR) to an extended year in the case
* where YEAR, EXTENDED_YEAR are not set.
* The Calendar implementation assumes yearWoy is in extended gregorian form
@ -1436,7 +1436,7 @@ protected:
* @internal
*/
int32_t computeJulianDay();
/**
* Compute the milliseconds in the day from the fields. This is a
* value from 0 to 23:59:59.999 inclusive, unless fields are out of
@ -1543,8 +1543,8 @@ protected:
*/
UCalendarDateFields newerField(UCalendarDateFields defaultField, UCalendarDateFields alternateField) const;
private:
private:
/**
* Helper function for calculating limits by trial and error
* @param field The field being investigated
@ -1905,8 +1905,8 @@ private:
* The resource tag where the default calendar is stored.
*/
static const char kDefaultCalendar[];
/**
* The Gregorian year, as computed by computeGregorianFields() and
* returned by getGregorianYear().
@ -1998,7 +1998,7 @@ private:
/**
* Validate a single field of this calendar given its minimum and
* maximum allowed value. If the field is out of range,
* maximum allowed value. If the field is out of range,
* <code>U_ILLEGAL_ARGUMENT_ERROR</code> will be set. Subclasses may
* use this method in their implementation of {@link
* #validateField(int, int&)}.
@ -2023,12 +2023,12 @@ private:
char actualLocale[ULOC_FULLNAME_CAPACITY];
public:
/**
/**
* INTERNAL FOR 2.6 -- Registration.
*/
/**
* Return a StringEnumeration over the locales available at the time of the call,
* Return a StringEnumeration over the locales available at the time of the call,
* including registered locales.
* @return a StringEnumeration over the locales available at the time of the call
* @internal
@ -2056,27 +2056,27 @@ private:
* @internal
*/
static UBool unregister(URegistryKey key, UErrorCode& status);
/**
* Multiple Calendar Implementation
* @internal
* @internal
*/
friend class CalendarFactory;
/**
* Multiple Calendar Implementation
* @internal
* @internal
*/
friend class CalendarService;
/**
* Multiple Calendar Implementation
* @internal
* @internal
*/
friend class DefaultCalendarFactory;
/**
* @internal
* @internal
* @return TRUE if this calendar has a default century (i.e. 03 -> 2003)
*/
virtual UBool haveDefaultCentury() const = 0;
@ -2087,13 +2087,13 @@ private:
*/
virtual UDate defaultCenturyStart() const = 0;
/**
* @internal
* @internal
* @return the beginning year of the default century, as a year
*/
virtual int32_t defaultCenturyStartYear() const = 0;
/** Get the locale for this calendar object. You can choose between valid and actual locale.
* @param type type of the locale we're looking for (valid or actual)
* @param type type of the locale we're looking for (valid or actual)
* @param status error code for the operation
* @return the locale
* @draft ICU 2.8 likely to change in ICU 3.0, based on feedback
@ -2101,7 +2101,7 @@ private:
Locale getLocale(ULocDataLocaleType type, UErrorCode &status) const;
/** Get the locale for this calendar object. You can choose between valid and actual locale.
* @param type type of the locale we're looking for (valid or actual)
* @param type type of the locale we're looking for (valid or actual)
* @param status error code for the operation
* @return the locale
* @internal
@ -2121,7 +2121,7 @@ Calendar::createInstance(TimeZone* zone, UErrorCode& errorCode)
// -------------------------------------
inline void
inline void
Calendar::roll(UCalendarDateFields field, UBool up, UErrorCode& status)
{
roll(field, (int32_t)(up ? +1 : -1), status);

View File

@ -662,7 +662,7 @@ public:
* @return The class ID for all objects of this class.
* @stable ICU 2.0
*/
static UClassID getStaticClassID(void);
static UClassID U_EXPORT2 getStaticClassID(void);
private:
// static cache management (thread-safe)

View File

@ -195,7 +195,7 @@ public:
* @return the primary order of a collation order.
* @stable ICU 2.0
*/
static int32_t primaryOrder(int32_t order);
static inline int32_t primaryOrder(int32_t order);
/**
* Gets the secondary order of a collation order.
@ -203,7 +203,7 @@ public:
* @return the secondary order of a collation order.
* @stable ICU 2.0
*/
static int32_t secondaryOrder(int32_t order);
static inline int32_t secondaryOrder(int32_t order);
/**
* Gets the tertiary order of a collation order.
@ -211,7 +211,7 @@ public:
* @return the tertiary order of a collation order.
* @stable ICU 2.0
*/
static int32_t tertiaryOrder(int32_t order);
static inline int32_t tertiaryOrder(int32_t order);
/**
* Return the maximum length of any expansion sequences that end with the
@ -254,7 +254,7 @@ public:
* @return TRUE if a character is ignorable, FALSE otherwise.
* @stable ICU 2.0
*/
static UBool isIgnorable(int32_t order);
static inline UBool isIgnorable(int32_t order);
/**
* Gets the offset of the currently processed character in the source string.
@ -284,7 +284,7 @@ public:
*
* @stable ICU 2.2
*/
static UClassID getStaticClassID();
static UClassID U_EXPORT2 getStaticClassID();
protected:

View File

@ -7,7 +7,7 @@
/**
* File coll.h
*
*
* Created by: Helena Shih
*
* Modification History:
@ -32,13 +32,13 @@
* 02/10/98 damiba Added compare() with length as parameter.
* 04/23/99 stephen Removed EDecompositionMode, merged with
* Normalizer::EMode.
* 11/02/99 helena Collator performance enhancements. Eliminates the
* 11/02/99 helena Collator performance enhancements. Eliminates the
* UnicodeString construction and special case for NO_OP.
* 11/23/99 srl More performance enhancements. Inlining of
* critical accessors.
* 05/15/00 helena Added version information API.
* 01/29/01 synwee Modified into a C++ wrapper which calls C apis
* (ucoll.h).
* 05/15/00 helena Added version information API.
* 01/29/01 synwee Modified into a C++ wrapper which calls C apis
* (ucoll.h).
*/
#ifndef COLL_H
@ -76,30 +76,30 @@ class CollatorFactory;
class CollationKey;
/**
* The <code>Collator</code> class performs locale-sensitive string
* The <code>Collator</code> class performs locale-sensitive string
* comparison.<br>
* You use this class to build searching and sorting routines for natural
* You use this class to build searching and sorting routines for natural
* language text.<br>
* <em>Important: </em>The ICU collation service has been reimplemented
* in order to achieve better performance and UCA compliance.
* For details, see the
* <em>Important: </em>The ICU collation service has been reimplemented
* in order to achieve better performance and UCA compliance.
* For details, see the
* <a href="http://oss.software.ibm.com/cvs/icu/~checkout~/icuhtml/design/collation/ICU_collation_design.htm">
* collation design document</a>.
* <p>
* <code>Collator</code> is an abstract base class. Subclasses implement
* specific collation strategies. One subclass,
* <code>RuleBasedCollator</code>, is currently provided and is applicable
* to a wide set of languages. Other subclasses may be created to handle more
* <code>Collator</code> is an abstract base class. Subclasses implement
* specific collation strategies. One subclass,
* <code>RuleBasedCollator</code>, is currently provided and is applicable
* to a wide set of languages. Other subclasses may be created to handle more
* specialized needs.
* <p>
* Like other locale-sensitive classes, you can use the static factory method,
* <code>createInstance</code>, to obtain the appropriate
* <code>Collator</code> object for a given locale. You will only need to
* look at the subclasses of <code>Collator</code> if you need to
* understand the details of a particular collation strategy or if you need to
* Like other locale-sensitive classes, you can use the static factory method,
* <code>createInstance</code>, to obtain the appropriate
* <code>Collator</code> object for a given locale. You will only need to
* look at the subclasses of <code>Collator</code> if you need to
* understand the details of a particular collation strategy or if you need to
* modify that strategy.
* <p>
* The following example shows how to compare two strings using the
* The following example shows how to compare two strings using the
* <code>Collator</code> for the default locale.
* \htmlonly<blockquote>\endhtmlonly
* <pre>
@ -115,55 +115,52 @@ class CollationKey;
* </pre>
* \htmlonly</blockquote>\endhtmlonly
* <p>
* You can set a <code>Collator</code>'s <em>strength</em> property to
* determine the level of difference considered significant in comparisons.
* Five strengths are provided: <code>PRIMARY</code>, <code>SECONDARY</code>,
* <code>TERTIARY</code>, <code>QUATERNARY</code> and <code>IDENTICAL</code>. The exact assignment of
* strengths to language features is locale dependant. For example, in Czech,
* "e" and "f" are considered primary differences, while "e" and "\u00EA" are
* secondary differences, "e" and "E" are tertiary differences and "e" and "e"
* are identical. The following shows how both case and accents could be
* ignored for US English.
* You can set a <code>Collator</code>'s <em>strength</em> property to
* determine the level of difference considered significant in comparisons.
* Five strengths are provided: <code>PRIMARY</code>, <code>SECONDARY</code>,
* <code>TERTIARY</code>, <code>QUATERNARY</code> and <code>IDENTICAL</code>.
* The exact assignment of strengths to language features is locale dependant.
* For example, in Czech, "e" and "f" are considered primary differences,
* while "e" and "\u00EA" are secondary differences, "e" and "E" are tertiary
* differences and "e" and "e" are identical. The following shows how both case
* and accents could be ignored for US English.
* \htmlonly<blockquote>\endhtmlonly
* <pre>
* \code
* //Get the Collator for US English and set its strength to PRIMARY
* //Get the Collator for US English and set its strength to PRIMARY
* UErrorCode success = U_ZERO_ERROR;
* Collator* usCollator =
* Collator::createInstance(Locale::US, success);
* Collator* usCollator = Collator::createInstance(Locale::US, success);
* usCollator->setStrength(Collator::PRIMARY);
* if (usCollator->compare("abc", "ABC") == 0)
* cout <<
* "'abc' and 'ABC' strings are equivalent with strength PRIMARY" <<
* endl;
* cout << "'abc' and 'ABC' strings are equivalent with strength PRIMARY" << endl;
* \endcode
* </pre>
* \htmlonly</blockquote>\endhtmlonly
* <p>
* For comparing strings exactly once, the <code>compare</code> method
* provides the best performance. When sorting a list of strings however, it
* is generally necessary to compare each string multiple times. In this case,
* sort keys provide better performance. The <code>getSortKey</code> methods
* convert a string to a series of bytes that can be compared bitwise against
* other sort keys using <code>strcmp()</code>. Sort keys are written as
* zero-terminated byte strings. They consist of several substrings, one for
* For comparing strings exactly once, the <code>compare</code> method
* provides the best performance. When sorting a list of strings however, it
* is generally necessary to compare each string multiple times. In this case,
* sort keys provide better performance. The <code>getSortKey</code> methods
* convert a string to a series of bytes that can be compared bitwise against
* other sort keys using <code>strcmp()</code>. Sort keys are written as
* zero-terminated byte strings. They consist of several substrings, one for
* each collation strength level, that are delimited by 0x01 bytes.
* If the string code points are appended for UCOL_IDENTICAL, then they are
* processed for correct code point order comparison and may contain 0x01
* If the string code points are appended for UCOL_IDENTICAL, then they are
* processed for correct code point order comparison and may contain 0x01
* bytes but not zero bytes.
* </p>
* <p>
* An older set of APIs returns a <code>CollationKey</code> object that wraps
* An older set of APIs returns a <code>CollationKey</code> object that wraps
* the sort key bytes instead of returning the bytes themselves.
* Its use is deprecated, but it is still available for compatibility with
* Its use is deprecated, but it is still available for compatibility with
* Java.
* </p>
* <p>
* <strong>Note:</strong> <code>Collator</code>s with different Locale,
* and CollationStrength settings will return different sort
* orders for the same set of strings. Locales have specific collation rules,
* and the way in which secondary and tertiary differences are taken into
* account, for example, will result in a different sorting order for same
* and CollationStrength settings will return different sort
* orders for the same set of strings. Locales have specific collation rules,
* and the way in which secondary and tertiary differences are taken into
* account, for example, will result in a different sorting order for same
* strings.
* </p>
* @see RuleBasedCollator
@ -178,36 +175,36 @@ class U_I18N_API Collator : public UObject {
public:
// Collator public enums -----------------------------------------------
/**
* Base letter represents a primary difference. Set comparison level to
* Base letter represents a primary difference. Set comparison level to
* PRIMARY to ignore secondary and tertiary differences.<br>
* Use this to set the strength of a Collator object.<br>
* Example of primary difference, "abc" &lt; "abd"
*
*
* Diacritical differences on the same base letter represent a secondary
* difference. Set comparison level to SECONDARY to ignore tertiary
* differences. Use this to set the strength of a Collator object.<br>
* Example of secondary difference, "ä" >> "a".
*
* Uppercase and lowercase versions of the same character represents a
* tertiary difference. Set comparison level to TERTIARY to include all
* tertiary difference. Set comparison level to TERTIARY to include all
* comparison differences. Use this to set the strength of a Collator
* object.<br>
* Example of tertiary difference, "abc" &lt;&lt;&lt; "ABC".
*
* Two characters are considered "identical" when they have the same unicode
* Two characters are considered "identical" when they have the same unicode
* spellings.<br>
* For example, "ä" == "ä".
*
* UCollationStrength is also used to determine the strength of sort keys
* UCollationStrength is also used to determine the strength of sort keys
* generated from Collator objects.
* @stable ICU 2.0
*/
enum ECollationStrength
enum ECollationStrength
{
PRIMARY = 0,
SECONDARY = 1,
SECONDARY = 1,
TERTIARY = 2,
QUATERNARY = 3,
IDENTICAL = 15
@ -223,15 +220,15 @@ public:
* @see Collator#compare
* @deprecated ICU 2.6. Use C enum UCollationResult defined in ucol.h
*/
enum EComparisonResult
enum EComparisonResult
{
LESS = -1,
EQUAL = 0,
GREATER = 1
};
// Collator public destructor -----------------------------------------
/**
* Destructor
* @stable ICU 2.0
@ -267,8 +264,8 @@ public:
* Creates the Collator object for the current default locale.
* The default locale is determined by Locale::getDefault.
* The UErrorCode& err parameter is used to return status information to the user.
* To check whether the construction succeeded or not, you should check the
* value of U_SUCCESS(err). If you wish more detailed information, you can
* To check whether the construction succeeded or not, you should check the
* value of U_SUCCESS(err). If you wish more detailed information, you can
* check for informational error results which still indicate success.
* U_USING_FALLBACK_ERROR indicates that a fall back locale was used. For
* example, 'de_CH' was requested, but nothing was found there, so 'de' was
@ -282,12 +279,12 @@ public:
* @see Locale#getDefault
* @stable ICU 2.0
*/
static Collator* createInstance(UErrorCode& err);
static Collator* U_EXPORT2 createInstance(UErrorCode& err);
/**
* Gets the table-based collation object for the desired locale. The
* resource of the desired locale will be loaded by ResourceLoader.
* Locale::ENGLISH is the base collation table and all other languages are
* resource of the desired locale will be loaded by ResourceLoader.
* Locale::ENGLISH is the base collation table and all other languages are
* built on top of it with additional language-specific modifications.
* The UErrorCode& err parameter is used to return status information to the user.
* To check whether the construction succeeded or not, you should check
@ -307,7 +304,7 @@ public:
* @see ResourceLoader
* @stable ICU 2.2
*/
static Collator* createInstance(const Locale& loc, UErrorCode& err);
static Collator* U_EXPORT2 createInstance(const Locale& loc, UErrorCode& err);
#ifdef U_USE_COLLATION_OBSOLETE_2_6
/**
@ -338,7 +335,7 @@ public:
/**
* The comparison function compares the character data stored in two
* different strings. Returns information about whether a string is less
* different strings. Returns information about whether a string is less
* than, greater than or equal to another string.
* @param source the source string to be compared with.
* @param target the string that is to be compared with the source string.
@ -347,12 +344,12 @@ public:
* than target
* @deprecated ICU 2.6 use the overload with UErrorCode &
*/
virtual EComparisonResult compare(const UnicodeString& source,
virtual EComparisonResult compare(const UnicodeString& source,
const UnicodeString& target) const;
/**
* The comparison function compares the character data stored in two
* different strings. Returns information about whether a string is less
* different strings. Returns information about whether a string is less
* than, greater than or equal to another string.
* @param source the source string to be compared with.
* @param target the string that is to be compared with the source string.
@ -362,37 +359,37 @@ public:
* than target
* @draft ICU 2.6
*/
virtual UCollationResult compare(const UnicodeString& source,
virtual UCollationResult compare(const UnicodeString& source,
const UnicodeString& target,
UErrorCode &status) const = 0;
/**
* Does the same thing as compare but limits the comparison to a specified
* Does the same thing as compare but limits the comparison to a specified
* length
* @param source the source string to be compared with.
* @param target the string that is to be compared with the source string.
* @param length the length the comparison is limited to
* @return Returns a byte value. GREATER if source (up to the specified
* length) is greater than target; EQUAL if source (up to specified
* length) is equal to target; LESS if source (up to the specified
* length) is less than target.
* @return Returns a byte value. GREATER if source (up to the specified
* length) is greater than target; EQUAL if source (up to specified
* length) is equal to target; LESS if source (up to the specified
* length) is less than target.
* @deprecated ICU 2.6 use the overload with UErrorCode &
*/
virtual EComparisonResult compare(const UnicodeString& source,
const UnicodeString& target,
int32_t length) const;
/**
* Does the same thing as compare but limits the comparison to a specified
* Does the same thing as compare but limits the comparison to a specified
* length
* @param source the source string to be compared with.
* @param target the string that is to be compared with the source string.
* @param length the length the comparison is limited to
* @param status possible error code
* @return Returns an enum value. UCOL_GREATER if source (up to the specified
* length) is greater than target; UCOL_EQUAL if source (up to specified
* length) is equal to target; UCOL_LESS if source (up to the specified
* length) is less than target.
* @return Returns an enum value. UCOL_GREATER if source (up to the specified
* length) is greater than target; UCOL_EQUAL if source (up to specified
* length) is equal to target; UCOL_LESS if source (up to the specified
* length) is less than target.
* @draft ICU 2.6
*/
virtual UCollationResult compare(const UnicodeString& source,
@ -402,7 +399,7 @@ public:
/**
* The comparison function compares the character data stored in two
* different string arrays. Returns information about whether a string array
* different string arrays. Returns information about whether a string array
* is less than, greater than or equal to another string array.
* @param source the source string array to be compared with.
* @param sourceLength the length of the source string array. If this value
@ -410,18 +407,18 @@ public:
* @param target the string that is to be compared with the source string.
* @param targetLength the length of the target string array. If this value
* is equal to -1, the string array is null-terminated.
* @return Returns a byte value. GREATER if source is greater than target;
* EQUAL if source is equal to target; LESS if source is less than
* @return Returns a byte value. GREATER if source is greater than target;
* EQUAL if source is equal to target; LESS if source is less than
* target
* @deprecated ICU 2.6 use the overload with UErrorCode &
*/
virtual EComparisonResult compare(const UChar* source, int32_t sourceLength,
const UChar* target, int32_t targetLength)
const UChar* target, int32_t targetLength)
const;
/**
* The comparison function compares the character data stored in two
* different string arrays. Returns information about whether a string array
* different string arrays. Returns information about whether a string array
* is less than, greater than or equal to another string array.
* @param source the source string array to be compared with.
* @param sourceLength the length of the source string array. If this value
@ -439,10 +436,10 @@ public:
const UChar* target, int32_t targetLength,
UErrorCode &status) const = 0;
/**
/**
* Transforms the string into a series of characters that can be compared
* with CollationKey::compareTo. It is not possible to restore the original
* string from the chars in the sort key. The generated sort key handles
* string from the chars in the sort key. The generated sort key handles
* only a limited number of ignorable characters.
* <p>Use CollationKey::equals or CollationKey::compare to compare the
* generated sort keys.
@ -458,10 +455,10 @@ public:
CollationKey& key,
UErrorCode& status) const = 0;
/**
/**
* Transforms the string into a series of characters that can be compared
* with CollationKey::compareTo. It is not possible to restore the original
* string from the chars in the sort key. The generated sort key handles
* string from the chars in the sort key. The generated sort key handles
* only a limited number of ignorable characters.
* <p>Use CollationKey::equals or CollationKey::compare to compare the
* generated sort keys.
@ -474,7 +471,7 @@ public:
* @see CollationKey#compare
* @deprecated ICU 2.8 Use getSortKey(...) instead
*/
virtual CollationKey& getCollationKey(const UChar*source,
virtual CollationKey& getCollationKey(const UChar*source,
int32_t sourceLength,
CollationKey& key,
UErrorCode& status) const = 0;
@ -507,26 +504,26 @@ public:
* @see Collator#compare
* @stable ICU 2.0
*/
UBool greater(const UnicodeString& source, const UnicodeString& target)
UBool greater(const UnicodeString& source, const UnicodeString& target)
const;
/**
* Convenience method for comparing two strings based on the collation rules.
* @param source the source string to be compared with.
* @param target the target string to be compared with.
* @return true if the first string is greater than or equal to the second
* @return true if the first string is greater than or equal to the second
* one, according to the collation rules. false, otherwise.
* @see Collator#compare
* @stable ICU 2.0
*/
UBool greaterOrEqual(const UnicodeString& source,
UBool greaterOrEqual(const UnicodeString& source,
const UnicodeString& target) const;
/**
* Convenience method for comparing two strings based on the collation rules.
* @param source the source string to be compared with.
* @param target the target string to be compared with.
* @return true if the strings are equal according to the collation rules.
* @return true if the strings are equal according to the collation rules.
* false, otherwise.
* @see Collator#compare
* @stable ICU 2.0
@ -551,15 +548,13 @@ public:
* <pre>
* \code
* UErrorCode status = U_ZERO_ERROR;
* Collator*myCollation = Collator::createInstance(Locale::US,
* status);
* Collator*myCollation = Collator::createInstance(Locale::US, status);
* if (U_FAILURE(status)) return;
* myCollation->setStrength(Collator::PRIMARY);
* // result will be "abc" == "ABC"
* // tertiary differences will be ignored
* Collator::ComparisonResult result = myCollation->compare("abc",
* "ABC");
* \endcode
* Collator::ComparisonResult result = myCollation->compare("abc", "ABC");
* \endcode
* </pre>
* @see Collator#getStrength
* @param newStrength the new comparison level.
@ -576,7 +571,7 @@ public:
* desired language
* @stable ICU 2.0
*/
static UnicodeString& getDisplayName(const Locale& objectLocale,
static UnicodeString& U_EXPORT2 getDisplayName(const Locale& objectLocale,
const Locale& displayLocale,
UnicodeString& name);
@ -588,7 +583,7 @@ public:
* @return name of the object for the desired locale in the default language
* @stable ICU 2.0
*/
static UnicodeString& getDisplayName(const Locale& objectLocale,
static UnicodeString& U_EXPORT2 getDisplayName(const Locale& objectLocale,
UnicodeString& name);
/**
@ -602,18 +597,18 @@ public:
* @return the list of available locales for which collations are installed
* @stable ICU 2.0
*/
static const Locale* getAvailableLocales(int32_t& count);
static const Locale* U_EXPORT2 getAvailableLocales(int32_t& count);
#if !UCONFIG_NO_SERVICE
/**
* Return a StringEnumeration over the locales available at the time of the call,
* Return a StringEnumeration over the locales available at the time of the call,
* including registered locales. If a severe error occurs (such as out of memory
* condition) this will return null. If there is no locale data, an empty enumeration
* will be returned.
* @return a StringEnumeration over the locales available at the time of the call
* @draft ICU 2.6
*/
static StringEnumeration* getAvailableLocales(void);
static StringEnumeration* U_EXPORT2 getAvailableLocales(void);
#endif
/**
@ -625,7 +620,7 @@ public:
* responsible for closing the result.
* @draft ICU 3.0
*/
static StringEnumeration* getKeywords(UErrorCode& status);
static StringEnumeration* U_EXPORT2 getKeywords(UErrorCode& status);
/**
* Given a keyword, create a string enumeration of all values
@ -638,8 +633,8 @@ public:
* upon error. The caller is responsible for deleting the result.
* @draft ICU 3.0
*/
static StringEnumeration* getKeywordValues(const char *keyword, UErrorCode& status);
static StringEnumeration* U_EXPORT2 getKeywordValues(const char *keyword, UErrorCode& status);
/**
* Return the functionally equivalent locale for the given
* requested locale, with respect to given keyword, for the
@ -667,7 +662,7 @@ public:
* locale upon error.
* @draft ICU 3.0
*/
static Locale getFunctionalEquivalent(const char* keyword, const Locale& locale,
static Locale U_EXPORT2 getFunctionalEquivalent(const char* keyword, const Locale& locale,
UBool& isAvailable, UErrorCode& status);
#if !UCONFIG_NO_SERVICE
@ -679,7 +674,7 @@ public:
* @return a registry key that can be used to unregister this collator
* @draft ICU 2.6
*/
static URegistryKey registerInstance(Collator* toAdopt, const Locale& locale, UErrorCode& status);
static URegistryKey U_EXPORT2 registerInstance(Collator* toAdopt, const Locale& locale, UErrorCode& status);
/**
* Register a new CollatorFactory. The factory will be adopted.
@ -688,7 +683,7 @@ public:
* @return a registry key that can be used to unregister this collator
* @draft ICU 2.6
*/
static URegistryKey registerFactory(CollatorFactory* toAdopt, UErrorCode& status);
static URegistryKey U_EXPORT2 registerFactory(CollatorFactory* toAdopt, UErrorCode& status);
/**
* Unregister a previously-registered Collator or CollatorFactory
@ -698,13 +693,13 @@ public:
* @param key the registry key returned by a previous call to registerInstance
* @param status the in/out status code, no special meanings are assigned
* @return TRUE if the collator for the key was successfully unregistered
* @draft ICU 2.6
* @draft ICU 2.6
*/
static UBool unregister(URegistryKey key, UErrorCode& status);
static UBool U_EXPORT2 unregister(URegistryKey key, UErrorCode& status);
#endif /* UCONFIG_NO_SERVICE */
/**
* Gets the version information for a Collator.
* Gets the version information for a Collator.
* @param info the version # information, the result will be filled in
* @stable ICU 2.0
*/
@ -712,11 +707,11 @@ public:
/**
* Returns a unique class ID POLYMORPHICALLY. Pure virtual method.
* This method is to implement a simple version of RTTI, since not all C++
* compilers support genuine RTTI. Polymorphic operator==() and clone()
* This method is to implement a simple version of RTTI, since not all C++
* compilers support genuine RTTI. Polymorphic operator==() and clone()
* methods call this method.
* @return The class ID for this object. All objects of a given class have
* the same class ID. Objects of other classes have different class
* @return The class ID for this object. All objects of a given class have
* the same class ID. Objects of other classes have different class
* IDs.
* @stable ICU 2.0
*/
@ -724,28 +719,28 @@ public:
/**
* Universal attribute setter
* @param attr attribute type
* @param attr attribute type
* @param value attribute value
* @param status to indicate whether the operation went on smoothly or
* @param status to indicate whether the operation went on smoothly or
* there were errors
* @stable ICU 2.2
*/
virtual void setAttribute(UColAttribute attr, UColAttributeValue value,
virtual void setAttribute(UColAttribute attr, UColAttributeValue value,
UErrorCode &status) = 0;
/**
* Universal attribute getter
* @param attr attribute type
* @param status to indicate whether the operation went on smoothly or
* @param status to indicate whether the operation went on smoothly or
* there were errors
* @return attribute value
* @stable ICU 2.2
*/
virtual UColAttributeValue getAttribute(UColAttribute attr,
virtual UColAttributeValue getAttribute(UColAttribute attr,
UErrorCode &status) = 0;
/**
* Sets the variable top to a collation element value of a string supplied.
/**
* Sets the variable top to a collation element value of a string supplied.
* @param varTop one or more (if contraction) UChars to which the variable top should be set
* @param len length of variable top string. If -1 it is considered to be zero terminated.
* @param status error code. If error code is set, the return value is undefined. Errors set by this function are: <br>
@ -756,8 +751,8 @@ public:
*/
virtual uint32_t setVariableTop(const UChar *varTop, int32_t len, UErrorCode &status) = 0;
/**
* Sets the variable top to a collation element value of a string supplied.
/**
* Sets the variable top to a collation element value of a string supplied.
* @param varTop an UnicodeString size 1 or more (if contraction) of UChars to which the variable top should be set
* @param status error code. If error code is set, the return value is undefined. Errors set by this function are: <br>
* U_CE_NOT_FOUND_ERROR if more than one character was passed and there is no such a contraction<br>
@ -767,8 +762,8 @@ public:
*/
virtual uint32_t setVariableTop(const UnicodeString varTop, UErrorCode &status) = 0;
/**
* Sets the variable top to a collation element value supplied. Variable top is set to the upper 16 bits.
/**
* Sets the variable top to a collation element value supplied. Variable top is set to the upper 16 bits.
* Lower 16 bits are ignored.
* @param varTop CE value, as returned by setVariableTop or ucol)getVariableTop
* @param status error code (not changed by function)
@ -776,8 +771,8 @@ public:
*/
virtual void setVariableTop(const uint32_t varTop, UErrorCode &status) = 0;
/**
* Gets the variable top value of a Collator.
/**
* Gets the variable top value of a Collator.
* Lower 16 bits are undefined and should be ignored.
* @param status error code (not changed by function). If error code is set, the return value is undefined.
* @stable ICU 2.0
@ -785,10 +780,10 @@ public:
virtual uint32_t getVariableTop(UErrorCode &status) const = 0;
/**
* Get an UnicodeSet that contains all the characters and sequences
* Get an UnicodeSet that contains all the characters and sequences
* tailored in this collator.
* @param status error code of the operation
* @return a pointer to a UnicodeSet object containing all the
* @return a pointer to a UnicodeSet object containing all the
* code points and sequences that may sort differently than
* in the UCA. The object must be disposed of by using delete
* @stable ICU 2.4
@ -805,13 +800,13 @@ public:
/**
* Get the sort key as an array of bytes from an UnicodeString.
* Sort key byte arrays are zero-terminated and can be compared using
* Sort key byte arrays are zero-terminated and can be compared using
* strcmp().
* @param source string to be processed.
* @param result buffer to store result in. If NULL, number of bytes needed
* @param result buffer to store result in. If NULL, number of bytes needed
* will be returned.
* @param resultLength length of the result buffer. If if not enough the
* buffer will be filled to capacity.
* @param resultLength length of the result buffer. If if not enough the
* buffer will be filled to capacity.
* @return Number of bytes needed for storing the sort key
* @stable ICU 2.2
*/
@ -821,16 +816,16 @@ public:
/**
* Get the sort key as an array of bytes from an UChar buffer.
* Sort key byte arrays are zero-terminated and can be compared using
* Sort key byte arrays are zero-terminated and can be compared using
* strcmp().
* @param source string to be processed.
* @param sourceLength length of string to be processed.
* If -1, the string is 0 terminated and length will be decided by the
* @param sourceLength length of string to be processed.
* If -1, the string is 0 terminated and length will be decided by the
* function.
* @param result buffer to store result in. If NULL, number of bytes needed
* @param result buffer to store result in. If NULL, number of bytes needed
* will be returned.
* @param resultLength length of the result buffer. If if not enough the
* buffer will be filled to capacity.
* @param resultLength length of the result buffer. If if not enough the
* buffer will be filled to capacity.
* @return Number of bytes needed for storing the sort key
* @stable ICU 2.2
*/
@ -839,11 +834,11 @@ public:
/**
* Produce a bound for a given sortkey and a number of levels.
* Return value is always the number of bytes needed, regardless of
* Return value is always the number of bytes needed, regardless of
* whether the result buffer was big enough or even valid.<br>
* Resulting bounds can be used to produce a range of strings that are
* between upper and lower bounds. For example, if bounds are produced
* for a sortkey of string "smith", strings between upper and lower
* for a sortkey of string "smith", strings between upper and lower
* bounds with one level would include "Smith", "SMITH", "sMiTh".<br>
* There are two upper bounds that can be produced. If UCOL_BOUND_UPPER
* is produced, strings matched would be as above. However, if bound
@ -853,28 +848,28 @@ public:
* TestBounds.
* Sort keys may be compared using <TT>strcmp</TT>.
* @param source The source sortkey.
* @param sourceLength The length of source, or -1 if null-terminated.
* (If an unmodified sortkey is passed, it is always null
* @param sourceLength The length of source, or -1 if null-terminated.
* (If an unmodified sortkey is passed, it is always null
* terminated).
* @param boundType Type of bound required. It can be UCOL_BOUND_LOWER, which
* produces a lower inclusive bound, UCOL_BOUND_UPPER, that
* produces upper bound that matches strings of the same length
* or UCOL_BOUND_UPPER_LONG that matches strings that have the
* @param boundType Type of bound required. It can be UCOL_BOUND_LOWER, which
* produces a lower inclusive bound, UCOL_BOUND_UPPER, that
* produces upper bound that matches strings of the same length
* or UCOL_BOUND_UPPER_LONG that matches strings that have the
* same starting substring as the source string.
* @param noOfLevels Number of levels required in the resulting bound (for most
* uses, the recommended value is 1). See users guide for
* @param noOfLevels Number of levels required in the resulting bound (for most
* uses, the recommended value is 1). See users guide for
* explanation on number of levels a sortkey can have.
* @param result A pointer to a buffer to receive the resulting sortkey.
* @param resultLength The maximum size of result.
* @param status Used for returning error code if something went wrong. If the
* @param status Used for returning error code if something went wrong. If the
* number of levels requested is higher than the number of levels
* in the source key, a warning (U_SORT_KEY_TOO_SHORT_WARNING) is
* in the source key, a warning (U_SORT_KEY_TOO_SHORT_WARNING) is
* issued.
* @return The size needed to fully store the bound.
* @return The size needed to fully store the bound.
* @see ucol_keyHashCode
* @stable ICU 2.1
*/
static int32_t getBound(const uint8_t *source,
static int32_t U_EXPORT2 getBound(const uint8_t *source,
int32_t sourceLength,
UColBoundMode boundType,
uint32_t noOfLevels,
@ -890,7 +885,7 @@ protected:
/**
* Default constructor.
* Constructor is different from the old default Collator constructor.
* The task for determing the default collation strength and normalization
* The task for determing the default collation strength and normalization
* mode is left to the child class.
* @stable ICU 2.0
*/
@ -900,23 +895,23 @@ protected:
* Constructor.
* Empty constructor, does not handle the arguments.
* This constructor is done for backward compatibility with 1.7 and 1.8.
* The task for handling the argument collation strength and normalization
* The task for handling the argument collation strength and normalization
* mode is left to the child class.
* @param collationStrength collation strength
* @param decompositionMode
* @param decompositionMode
* @deprecated ICU 2.4. Subclasses should use the default constructor
* instead and handle the strength and normalization mode themselves.
*/
Collator(UCollationStrength collationStrength,
Collator(UCollationStrength collationStrength,
UNormalizationMode decompositionMode);
/**
* Copy constructor.
* @param other Collator object to be copied from
* @stable ICU 2.0
*/
Collator(const Collator& other);
// Collator protected methods -----------------------------------------
@ -947,7 +942,7 @@ private:
friend class SimpleCFactory;
friend class ICUCollatorFactory;
friend class ICUCollatorService;
static Collator* makeInstance(const Locale& desiredLocale,
static Collator* makeInstance(const Locale& desiredLocale,
UErrorCode& status);
// Collator private data members ---------------------------------------
@ -966,7 +961,7 @@ private:
* A factory, used with registerFactory, the creates multiple collators and provides
* display names for them. A factory supports some number of locales-- these are the
* locales for which it can create collators. The factory can be visible, in which
* case the supported locales will be enumerated by getAvailableLocales, or invisible,
* case the supported locales will be enumerated by getAvailableLocales, or invisible,
* in which they are not. Invisible locales are still supported, they are just not
* listed by getAvailableLocales.
* <p>
@ -1015,13 +1010,13 @@ public:
* @return the display name
* @draft ICU 2.6
*/
virtual UnicodeString& getDisplayName(const Locale& objectLocale,
virtual UnicodeString& getDisplayName(const Locale& objectLocale,
const Locale& displayLocale,
UnicodeString& result);
/**
* Return an array of all the locale names directly supported by this factory.
* The number of names is returned in count. This array is owned by the factory.
* Return an array of all the locale names directly supported by this factory.
* The number of names is returned in count. This array is owned by the factory.
* Its contents must never change.
* @param count output parameter for the number of locales supported by the factory
* @param status the in/out error code

View File

@ -95,7 +95,7 @@ class U_I18N_API CurrencyAmount: public Measure {
* @return The class ID for all objects of this class.
* @draft ICU 3.0
*/
static UClassID getStaticClassID();
static UClassID U_EXPORT2 getStaticClassID();
/**
* Return the currency unit object of this object.

View File

@ -87,7 +87,7 @@ class U_I18N_API CurrencyUnit: public MeasureUnit {
* @return The class ID for all objects of this class.
* @draft ICU 3.0
*/
static UClassID getStaticClassID();
static UClassID U_EXPORT2 getStaticClassID();
/**
* Return the ISO currency code of this object.

View File

@ -18,7 +18,7 @@
#ifndef DATEFMT_H
#define DATEFMT_H
#include "unicode/utypes.h"
#if !UCONFIG_NO_FORMATTING
@ -158,12 +158,12 @@ public:
kDefault = kMedium,
/**
* These constants are provided for backwards compatibility only.
* Please use the C++ style constants defined above.
*/
*/
FULL = kFull,
LONG = kLong,
MEDIUM = kMedium,
@ -211,11 +211,11 @@ public:
* <P>
* On input, the FieldPosition parameter may have its "field" member filled with
* an enum value specifying a field. On output, the FieldPosition will be filled
* in with the text offsets for that field.
* in with the text offsets for that field.
* <P> For example, given a time text
* "1996.07.10 AD at 15:08:56 PDT", if the given fieldPosition.field is
* UDAT_YEAR_FIELD, the offsets fieldPosition.beginIndex and
* statfieldPositionus.getEndIndex will be set to 0 and 4, respectively.
* statfieldPositionus.getEndIndex will be set to 0 and 4, respectively.
* <P> Notice
* that if the same time field appears more than once in a pattern, the status will
* be set for the first occurence of that time field. For instance,
@ -243,11 +243,11 @@ public:
* <P>
* On input, the FieldPosition parameter may have its "field" member filled with
* an enum value specifying a field. On output, the FieldPosition will be filled
* in with the text offsets for that field.
* in with the text offsets for that field.
* <P> For example, given a time text
* "1996.07.10 AD at 15:08:56 PDT", if the given fieldPosition.field is
* UDAT_YEAR_FIELD, the offsets fieldPosition.beginIndex and
* statfieldPositionus.getEndIndex will be set to 0 and 4, respectively.
* statfieldPositionus.getEndIndex will be set to 0 and 4, respectively.
* <P> Notice
* that if the same time field appears more than once in a pattern, the status will
* be set for the first occurence of that time field. For instance,
@ -393,38 +393,38 @@ public:
* @return A date/time formatter which the caller owns.
* @stable ICU 2.0
*/
static DateFormat* createInstance(void);
static DateFormat* U_EXPORT2 createInstance(void);
/**
* Creates a time formatter with the given formatting style for the given
* locale.
*
*
* @param style The given formatting style. For example,
* SHORT for "h:mm a" in the US locale.
* @param aLocale The given locale.
* @return A time formatter which the caller owns.
* @stable ICU 2.0
*/
static DateFormat* createTimeInstance(EStyle style = kDefault,
static DateFormat* U_EXPORT2 createTimeInstance(EStyle style = kDefault,
const Locale& aLocale = Locale::getDefault());
/**
* Creates a date formatter with the given formatting style for the given
* const locale.
*
*
* @param style The given formatting style. For example,
* SHORT for "M/d/yy" in the US locale.
* @param aLocale The given locale.
* @return A date formatter which the caller owns.
* @stable ICU 2.0
*/
static DateFormat* createDateInstance(EStyle style = kDefault,
static DateFormat* U_EXPORT2 createDateInstance(EStyle style = kDefault,
const Locale& aLocale = Locale::getDefault());
/**
* Creates a date/time formatter with the given formatting styles for the
* given locale.
*
*
* @param dateStyle The given formatting style for the date portion of the result.
* For example, SHORT for "M/d/yy" in the US locale.
* @param timeStyle The given formatting style for the time portion of the result.
@ -433,7 +433,7 @@ public:
* @return A date/time formatter which the caller owns.
* @stable ICU 2.0
*/
static DateFormat* createDateTimeInstance(EStyle dateStyle = kDefault,
static DateFormat* U_EXPORT2 createDateTimeInstance(EStyle dateStyle = kDefault,
EStyle timeStyle = kDefault,
const Locale& aLocale = Locale::getDefault());
@ -444,8 +444,8 @@ public:
* does NOT own this list and must not delete it.
* @stable ICU 2.0
*/
static const Locale* getAvailableLocales(int32_t& count);
static const Locale* U_EXPORT2 getAvailableLocales(int32_t& count);
/**
* Returns true if the formatter is set for lenient parsing.
* @stable ICU 2.0
@ -457,20 +457,20 @@ public:
* parsing, the parser may use heuristics to interpret inputs that do not
* precisely match this object's format. With strict parsing, inputs must
* match this object's format.
*
*
* @param lenient True specifies date/time interpretation to be lenient.
* @see Calendar::setLenient
* @stable ICU 2.0
*/
virtual void setLenient(UBool lenient);
/**
* Gets the calendar associated with this date/time formatter.
* @return the calendar associated with this date/time formatter.
* @stable ICU 2.0
*/
virtual const Calendar* getCalendar(void) const;
/**
* Set the calendar to be used by this date format. Initially, the default
* calendar for the specified or default locale is used. The caller should
@ -491,7 +491,7 @@ public:
*/
virtual void setCalendar(const Calendar& newCalendar);
/**
* Gets the number formatter which this date/time formatter uses to format
* and parse the numeric portions of the pattern.
@ -499,7 +499,7 @@ public:
* @stable ICU 2.0
*/
virtual const NumberFormat* getNumberFormat(void) const;
/**
* Allows you to set the number formatter. The caller should
* not delete the NumberFormat object after it is adopted by this call.
@ -521,7 +521,7 @@ public:
* @stable ICU 2.0
*/
virtual const TimeZone& getTimeZone(void) const;
/**
* Sets the time zone for the calendar of this DateFormat object. The caller
* no longer owns the TimeZone object and should not delete it after this call.
@ -583,7 +583,7 @@ private:
* @param inLocale the given locale.
* @return a date/time formatter, or 0 on failure.
*/
static DateFormat* create(EStyle timeStyle, EStyle dateStyle, const Locale&);
static DateFormat* U_EXPORT2 create(EStyle timeStyle, EStyle dateStyle, const Locale&);
public:
/**

View File

@ -224,7 +224,7 @@ public:
*
* @stable ICU 2.2
*/
static UClassID getStaticClassID();
static UClassID U_EXPORT2 getStaticClassID();
private:
DecimalFormatSymbols(); // default constructor not implemented

View File

@ -1631,7 +1631,7 @@ public:
* @return The class ID for all objects of this class.
* @stable ICU 2.0
*/
static UClassID getStaticClassID(void);
static UClassID U_EXPORT2 getStaticClassID(void);
/**
* Returns a unique class ID POLYMORPHICALLY. Pure virtual override.

View File

@ -292,7 +292,7 @@ public:
* @return the non-localized date-time pattern characters
* @stable ICU 2.0
*/
static const UChar *getPatternUChars(void);
static const UChar * U_EXPORT2 getPatternUChars(void);
/**
* Gets localized date-time pattern characters. For example: 'u', 't', etc.
@ -329,7 +329,7 @@ public:
*
* @stable ICU 2.2
*/
static UClassID getStaticClassID();
static UClassID U_EXPORT2 getStaticClassID();
private:

View File

@ -232,7 +232,7 @@ public:
*
* @stable ICU 2.2
*/
static UClassID getStaticClassID();
static UClassID U_EXPORT2 getStaticClassID();
private:
/**

View File

@ -519,7 +519,7 @@ public:
*
* @stable ICU 2.2
*/
static UClassID getStaticClassID();
static UClassID U_EXPORT2 getStaticClassID();
/**
* Deprecated variant of getLong(UErrorCode&).

View File

@ -456,7 +456,7 @@ public:
* @return The class ID for all objects of this class.
* @stable ICU 2.0
*/
static UClassID getStaticClassID(void);
static UClassID U_EXPORT2 getStaticClassID(void);
/**
* Get the calendar type, "gregorian", for use in DateFormatSymbols.

View File

@ -44,7 +44,7 @@ class U_I18N_API MeasureFormat : public Format {
* @return a formatter object, or NULL upon error
* @draft ICU 3.0
*/
static MeasureFormat* createCurrencyFormat(const Locale& locale,
static MeasureFormat* U_EXPORT2 createCurrencyFormat(const Locale& locale,
UErrorCode& ec);
/**
@ -54,7 +54,7 @@ class U_I18N_API MeasureFormat : public Format {
* @return a formatter object, or NULL upon error
* @draft ICU 3.0
*/
static MeasureFormat* createCurrencyFormat(UErrorCode& ec);
static MeasureFormat* U_EXPORT2 createCurrencyFormat(UErrorCode& ec);
protected:

View File

@ -597,7 +597,7 @@ public:
* @return The class ID for all objects of this class.
* @stable ICU 2.0
*/
static UClassID getStaticClassID(void);
static UClassID U_EXPORT2 getStaticClassID(void);
private:

View File

@ -406,7 +406,7 @@ public:
* the exact format accepted by the parse operation is locale
* dependant and determined by sub-classes of NumberFormat.
* @return true if this format will parse numbers as integers
* only.
* only.
* @stable ICU 2.0
*/
UBool isParseIntegerOnly(void) const;
@ -428,7 +428,7 @@ public:
* is locale dependant.
* @stable ICU 2.0
*/
static NumberFormat* createInstance(UErrorCode&);
static NumberFormat* U_EXPORT2 createInstance(UErrorCode&);
/**
* Returns the default number format for the specified locale.
@ -438,49 +438,49 @@ public:
* @param inLocale the given locale.
* @stable ICU 2.0
*/
static NumberFormat* createInstance(const Locale& inLocale,
static NumberFormat* U_EXPORT2 createInstance(const Locale& inLocale,
UErrorCode&);
/**
* Returns a currency format for the current default locale.
* @stable ICU 2.0
*/
static NumberFormat* createCurrencyInstance(UErrorCode&);
static NumberFormat* U_EXPORT2 createCurrencyInstance(UErrorCode&);
/**
* Returns a currency format for the specified locale.
* @param inLocale the given locale.
* @stable ICU 2.0
*/
static NumberFormat* createCurrencyInstance(const Locale& inLocale,
static NumberFormat* U_EXPORT2 createCurrencyInstance(const Locale& inLocale,
UErrorCode&);
/**
* Returns a percentage format for the current default locale.
* @stable ICU 2.0
*/
static NumberFormat* createPercentInstance(UErrorCode&);
static NumberFormat* U_EXPORT2 createPercentInstance(UErrorCode&);
/**
* Returns a percentage format for the specified locale.
* @param inLocale the given locale.
* @stable ICU 2.0
*/
static NumberFormat* createPercentInstance(const Locale& inLocale,
static NumberFormat* U_EXPORT2 createPercentInstance(const Locale& inLocale,
UErrorCode&);
/**
* Returns a scientific format for the current default locale.
* @stable ICU 2.0
*/
static NumberFormat* createScientificInstance(UErrorCode&);
static NumberFormat* U_EXPORT2 createScientificInstance(UErrorCode&);
/**
* Returns a scientific format for the specified locale.
* @param inLocale the given locale.
* @stable ICU 2.0
*/
static NumberFormat* createScientificInstance(const Locale& inLocale,
static NumberFormat* U_EXPORT2 createScientificInstance(const Locale& inLocale,
UErrorCode&);
/**
@ -488,7 +488,7 @@ public:
* @param count Output param to receive the size of the locales
* @stable ICU 2.0
*/
static const Locale* getAvailableLocales(int32_t& count);
static const Locale* U_EXPORT2 getAvailableLocales(int32_t& count);
#if !UCONFIG_NO_SERVICE
/**
@ -498,7 +498,7 @@ public:
* @return a registry key that can be used to unregister this factory
* @draft ICU 2.6
*/
static URegistryKey registerFactory(NumberFormatFactory* toAdopt, UErrorCode& status);
static URegistryKey U_EXPORT2 registerFactory(NumberFormatFactory* toAdopt, UErrorCode& status);
/**
* Unregister a previously-registered NumberFormatFactory using the key returned from the
@ -509,15 +509,15 @@ public:
* @return TRUE if the factory for the key was successfully unregistered
* @draft ICU 2.6
*/
static UBool unregister(URegistryKey key, UErrorCode& status);
static UBool U_EXPORT2 unregister(URegistryKey key, UErrorCode& status);
/**
* Return a StringEnumeration over the locales available at the time of the call,
* Return a StringEnumeration over the locales available at the time of the call,
* including registered locales.
* @return a StringEnumeration over the locales available at the time of the call
* @draft ICU 2.6
*/
static StringEnumeration* getAvailableLocales(void);
static StringEnumeration* U_EXPORT2 getAvailableLocales(void);
#endif /* UCONFIG_NO_SERVICE */
/**
@ -533,7 +533,7 @@ public:
/**
* Set whether or not grouping will be used in this format.
* @param newValue True, grouping will be used in this format.
* @param newValue True, grouping will be used in this format.
* @see getGroupingUsed
* @stable ICU 2.0
*/
@ -556,7 +556,7 @@ public:
* of minimumIntegerDigits, then minimumIntegerDigits will also be set to
* the new value.
*
* @param newValue the new value for the maximum number of digits
* @param newValue the new value for the maximum number of digits
* allowed in the integer portion of a number.
* @see getMaximumIntegerDigits
* @stable ICU 2.0
@ -662,7 +662,7 @@ public:
* @return The class ID for all objects of this class.
* @stable ICU 2.0
*/
static UClassID getStaticClassID(void);
static UClassID U_EXPORT2 getStaticClassID(void);
/**
* Returns a unique class ID POLYMORPHICALLY. Pure virtual override.
@ -720,17 +720,17 @@ private:
kScientificStyle,
kStyleCount // ALWAYS LAST ENUM: number of styles
};
/**
* Creates the specified decimal format style of the desired locale.
* Hook for service registration, uses makeInstance directly if no services
* registered.
* Hook for service registration, uses makeInstance directly if no services
* registered.
* @param desiredLocale the given locale.
* @param choice the given style.
* @param success Output param filled with success/failure status.
* @return A new NumberFormat instance.
*/
static NumberFormat* createInstance(const Locale& desiredLocale, EStyles choice, UErrorCode& success);
static NumberFormat* U_EXPORT2 createInstance(const Locale& desiredLocale, EStyles choice, UErrorCode& success);
/**
* Creates the specified decimal format style of the desired locale.
@ -739,7 +739,7 @@ private:
* @param success Output param filled with success/failure status.
* @return A new NumberFormat instance.
*/
static NumberFormat* makeInstance(const Locale& desiredLocale, EStyles choice, UErrorCode& success);
static NumberFormat* makeInstance(const Locale& desiredLocale, EStyles choice, UErrorCode& success);
static const int32_t fgNumberPatternsCount;
static const UChar* const fgLastResortNumberPatterns[];
@ -802,7 +802,7 @@ public:
/**
* A NumberFormatFactory that supports a single locale. It can be visible or invisible.
* @draft ICU 3.0
* @draft ICU 3.0
*/
class U_I18N_API SimpleNumberFormatFactory : public NumberFormatFactory {
protected:

View File

@ -500,7 +500,7 @@ public:
* @param status The status indicating whether the constructor succeeded.
* @stable ICU 2.0
*/
RuleBasedNumberFormat(const UnicodeString& rules, const Locale& locale,
RuleBasedNumberFormat(const UnicodeString& rules, const Locale& locale,
UParseError& perror, UErrorCode& status);
/**
@ -733,7 +733,7 @@ public:
Formattable& result,
ParsePosition& parsePosition) const;
/**
* Redeclared Format method.
* @param text The string to parse
@ -817,7 +817,7 @@ public:
*
* @stable ICU 2.8
*/
static UClassID getStaticClassID(void);
static UClassID U_EXPORT2 getStaticClassID(void);
/**
* ICU "poor man's RTTI", returns a UClassID for the actual class.
@ -890,16 +890,16 @@ RuleBasedNumberFormat::parse(const UnicodeString& text, Formattable& result, UEr
#if !UCONFIG_NO_COLLATION
inline UBool
RuleBasedNumberFormat::isLenient(void) const {
return lenient;
inline UBool
RuleBasedNumberFormat::isLenient(void) const {
return lenient;
}
#endif
inline NFRuleSet*
RuleBasedNumberFormat::getDefaultRuleSet() const {
return defaultRuleSet;
inline NFRuleSet*
RuleBasedNumberFormat::getDefaultRuleSet() const {
return defaultRuleSet;
}
U_NAMESPACE_END

View File

@ -16,7 +16,7 @@
#ifndef REGEX_H
#define REGEX_H
#define REGEX_DEBUG
//#define REGEX_DEBUG
/**
* \file
@ -93,46 +93,46 @@ class U_I18N_API RegexPattern: public UObject {
public:
/**
* default constructor. Create a RegexPattern object that refers to no actual
* pattern. Not normally needed; RegexPattern objects are usually
* created using the factory method <code>compile()</code>.
*
* @stable ICU 2.4
*/
* default constructor. Create a RegexPattern object that refers to no actual
* pattern. Not normally needed; RegexPattern objects are usually
* created using the factory method <code>compile()</code>.
*
* @stable ICU 2.4
*/
RegexPattern();
/**
* Copy Constructor. Create a new RegexPattern object that is equivalent
* to the source object.
* @stable ICU 2.4
*/
* Copy Constructor. Create a new RegexPattern object that is equivalent
* to the source object.
* @stable ICU 2.4
*/
RegexPattern(const RegexPattern &source);
/**
* Destructor. Note that a RegexPattern object must persist so long as any
* RegexMatcher objects that were created from the RegexPattern are active.
* @stable ICU 2.4
*/
* Destructor. Note that a RegexPattern object must persist so long as any
* RegexMatcher objects that were created from the RegexPattern are active.
* @stable ICU 2.4
*/
virtual ~RegexPattern();
/**
* Comparison operator. Two RegexPattern objects are considered equal if they
* were constructed from identical source patterns using the same match flag
* settings.
* @param that a RegexPattern object to compare with "this".
* @return TRUE if the objects are equivalent.
* @stable ICU 2.4
*/
* Comparison operator. Two RegexPattern objects are considered equal if they
* were constructed from identical source patterns using the same match flag
* settings.
* @param that a RegexPattern object to compare with "this".
* @return TRUE if the objects are equivalent.
* @stable ICU 2.4
*/
UBool operator==(const RegexPattern& that) const;
/**
* Comparison operator. Two RegexPattern objects are considered equal if they
* were constructed from identical source patterns using the same match flag
* settings.
* @param that a RegexPattern object to compare with "this".
* @return TRUE if the objects are different.
* @stable ICU 2.4
*/
* Comparison operator. Two RegexPattern objects are considered equal if they
* were constructed from identical source patterns using the same match flag
* settings.
* @param that a RegexPattern object to compare with "this".
* @return TRUE if the objects are different.
* @stable ICU 2.4
*/
inline UBool operator!=(const RegexPattern& that) const {return ! operator ==(that);};
/**
@ -153,130 +153,130 @@ public:
/**
* Compiles the regular expression in string form into a RegexPattern
* object. These compile methods, rather than the constructors, are the usual
* way that RegexPattern objects are created.
* Compiles the regular expression in string form into a RegexPattern
* object. These compile methods, rather than the constructors, are the usual
* way that RegexPattern objects are created.
*
* <p>Note that RegexPattern objects must not be deleted while RegexMatcher
* objects created from the pattern are active. RegexMatchers keep a pointer
* back to their pattern, so premature deletion of the pattern is a
* catastrophic error.</p>
* <p>Note that RegexPattern objects must not be deleted while RegexMatcher
* objects created from the pattern are active. RegexMatchers keep a pointer
* back to their pattern, so premature deletion of the pattern is a
* catastrophic error.</p>
*
* <p>All pattern match mode flags are set to their default values.</p>
* <p>All pattern match mode flags are set to their default values.</p>
*
* @param regex The regular expression to be compiled.
* @param pe Receives the position (line and column nubers) of any error
* within the regular expression.)
* @param status A reference to a UErrorCode to receive any errors.
* @return A regexPattern object for the compiled pattern.
* @param regex The regular expression to be compiled.
* @param pe Receives the position (line and column nubers) of any error
* within the regular expression.)
* @param status A reference to a UErrorCode to receive any errors.
* @return A regexPattern object for the compiled pattern.
*
* @stable ICU 2.4
* @stable ICU 2.4
*/
static RegexPattern *compile( const UnicodeString &regex,
static RegexPattern * U_EXPORT2 compile( const UnicodeString &regex,
UParseError &pe,
UErrorCode &status);
/**
* Compiles the regular expression in string form into a RegexPattern
* object using the specified match mode flags. These compile methods,
* rather than the constructors, are the usual way that RegexPattern objects
* are created.
* Compiles the regular expression in string form into a RegexPattern
* object using the specified match mode flags. These compile methods,
* rather than the constructors, are the usual way that RegexPattern objects
* are created.
*
* <p>Note that RegexPattern objects must not be deleted while RegexMatcher
* objects created from the pattern are active. RegexMatchers keep a pointer
* back to their pattern, so premature deletion of the pattern is a
* catastrophic error.</p>
* <p>Note that RegexPattern objects must not be deleted while RegexMatcher
* objects created from the pattern are active. RegexMatchers keep a pointer
* back to their pattern, so premature deletion of the pattern is a
* catastrophic error.</p>
*
* @param regex The regular expression to be compiled.
* @param flags The match mode flags to be used.
* @param pe Receives the position (line and column nubers) of any error
* within the regular expression.)
* @param status A reference to a UErrorCode to receive any errors.
* @return A regexPattern object for the compiled pattern.
* @param regex The regular expression to be compiled.
* @param flags The match mode flags to be used.
* @param pe Receives the position (line and column nubers) of any error
* within the regular expression.)
* @param status A reference to a UErrorCode to receive any errors.
* @return A regexPattern object for the compiled pattern.
*
* @stable ICU 2.4
* @stable ICU 2.4
*/
static RegexPattern *compile( const UnicodeString &regex,
static RegexPattern * U_EXPORT2 compile( const UnicodeString &regex,
uint32_t flags,
UParseError &pe,
UErrorCode &status);
/**
* Compiles the regular expression in string form into a RegexPattern
* object using the specified match mode flags. These compile methods,
* rather than the constructors, are the usual way that RegexPattern objects
* are created.
* Compiles the regular expression in string form into a RegexPattern
* object using the specified match mode flags. These compile methods,
* rather than the constructors, are the usual way that RegexPattern objects
* are created.
*
* <p>Note that RegexPattern objects must not be deleted while RegexMatcher
* objects created from the pattern are active. RegexMatchers keep a pointer
* back to their pattern, so premature deletion of the pattern is a
* catastrophic error.</p>
* <p>Note that RegexPattern objects must not be deleted while RegexMatcher
* objects created from the pattern are active. RegexMatchers keep a pointer
* back to their pattern, so premature deletion of the pattern is a
* catastrophic error.</p>
*
* @param regex The regular expression to be compiled.
* @param flags The match mode flags to be used.
* @param status A reference to a UErrorCode to receive any errors.
* @return A regexPattern object for the compiled pattern.
* @param regex The regular expression to be compiled.
* @param flags The match mode flags to be used.
* @param status A reference to a UErrorCode to receive any errors.
* @return A regexPattern object for the compiled pattern.
*
* @draft ICU 2.6
* @draft ICU 2.6
*/
static RegexPattern *compile( const UnicodeString &regex,
static RegexPattern * U_EXPORT2 compile( const UnicodeString &regex,
uint32_t flags,
UErrorCode &status);
/**
* Get the match mode flags that were used when compiling this pattern.
* @return the match mode flags
* @stable ICU 2.4
* Get the match mode flags that were used when compiling this pattern.
* @return the match mode flags
* @stable ICU 2.4
*/
virtual uint32_t flags() const;
/**
* Creates a RegexMatcher that will match the given input against this pattern. The
* RegexMatcher can then be used to perform match, find or replace operations
* on the input. Note that a RegexPattern object must not be deleted while
* RegexMatchers created from it still exist and might possibly be used again.
* Creates a RegexMatcher that will match the given input against this pattern. The
* RegexMatcher can then be used to perform match, find or replace operations
* on the input. Note that a RegexPattern object must not be deleted while
* RegexMatchers created from it still exist and might possibly be used again.
*
* @param input The input string to which the regular expression will be applied.
* @param status A reference to a UErrorCode to receive any errors.
* @return A RegexMatcher object for this pattern and input.
* @param input The input string to which the regular expression will be applied.
* @param status A reference to a UErrorCode to receive any errors.
* @return A RegexMatcher object for this pattern and input.
*
* @stable ICU 2.4
* @stable ICU 2.4
*/
virtual RegexMatcher *matcher(const UnicodeString &input,
UErrorCode &status) const;
/**
* Creates a RegexMatcher that will match against this pattern. The
* RegexMatcher can be used to perform match, find or replace operations.
* Note that a RegexPattern object must not be deleted while
* RegexMatchers created from it still exist and might possibly be used again.
* Creates a RegexMatcher that will match against this pattern. The
* RegexMatcher can be used to perform match, find or replace operations.
* Note that a RegexPattern object must not be deleted while
* RegexMatchers created from it still exist and might possibly be used again.
*
* @param status A reference to a UErrorCode to receive any errors.
* @return A RegexMatcher object for this pattern and input.
* @param status A reference to a UErrorCode to receive any errors.
* @return A RegexMatcher object for this pattern and input.
*
* @draft ICU 2.6
* @draft ICU 2.6
*/
virtual RegexMatcher *matcher(UErrorCode &status) const;
/**
* Test whether a string matches a regular expression. This convenience function
* both compiles the reguluar expression and applies it in a single operation.
* Note that if the same pattern needs to be applied repeatedly, this method will be
* less efficient than creating and reusing a RegexPattern object.
* Test whether a string matches a regular expression. This convenience function
* both compiles the reguluar expression and applies it in a single operation.
* Note that if the same pattern needs to be applied repeatedly, this method will be
* less efficient than creating and reusing a RegexPattern object.
*
* @param regex The regular expression
* @param input The string data to be matched
* @param pe Receives the position of any syntax errors within the regular expression
* @param status A reference to a UErrorCode to receive any errors.
* @return True if the regular expression exactly matches the full input string.
* @param regex The regular expression
* @param input The string data to be matched
* @param pe Receives the position of any syntax errors within the regular expression
* @param status A reference to a UErrorCode to receive any errors.
* @return True if the regular expression exactly matches the full input string.
*
* @stable ICU 2.4
* @stable ICU 2.4
*/
static UBool matches(const UnicodeString &regex,
static UBool U_EXPORT2 matches(const UnicodeString &regex,
const UnicodeString &input,
UParseError &pe,
UErrorCode &status);
@ -297,7 +297,7 @@ public:
* <p>
* For the best performance on split() operations,
* <code>RegexMatcher::split</code> is perferable to this function
*
*
* @param input The string to be split into fields. The field delimiters
* match the pattern (in the "this" object)
* @param dest An array of UnicodeStrings to receive the results of the split.
@ -325,14 +325,14 @@ public:
*
* @stable ICU 2.4
*/
virtual UClassID getDynamicClassID() const;
virtual UClassID getDynamicClassID() const;
/**
* ICU "poor man's RTTI", returns a UClassID for this class.
*
* @stable ICU 2.4
*/
static UClassID getStaticClassID();
static UClassID U_EXPORT2 getStaticClassID();
private:
//
@ -376,9 +376,9 @@ private:
// sets for predefined regex classes.
int32_t fStartType; // Info on how a match must start.
int32_t fInitialStringIdx; //
int32_t fInitialStringIdx; //
int32_t fInitialStringLen;
UnicodeSet *fInitialChars;
UnicodeSet *fInitialChars;
UChar32 fInitialChar;
Regex8BitSet *fInitialChars8;
@ -393,7 +393,7 @@ private:
void zap(); // Common cleanup
#ifdef REGEX_DEBUG
void dumpOp(int32_t index) const;
friend void RegexPatternDump(const RegexPattern *);
friend void U_EXPORT2 RegexPatternDump(const RegexPattern *);
#endif
};
@ -448,7 +448,7 @@ public:
/**
* Destructor.
* Destructor.
*
* @stable ICU 2.4
*/
@ -636,7 +636,7 @@ public:
/**
* Resets this matcher, and set the current input position.
* The effect is to remove any memory of previous matches,
* and to cause subsequent find() operations to begin at
* and to cause subsequent find() operations to begin at
* the specified position in the input string.
*
* @return this RegexMatcher.
@ -764,7 +764,7 @@ public:
* into fields. The input data between the matches becomes the
* fields themselves.
* <p>
*
*
* @param input The string to be split into fields. The field delimiters
* match the pattern (in the "this" object). This matcher
* will be reset to this input string.
@ -802,7 +802,7 @@ public:
*
* @stable ICU 2.2
*/
static UClassID getStaticClassID();
static UClassID U_EXPORT2 getStaticClassID();
/**
* ICU "poor man's RTTI", returns a UClassID for the actual class.

View File

@ -708,7 +708,7 @@ public:
* @return The class ID for all objects of this class.
* @stable ICU 2.0
*/
static UClassID getStaticClassID(void);
static UClassID U_EXPORT2 getStaticClassID(void);
private:
/**

View File

@ -566,7 +566,7 @@ public:
* @return The class ID for all objects of this class.
* @stable ICU 2.0
*/
static UClassID getStaticClassID(void);
static UClassID U_EXPORT2 getStaticClassID(void);
/**
* Returns a unique class ID POLYMORPHICALLY. Pure virtual override. This
@ -747,7 +747,7 @@ private:
* @param translatedPattern Output param to receive the translited pattern.
* @param from the characters to be translited from.
* @param to the characters to be translited to.
* @param status Receives a status code, which will be U_ZERO_ERROR
* @param status Receives a status code, which will be U_ZERO_ERROR
* if the operation succeeds.
*/
static void translatePattern(const UnicodeString& originalPattern,
@ -760,7 +760,7 @@ private:
* Sets the starting date of the 100-year window that dates with 2-digit years
* are considered to fall within.
* @param startDate the start date
* @param status Receives a status code, which will be U_ZERO_ERROR
* @param status Receives a status code, which will be U_ZERO_ERROR
* if the operation succeeds.
*/
void parseAmbiguousDatesAsAfter(UDate startDate, UErrorCode& status);
@ -805,7 +805,7 @@ private:
* See documentation for defaultCenturyStart.
*/
/*transient*/ int32_t fDefaultCenturyStartYear;
UBool fHaveDefaultCentury;
};

View File

@ -232,7 +232,7 @@ public:
* ICU "poor man's RTTI", returns a UClassID for this class.
* @deprecated ICU 2.8 Use Collator::getSortKey(...) instead
*/
static UClassID getStaticClassID();
static UClassID U_EXPORT2 getStaticClassID();
private:
/**

View File

@ -425,7 +425,7 @@ public:
*
* @stable ICU 2.2
*/
static UClassID getStaticClassID();
static UClassID U_EXPORT2 getStaticClassID();
protected:

View File

@ -464,7 +464,7 @@ public:
* @return The class ID for all objects of this class.
* @stable ICU 2.0
*/
static UClassID getStaticClassID(void);
static UClassID U_EXPORT2 getStaticClassID(void);
/**
* Returns the binary format of the class's rules. The format is that of

View File

@ -125,7 +125,7 @@ public:
* @return the GMT time zone.
* @stable ICU 2.0
*/
static const TimeZone* getGMT(void);
static const TimeZone* U_EXPORT2 getGMT(void);
/**
* Creates a <code>TimeZone</code> for the given ID.
@ -138,7 +138,7 @@ public:
* return result.
* @stable ICU 2.0
*/
static TimeZone* createTimeZone(const UnicodeString& ID);
static TimeZone* U_EXPORT2 createTimeZone(const UnicodeString& ID);
/**
* Returns an enumeration over all recognized time zone IDs. (i.e.,
@ -147,7 +147,7 @@ public:
* @return an enumeration object, owned by the caller.
* @stable ICU 2.4
*/
static StringEnumeration* createEnumeration();
static StringEnumeration* U_EXPORT2 createEnumeration();
/**
* Returns an enumeration over time zone IDs with a given raw
@ -163,10 +163,10 @@ public:
*
* @param rawOffset an offset from GMT in milliseconds, ignoring
* the effect of daylight savings time, if any
* @return an enumeration object, owned by the caller
* @return an enumeration object, owned by the caller
* @stable ICU 2.4
*/
static StringEnumeration* createEnumeration(int32_t rawOffset);
static StringEnumeration* U_EXPORT2 createEnumeration(int32_t rawOffset);
/**
* Returns an enumeration over time zone IDs associated with the
@ -175,10 +175,10 @@ public:
*
* @param country The ISO 3166 two-letter country code, or NULL to
* retrieve zones not affiliated with any country.
* @return an enumeration object, owned by the caller
* @return an enumeration object, owned by the caller
* @stable ICU 2.4
*/
static StringEnumeration* createEnumeration(const char* country);
static StringEnumeration* U_EXPORT2 createEnumeration(const char* country);
#ifdef U_USE_TIMEZONE_OBSOLETE_2_8
/**
@ -260,7 +260,7 @@ public:
* @see #getEquivalentID
* @stable ICU 2.0
*/
static int32_t countEquivalentIDs(const UnicodeString& id);
static int32_t U_EXPORT2 countEquivalentIDs(const UnicodeString& id);
/**
* Returns an ID in the equivalency group that
@ -281,7 +281,7 @@ public:
* @see #countEquivalentIDs
* @stable ICU 2.0
*/
static const UnicodeString getEquivalentID(const UnicodeString& id,
static const UnicodeString U_EXPORT2 getEquivalentID(const UnicodeString& id,
int32_t index);
/**
@ -296,7 +296,7 @@ public:
* object returned.
* @stable ICU 2.0
*/
static TimeZone* createDefault(void);
static TimeZone* U_EXPORT2 createDefault(void);
/**
* Sets the default time zone (i.e., what's returned by getDefault()) to be the
@ -307,7 +307,7 @@ public:
* @param zone A pointer to the new TimeZone object to use as the default.
* @stable ICU 2.0
*/
static void adoptDefault(TimeZone* zone);
static void U_EXPORT2 adoptDefault(TimeZone* zone);
/**
* Same as adoptDefault(), except that the TimeZone object passed in is NOT adopted;
@ -316,7 +316,7 @@ public:
* @param zone The given timezone.
* @system
*/
static void setDefault(const TimeZone& zone);
static void U_EXPORT2 setDefault(const TimeZone& zone);
/**
* Returns true if the two TimeZones are equal. (The TimeZone version only compares
@ -578,11 +578,11 @@ public:
/**
* Return the class ID for this class. This is useful only for
* comparing to a return value from getDynamicClassID().
* comparing to a return value from getDynamicClassID().
* @return The class ID for all objects of this class.
* @stable ICU 2.0
*/
static UClassID getStaticClassID(void);
static UClassID U_EXPORT2 getStaticClassID(void);
/**
* Returns a unique class ID POLYMORPHICALLY. This method is to

View File

@ -300,7 +300,7 @@ private:
* the registration ID is being instantiated with this factory.
* @stable ICU 2.4
*/
typedef Transliterator* (*Factory)(const UnicodeString& ID, Token context);
typedef Transliterator* (U_EXPORT2 *Factory)(const UnicodeString& ID, Token context);
protected:
@ -723,7 +723,7 @@ public:
* @return A reference to 'result'.
* @stable ICU 2.0
*/
static UnicodeString& getDisplayName(const UnicodeString& ID,
static UnicodeString& U_EXPORT2 getDisplayName(const UnicodeString& ID,
UnicodeString& result);
/**
@ -747,7 +747,7 @@ public:
* @return A reference to 'result'.
* @stable ICU 2.0
*/
static UnicodeString& getDisplayName(const UnicodeString& ID,
static UnicodeString& U_EXPORT2 getDisplayName(const UnicodeString& ID,
const Locale& inLocale,
UnicodeString& result);
@ -820,7 +820,7 @@ public:
* @see #getID
* @stable ICU 2.0
*/
static Transliterator* createInstance(const UnicodeString& ID,
static Transliterator* U_EXPORT2 createInstance(const UnicodeString& ID,
UTransDirection dir,
UParseError& parseError,
UErrorCode& status);
@ -835,9 +835,10 @@ public:
* @return A <code>Transliterator</code> object with the given ID
* @stable ICU 2.0
*/
static Transliterator* createInstance(const UnicodeString& ID,
static Transliterator* U_EXPORT2 createInstance(const UnicodeString& ID,
UTransDirection dir,
UErrorCode& status);
/**
* Returns a <code>Transliterator</code> object constructed from
* the given rule string. This will be a RuleBasedTransliterator,
@ -853,7 +854,7 @@ public:
* @param status Output param set to success/failure code.
* @stable ICU 2.0
*/
static Transliterator* createFromRules(const UnicodeString& ID,
static Transliterator* U_EXPORT2 createFromRules(const UnicodeString& ID,
const UnicodeString& rules,
UTransDirection dir,
UParseError& parseError,
@ -969,7 +970,7 @@ public:
* the registration ID is being instantiated with this factory.
* @stable ICU 2.0
*/
static void registerFactory(const UnicodeString& id,
static void U_EXPORT2 registerFactory(const UnicodeString& id,
Factory factory,
Token context);
@ -990,7 +991,7 @@ public:
* @see #unregister
* @stable ICU 2.0
*/
static void registerInstance(Transliterator* adoptedObj);
static void U_EXPORT2 registerInstance(Transliterator* adoptedObj);
protected:
@ -1064,7 +1065,7 @@ public:
* @see #registerFactory
* @stable ICU 2.0
*/
static void unregister(const UnicodeString& ID);
static void U_EXPORT2 unregister(const UnicodeString& ID);
public:
@ -1077,14 +1078,14 @@ public:
* when done using it.
* @draft ICU 3.0
*/
static StringEnumeration* getAvailableIDs(UErrorCode& ec);
static StringEnumeration* U_EXPORT2 getAvailableIDs(UErrorCode& ec);
/**
* Return the number of registered source specifiers.
* @return the number of registered source specifiers.
* @stable ICU 2.0
*/
static int32_t countAvailableSources(void);
static int32_t U_EXPORT2 countAvailableSources(void);
/**
* Return a registered source specifier.
@ -1095,7 +1096,7 @@ public:
* @return reference to result
* @stable ICU 2.0
*/
static UnicodeString& getAvailableSource(int32_t index,
static UnicodeString& U_EXPORT2 getAvailableSource(int32_t index,
UnicodeString& result);
/**
@ -1106,7 +1107,7 @@ public:
* source specifier.
* @stable ICU 2.0
*/
static int32_t countAvailableTargets(const UnicodeString& source);
static int32_t U_EXPORT2 countAvailableTargets(const UnicodeString& source);
/**
* Return a registered target specifier for a given source.
@ -1119,7 +1120,7 @@ public:
* @return reference to result
* @stable ICU 2.0
*/
static UnicodeString& getAvailableTarget(int32_t index,
static UnicodeString& U_EXPORT2 getAvailableTarget(int32_t index,
const UnicodeString& source,
UnicodeString& result);
@ -1130,7 +1131,7 @@ public:
* @param target the target specifiers.
* @stable ICU 2.0
*/
static int32_t countAvailableVariants(const UnicodeString& source,
static int32_t U_EXPORT2 countAvailableVariants(const UnicodeString& source,
const UnicodeString& target);
/**
@ -1146,7 +1147,7 @@ public:
* @return reference to result
* @stable ICU 2.0
*/
static UnicodeString& getAvailableVariant(int32_t index,
static UnicodeString& U_EXPORT2 getAvailableVariant(int32_t index,
const UnicodeString& source,
const UnicodeString& target,
UnicodeString& result);
@ -1210,7 +1211,7 @@ public:
/**
* Return the class ID for this class. This is useful only for
* comparing to a return value from getDynamicClassID().
* comparing to a return value from getDynamicClassID().
* Note that Transliterator is an abstract base class, and therefor
* no fully constructed object will have a dynamic
* UCLassID that equals the UClassID returned from
@ -1218,7 +1219,7 @@ public:
* @return The class ID for class Transliterator.
* @stable ICU 2.0
*/
static UClassID getStaticClassID(void);
static UClassID U_EXPORT2 getStaticClassID(void);
/**
* Returns a unique class ID <b>polymorphically</b>. This method
@ -1248,7 +1249,7 @@ public:
* @return the number of IDs currently registered with the system.
* @obsolete ICU 3.4 use getAvailableIDs() instead
*/
static int32_t countAvailableIDs(void);
static int32_t U_EXPORT2 countAvailableIDs(void);
/**
* Return the index-th available ID. index must be between 0
@ -1262,7 +1263,7 @@ public:
* is not thread safe, since it returns a reference to storage that
* may become invalid if another thread calls unregister
*/
static const UnicodeString& getAvailableID(int32_t index);
static const UnicodeString& U_EXPORT2 getAvailableID(int32_t index);
};
inline int32_t Transliterator::getMaximumContextLength(void) const {

View File

@ -40,12 +40,6 @@ class ReplaceableGlue : public Replaceable {
UReplaceable *rep;
UReplaceableCallbacks *func;
/**
* The address of this static class variable serves as this class's ID
* for ICU "poor man's RTTI".
*/
static const char fgClassID;
public:
ReplaceableGlue(UReplaceable *replaceable,
@ -70,14 +64,14 @@ public:
*
* @draft ICU 2.2
*/
virtual inline UClassID getDynamicClassID() const { return getStaticClassID(); }
virtual inline UClassID getDynamicClassID() const;
/**
* ICU "poor man's RTTI", returns a UClassID for this class.
*
* @draft ICU 2.2
*/
static inline UClassID getStaticClassID() { return (UClassID)&fgClassID; }
static inline UClassID U_EXPORT2 getStaticClassID();
protected:
@ -88,8 +82,7 @@ protected:
virtual UChar32 getChar32At(int32_t offset) const;
};
const char ReplaceableGlue::fgClassID=0;
UOBJECT_DEFINE_RTTI_IMPLEMENTATION(ReplaceableGlue)
ReplaceableGlue::ReplaceableGlue(UReplaceable *replaceable,
UReplaceableCallbacks *funcCallback)

View File

@ -3646,7 +3646,7 @@ void TransliteratorTest::TestMulticharStringSet() {
Transliterator* _TUFF[4];
UnicodeString* _TUFID[4];
static Transliterator* _TUFFactory(const UnicodeString& /*ID*/,
static Transliterator* U_EXPORT2 _TUFFactory(const UnicodeString& /*ID*/,
Transliterator::Token context) {
return _TUFF[context.integer]->clone();
}