2 ******************************************************************************
3 * Copyright (C) 1996-2012, International Business Machines Corporation and
4 * others. All Rights Reserved.
5 ******************************************************************************
11 * Created by: Helena Shih
13 * Modification History:
15 * Date Name Description
16 * 2/5/97 aliu Modified createDefault to load collation data from
17 * binary files when possible. Added related methods
18 * createCollationFromFile, chopLocale, createPathName.
19 * 2/11/97 aliu Added methods addToCache, findInCache, which implement
20 * a Collation cache. Modified createDefault to look in
21 * cache first, and also to store newly created Collation
22 * objects in the cache. Modified to not use gLocPath.
23 * 2/12/97 aliu Modified to create objects from RuleBasedCollator cache.
24 * Moved cache out of Collation class.
25 * 2/13/97 aliu Moved several methods out of this class and into
26 * RuleBasedCollator, with modifications. Modified
27 * createDefault() to call new RuleBasedCollator(Locale&)
28 * constructor. General clean up and documentation.
29 * 2/20/97 helena Added clone, operator==, operator!=, operator=, and copy
31 * 05/06/97 helena Added memory allocation error detection.
32 * 05/08/97 helena Added createInstance().
33 * 6/20/97 helena Java class name change.
34 * 04/23/99 stephen Removed EDecompositionMode, merged with
36 * 11/23/9 srl Inlining of some critical functions
37 * 01/29/01 synwee Modified into a C++ wrapper calling C APIs (ucol.h)
40 #include "utypeinfo.h" // for 'typeid' to work
42 #include "unicode/utypes.h"
44 #if !UCONFIG_NO_COLLATION
46 #include "unicode/coll.h"
47 #include "unicode/tblcoll.h"
57 static icu::Locale
* availableLocaleList
= NULL
;
58 static int32_t availableLocaleListCount
;
59 static icu::ICULocaleService
* gService
= NULL
;
62 * Release all static memory held by collator.
65 static UBool U_CALLCONV
collator_cleanup(void) {
66 #if !UCONFIG_NO_SERVICE
72 if (availableLocaleList
) {
73 delete []availableLocaleList
;
74 availableLocaleList
= NULL
;
76 availableLocaleListCount
= 0;
85 #if !UCONFIG_NO_SERVICE
87 // ------------------------------------------
92 //-------------------------------------------
94 CollatorFactory::~CollatorFactory() {}
96 //-------------------------------------------
99 CollatorFactory::visible(void) const {
103 //-------------------------------------------
106 CollatorFactory::getDisplayName(const Locale
& objectLocale
,
107 const Locale
& displayLocale
,
108 UnicodeString
& result
)
110 return objectLocale
.getDisplayName(displayLocale
, result
);
113 // -------------------------------------
115 class ICUCollatorFactory
: public ICUResourceBundleFactory
{
117 ICUCollatorFactory() : ICUResourceBundleFactory(UnicodeString(U_ICUDATA_COLL
, -1, US_INV
)) { }
118 virtual ~ICUCollatorFactory();
120 virtual UObject
* create(const ICUServiceKey
& key
, const ICUService
* service
, UErrorCode
& status
) const;
123 ICUCollatorFactory::~ICUCollatorFactory() {}
126 ICUCollatorFactory::create(const ICUServiceKey
& key
, const ICUService
* /* service */, UErrorCode
& status
) const {
127 if (handlesKey(key
, status
)) {
128 const LocaleKey
& lkey
= (const LocaleKey
&)key
;
130 // make sure the requested locale is correct
131 // default LocaleFactory uses currentLocale since that's the one vetted by handlesKey
132 // but for ICU rb resources we use the actual one since it will fallback again
133 lkey
.canonicalLocale(loc
);
135 return Collator::makeInstance(loc
, status
);
140 // -------------------------------------
142 class ICUCollatorService
: public ICULocaleService
{
145 : ICULocaleService(UNICODE_STRING_SIMPLE("Collator"))
147 UErrorCode status
= U_ZERO_ERROR
;
148 registerFactory(new ICUCollatorFactory(), status
);
151 virtual ~ICUCollatorService();
153 virtual UObject
* cloneInstance(UObject
* instance
) const {
154 return ((Collator
*)instance
)->clone();
157 virtual UObject
* handleDefault(const ICUServiceKey
& key
, UnicodeString
* actualID
, UErrorCode
& status
) const {
158 LocaleKey
& lkey
= (LocaleKey
&)key
;
160 // Ugly Hack Alert! We return an empty actualID to signal
161 // to callers that this is a default object, not a "real"
162 // service-created object. (TODO remove in 3.0) [aliu]
163 actualID
->truncate(0);
166 lkey
.canonicalLocale(loc
);
167 return Collator::makeInstance(loc
, status
);
170 virtual UObject
* getKey(ICUServiceKey
& key
, UnicodeString
* actualReturn
, UErrorCode
& status
) const {
172 if (actualReturn
== NULL
) {
175 Collator
* result
= (Collator
*)ICULocaleService::getKey(key
, actualReturn
, status
);
176 // Ugly Hack Alert! If the actualReturn length is zero, this
177 // means we got a default object, not a "real" service-created
178 // object. We don't call setLocales() on a default object,
179 // because that will overwrite its correct built-in locale
180 // metadata (valid & actual) with our incorrect data (all we
181 // have is the requested locale). (TODO remove in 3.0) [aliu]
182 if (result
&& actualReturn
->length() > 0) {
183 const LocaleKey
& lkey
= (const LocaleKey
&)key
;
184 Locale
canonicalLocale("");
185 Locale
currentLocale("");
187 LocaleUtility::initLocaleFromName(*actualReturn
, currentLocale
);
188 result
->setLocales(lkey
.canonicalLocale(canonicalLocale
), currentLocale
, currentLocale
);
193 virtual UBool
isDefault() const {
194 return countFactories() == 1;
198 ICUCollatorService::~ICUCollatorService() {}
200 // -------------------------------------
202 static ICULocaleService
*
206 UMTX_CHECK(NULL
, (UBool
)(gService
== NULL
), needInit
);
208 ICULocaleService
*newservice
= new ICUCollatorService();
211 if(gService
== NULL
) {
212 gService
= newservice
;
221 ucln_i18n_registerCleanup(UCLN_I18N_COLLATOR
, collator_cleanup
);
227 // -------------------------------------
233 UMTX_CHECK(NULL
, gService
!= NULL
, retVal
);
237 // -------------------------------------
240 Collator::createUCollator(const char *loc
,
243 UCollator
*result
= 0;
244 if (status
&& U_SUCCESS(*status
) && hasService()) {
245 Locale
desiredLocale(loc
);
246 Collator
*col
= (Collator
*)gService
->get(desiredLocale
, *status
);
247 RuleBasedCollator
*rbc
;
248 if (col
&& (rbc
= dynamic_cast<RuleBasedCollator
*>(col
))) {
249 if (!rbc
->dataIsOwned
) {
250 result
= ucol_safeClone(rbc
->ucollator
, NULL
, NULL
, status
);
252 result
= rbc
->ucollator
;
253 rbc
->ucollator
= NULL
; // to prevent free on delete
256 // should go in a function- ucol_initDelegate(delegate)
257 result
= (UCollator
*)uprv_malloc(sizeof(UCollator
));
259 *status
= U_MEMORY_ALLOCATION_ERROR
;
261 uprv_memset(result
, 0, sizeof(UCollator
));
262 result
->delegate
= col
;
263 result
->freeOnClose
= TRUE
; // do free on close.
264 col
= NULL
; // to prevent free on delete.
271 #endif /* UCONFIG_NO_SERVICE */
273 static UBool
isAvailableLocaleListInitialized(UErrorCode
&status
) {
274 // for now, there is a hardcoded list, so just walk through that list and set it up.
276 UMTX_CHECK(NULL
, availableLocaleList
== NULL
, needInit
);
279 UResourceBundle
*index
= NULL
;
280 UResourceBundle installed
;
285 ures_initStackObject(&installed
);
286 index
= ures_openDirect(U_ICUDATA_COLL
, "res_index", &status
);
287 ures_getByKey(index
, "InstalledLocales", &installed
, &status
);
289 if(U_SUCCESS(status
)) {
290 localeCount
= ures_getSize(&installed
);
291 temp
= new Locale
[localeCount
];
294 ures_resetIterator(&installed
);
295 while(ures_hasNext(&installed
)) {
296 const char *tempKey
= NULL
;
297 ures_getNextString(&installed
, NULL
, &tempKey
, &status
);
298 temp
[i
++] = Locale(tempKey
);
302 if (availableLocaleList
== NULL
)
304 availableLocaleListCount
= localeCount
;
305 availableLocaleList
= temp
;
307 ucln_i18n_registerCleanup(UCLN_I18N_COLLATOR
, collator_cleanup
);
317 ures_close(&installed
);
324 // Collator public methods -----------------------------------------------
326 Collator
* U_EXPORT2
Collator::createInstance(UErrorCode
& success
)
328 return createInstance(Locale::getDefault(), success
);
331 Collator
* U_EXPORT2
Collator::createInstance(const Locale
& desiredLocale
,
334 if (U_FAILURE(status
))
337 #if !UCONFIG_NO_SERVICE
341 (Collator
*)gService
->get(desiredLocale
, &actualLoc
, status
);
343 // Ugly Hack Alert! If the returned locale is empty (not root,
344 // but empty -- getName() == "") then that means the service
345 // returned a default object, not a "real" service object. In
346 // that case, the locale metadata (valid & actual) is setup
347 // correctly already, and we don't want to overwrite it. (TODO
348 // remove in 3.0) [aliu]
349 if (*actualLoc
.getName() != 0) {
350 result
->setLocales(desiredLocale
, actualLoc
, actualLoc
);
355 return makeInstance(desiredLocale
, status
);
359 Collator
* Collator::makeInstance(const Locale
& desiredLocale
,
362 // A bit of explanation is required here. Although in the current
364 // Collator::createInstance() is just turning around and calling
365 // RuleBasedCollator(Locale&), this will not necessarily always be the
366 // case. For example, suppose we modify this code to handle a
367 // non-table-based Collator, such as that for Thai. In this case,
368 // createInstance() will have to be modified to somehow determine this fact
369 // (perhaps a field in the resource bundle). Then it can construct the
370 // non-table-based Collator in some other way, when it sees that it needs
372 // The specific caution is this: RuleBasedCollator(Locale&) will ALWAYS
373 // return a valid collation object, if the system is functioning properly.
374 // The reason is that it will fall back, use the default locale, and even
375 // use the built-in default collation rules. THEREFORE, createInstance()
376 // should in general ONLY CALL RuleBasedCollator(Locale&) IF IT KNOWS IN
377 // ADVANCE that the given locale's collation is properly implemented as a
378 // RuleBasedCollator.
379 // Currently, we don't do this...we always return a RuleBasedCollator,
380 // whether it is strictly correct to do so or not, without checking, because
381 // we currently have no way of checking.
383 RuleBasedCollator
* collation
= new RuleBasedCollator(desiredLocale
,
386 if (collation
== 0) {
387 status
= U_MEMORY_ALLOCATION_ERROR
;
390 if (U_FAILURE(status
))
398 #ifdef U_USE_COLLATION_OBSOLETE_2_6
399 // !!! dlf the following is obsolete, ignore registration for this
402 Collator::createInstance(const Locale
&loc
,
403 UVersionInfo version
,
409 collator
=new RuleBasedCollator(loc
, status
);
412 status
= U_MEMORY_ALLOCATION_ERROR
;
416 if(U_SUCCESS(status
)) {
417 collator
->getVersion(info
);
418 if(0!=uprv_memcmp(version
, info
, sizeof(UVersionInfo
))) {
420 status
=U_MISSING_RESOURCE_ERROR
;
429 Collator::safeClone() const {
433 // implement deprecated, previously abstract method
434 Collator::EComparisonResult
Collator::compare(const UnicodeString
& source
,
435 const UnicodeString
& target
) const
437 UErrorCode ec
= U_ZERO_ERROR
;
438 return (EComparisonResult
)compare(source
, target
, ec
);
441 // implement deprecated, previously abstract method
442 Collator::EComparisonResult
Collator::compare(const UnicodeString
& source
,
443 const UnicodeString
& target
,
444 int32_t length
) const
446 UErrorCode ec
= U_ZERO_ERROR
;
447 return (EComparisonResult
)compare(source
, target
, length
, ec
);
450 // implement deprecated, previously abstract method
451 Collator::EComparisonResult
Collator::compare(const UChar
* source
, int32_t sourceLength
,
452 const UChar
* target
, int32_t targetLength
)
455 UErrorCode ec
= U_ZERO_ERROR
;
456 return (EComparisonResult
)compare(source
, sourceLength
, target
, targetLength
, ec
);
459 UCollationResult
Collator::compare(UCharIterator
&/*sIter*/,
460 UCharIterator
&/*tIter*/,
461 UErrorCode
&status
) const {
462 if(U_SUCCESS(status
)) {
463 // Not implemented in the base class.
464 status
= U_UNSUPPORTED_ERROR
;
469 UCollationResult
Collator::compareUTF8(const StringPiece
&source
,
470 const StringPiece
&target
,
471 UErrorCode
&status
) const {
472 if(U_FAILURE(status
)) {
475 UCharIterator sIter
, tIter
;
476 uiter_setUTF8(&sIter
, source
.data(), source
.length());
477 uiter_setUTF8(&tIter
, target
.data(), target
.length());
478 return compare(sIter
, tIter
, status
);
481 UBool
Collator::equals(const UnicodeString
& source
,
482 const UnicodeString
& target
) const
484 UErrorCode ec
= U_ZERO_ERROR
;
485 return (compare(source
, target
, ec
) == UCOL_EQUAL
);
488 UBool
Collator::greaterOrEqual(const UnicodeString
& source
,
489 const UnicodeString
& target
) const
491 UErrorCode ec
= U_ZERO_ERROR
;
492 return (compare(source
, target
, ec
) != UCOL_LESS
);
495 UBool
Collator::greater(const UnicodeString
& source
,
496 const UnicodeString
& target
) const
498 UErrorCode ec
= U_ZERO_ERROR
;
499 return (compare(source
, target
, ec
) == UCOL_GREATER
);
502 // this API ignores registered collators, since it returns an
503 // array of indefinite lifetime
504 const Locale
* U_EXPORT2
Collator::getAvailableLocales(int32_t& count
)
506 UErrorCode status
= U_ZERO_ERROR
;
507 Locale
*result
= NULL
;
509 if (isAvailableLocaleListInitialized(status
))
511 result
= availableLocaleList
;
512 count
= availableLocaleListCount
;
517 UnicodeString
& U_EXPORT2
Collator::getDisplayName(const Locale
& objectLocale
,
518 const Locale
& displayLocale
,
521 #if !UCONFIG_NO_SERVICE
523 UnicodeString locNameStr
;
524 LocaleUtility::initNameFromLocale(objectLocale
, locNameStr
);
525 return gService
->getDisplayName(locNameStr
, name
, displayLocale
);
528 return objectLocale
.getDisplayName(displayLocale
, name
);
531 UnicodeString
& U_EXPORT2
Collator::getDisplayName(const Locale
& objectLocale
,
534 return getDisplayName(objectLocale
, Locale::getDefault(), name
);
537 /* This is useless information */
538 /*void Collator::getVersion(UVersionInfo versionInfo) const
540 if (versionInfo!=NULL)
541 uprv_memcpy(versionInfo, fVersion, U_MAX_VERSION_LENGTH);
545 // UCollator protected constructor destructor ----------------------------
548 * Default constructor.
549 * Constructor is different from the old default Collator constructor.
550 * The task for determing the default collation strength and normalization mode
551 * is left to the child class.
560 * Empty constructor, does not handle the arguments.
561 * This constructor is done for backward compatibility with 1.7 and 1.8.
562 * The task for handling the argument collation strength and normalization
563 * mode is left to the child class.
564 * @param collationStrength collation strength
565 * @param decompositionMode
566 * @deprecated 2.4 use the default constructor instead
568 Collator::Collator(UCollationStrength
, UNormalizationMode
)
573 Collator::~Collator()
577 Collator::Collator(const Collator
&other
)
582 UBool
Collator::operator==(const Collator
& other
) const
584 // Subclasses: Call this method and then add more specific checks.
585 return typeid(*this) == typeid(other
);
588 UBool
Collator::operator!=(const Collator
& other
) const
590 return (UBool
)!(*this == other
);
593 int32_t U_EXPORT2
Collator::getBound(const uint8_t *source
,
594 int32_t sourceLength
,
595 UColBoundMode boundType
,
598 int32_t resultLength
,
601 return ucol_getBound(source
, sourceLength
, boundType
, noOfLevels
, result
, resultLength
, &status
);
605 Collator::setLocales(const Locale
& /* requestedLocale */, const Locale
& /* validLocale */, const Locale
& /*actualLocale*/) {
608 UnicodeSet
*Collator::getTailoredSet(UErrorCode
&status
) const
610 if(U_FAILURE(status
)) {
613 // everything can be changed
614 return new UnicodeSet(0, 0x10FFFF);
617 // -------------------------------------
619 #if !UCONFIG_NO_SERVICE
620 URegistryKey U_EXPORT2
621 Collator::registerInstance(Collator
* toAdopt
, const Locale
& locale
, UErrorCode
& status
)
623 if (U_SUCCESS(status
)) {
624 return getService()->registerInstance(toAdopt
, locale
, status
);
629 // -------------------------------------
631 class CFactory
: public LocaleKeyFactory
{
633 CollatorFactory
* _delegate
;
637 CFactory(CollatorFactory
* delegate
, UErrorCode
& status
)
638 : LocaleKeyFactory(delegate
->visible() ? VISIBLE
: INVISIBLE
)
639 , _delegate(delegate
)
642 if (U_SUCCESS(status
)) {
644 _ids
= new Hashtable(status
);
646 const UnicodeString
* idlist
= _delegate
->getSupportedIDs(count
, status
);
647 for (int i
= 0; i
< count
; ++i
) {
648 _ids
->put(idlist
[i
], (void*)this, status
);
649 if (U_FAILURE(status
)) {
656 status
= U_MEMORY_ALLOCATION_ERROR
;
663 virtual UObject
* create(const ICUServiceKey
& key
, const ICUService
* service
, UErrorCode
& status
) const;
666 virtual const Hashtable
* getSupportedIDs(UErrorCode
& status
) const
668 if (U_SUCCESS(status
)) {
674 virtual UnicodeString
&
675 getDisplayName(const UnicodeString
& id
, const Locale
& locale
, UnicodeString
& result
) const;
678 CFactory::~CFactory()
685 CFactory::create(const ICUServiceKey
& key
, const ICUService
* /* service */, UErrorCode
& status
) const
687 if (handlesKey(key
, status
)) {
688 const LocaleKey
& lkey
= (const LocaleKey
&)key
;
690 lkey
.currentLocale(validLoc
);
691 return _delegate
->createCollator(validLoc
);
697 CFactory::getDisplayName(const UnicodeString
& id
, const Locale
& locale
, UnicodeString
& result
) const
699 if ((_coverage
& 0x1) == 0) {
700 UErrorCode status
= U_ZERO_ERROR
;
701 const Hashtable
* ids
= getSupportedIDs(status
);
702 if (ids
&& (ids
->get(id
) != NULL
)) {
704 LocaleUtility::initLocaleFromName(id
, loc
);
705 return _delegate
->getDisplayName(loc
, locale
, result
);
712 URegistryKey U_EXPORT2
713 Collator::registerFactory(CollatorFactory
* toAdopt
, UErrorCode
& status
)
715 if (U_SUCCESS(status
)) {
716 CFactory
* f
= new CFactory(toAdopt
, status
);
718 return getService()->registerFactory(f
, status
);
720 status
= U_MEMORY_ALLOCATION_ERROR
;
725 // -------------------------------------
728 Collator::unregister(URegistryKey key
, UErrorCode
& status
)
730 if (U_SUCCESS(status
)) {
732 return gService
->unregister(key
, status
);
734 status
= U_ILLEGAL_ARGUMENT_ERROR
;
738 #endif /* UCONFIG_NO_SERVICE */
740 class CollationLocaleListEnumeration
: public StringEnumeration
{
744 static UClassID U_EXPORT2
getStaticClassID(void);
745 virtual UClassID
getDynamicClassID(void) const;
747 CollationLocaleListEnumeration()
750 // The global variables should already be initialized.
751 //isAvailableLocaleListInitialized(status);
754 virtual ~CollationLocaleListEnumeration();
756 virtual StringEnumeration
* clone() const
758 CollationLocaleListEnumeration
*result
= new CollationLocaleListEnumeration();
760 result
->index
= index
;
765 virtual int32_t count(UErrorCode
&/*status*/) const {
766 return availableLocaleListCount
;
769 virtual const char* next(int32_t* resultLength
, UErrorCode
& /*status*/) {
771 if(index
< availableLocaleListCount
) {
772 result
= availableLocaleList
[index
++].getName();
773 if(resultLength
!= NULL
) {
774 *resultLength
= (int32_t)uprv_strlen(result
);
777 if(resultLength
!= NULL
) {
785 virtual const UnicodeString
* snext(UErrorCode
& status
) {
786 int32_t resultLength
= 0;
787 const char *s
= next(&resultLength
, status
);
788 return setChars(s
, resultLength
, status
);
791 virtual void reset(UErrorCode
& /*status*/) {
796 CollationLocaleListEnumeration::~CollationLocaleListEnumeration() {}
798 UOBJECT_DEFINE_RTTI_IMPLEMENTATION(CollationLocaleListEnumeration
)
801 // -------------------------------------
803 StringEnumeration
* U_EXPORT2
804 Collator::getAvailableLocales(void)
806 #if !UCONFIG_NO_SERVICE
808 return getService()->getAvailableLocales();
810 #endif /* UCONFIG_NO_SERVICE */
811 UErrorCode status
= U_ZERO_ERROR
;
812 if (isAvailableLocaleListInitialized(status
)) {
813 return new CollationLocaleListEnumeration();
818 StringEnumeration
* U_EXPORT2
819 Collator::getKeywords(UErrorCode
& status
) {
820 // This is a wrapper over ucol_getKeywords
821 UEnumeration
* uenum
= ucol_getKeywords(&status
);
822 if (U_FAILURE(status
)) {
826 return new UStringEnumeration(uenum
);
829 StringEnumeration
* U_EXPORT2
830 Collator::getKeywordValues(const char *keyword
, UErrorCode
& status
) {
831 // This is a wrapper over ucol_getKeywordValues
832 UEnumeration
* uenum
= ucol_getKeywordValues(keyword
, &status
);
833 if (U_FAILURE(status
)) {
837 return new UStringEnumeration(uenum
);
840 StringEnumeration
* U_EXPORT2
841 Collator::getKeywordValuesForLocale(const char* key
, const Locale
& locale
,
842 UBool commonlyUsed
, UErrorCode
& status
) {
843 // This is a wrapper over ucol_getKeywordValuesForLocale
844 UEnumeration
*uenum
= ucol_getKeywordValuesForLocale(key
, locale
.getName(),
845 commonlyUsed
, &status
);
846 if (U_FAILURE(status
)) {
850 return new UStringEnumeration(uenum
);
854 Collator::getFunctionalEquivalent(const char* keyword
, const Locale
& locale
,
855 UBool
& isAvailable
, UErrorCode
& status
) {
856 // This is a wrapper over ucol_getFunctionalEquivalent
857 char loc
[ULOC_FULLNAME_CAPACITY
];
858 /*int32_t len =*/ ucol_getFunctionalEquivalent(loc
, sizeof(loc
),
859 keyword
, locale
.getName(), &isAvailable
, &status
);
860 if (U_FAILURE(status
)) {
863 return Locale::createFromName(loc
);
866 Collator::ECollationStrength
867 Collator::getStrength(void) const {
868 UErrorCode intStatus
= U_ZERO_ERROR
;
869 return (ECollationStrength
)getAttribute(UCOL_STRENGTH
, intStatus
);
873 Collator::setStrength(ECollationStrength newStrength
) {
874 UErrorCode intStatus
= U_ZERO_ERROR
;
875 setAttribute(UCOL_STRENGTH
, (UColAttributeValue
)newStrength
, intStatus
);
879 Collator::getReorderCodes(int32_t* /* dest*/,
880 int32_t /* destCapacity*/,
881 UErrorCode
& status
) const
883 if (U_SUCCESS(status
)) {
884 status
= U_UNSUPPORTED_ERROR
;
890 Collator::setReorderCodes(const int32_t* /* reorderCodes */,
891 int32_t /* reorderCodesLength */,
894 if (U_SUCCESS(status
)) {
895 status
= U_UNSUPPORTED_ERROR
;
900 Collator::getEquivalentReorderCodes(int32_t /* reorderCode */,
902 int32_t /* destCapacity */,
905 if (U_SUCCESS(status
)) {
906 status
= U_UNSUPPORTED_ERROR
;
912 Collator::internalGetShortDefinitionString(const char * /*locale*/,
914 int32_t /*capacity*/,
915 UErrorCode
&status
) const {
916 if(U_SUCCESS(status
)) {
917 status
= U_UNSUPPORTED_ERROR
; /* Shouldn't happen, internal function */
922 // UCollator private data members ----------------------------------------
924 /* This is useless information */
925 /*const UVersionInfo Collator::fVersion = {1, 1, 0, 0};*/
927 // -------------------------------------
931 #endif /* #if !UCONFIG_NO_COLLATION */