]>
git.saurik.com Git - apple/icu.git/blob - icuSources/common/servslkf.cpp
2 *******************************************************************************
3 * Copyright (C) 2001-2005, International Business Machines Corporation and *
4 * others. All Rights Reserved. *
5 *******************************************************************************
7 *******************************************************************************
9 #include "unicode/utypes.h"
11 #if !UCONFIG_NO_SERVICE
13 #include "unicode/resbund.h"
23 #define UNDERSCORE_CHAR ((UChar)0x005f)
24 #define AT_SIGN_CHAR ((UChar)64)
25 #define PERIOD_CHAR ((UChar)46)
30 ******************************************************************
33 SimpleLocaleKeyFactory::SimpleLocaleKeyFactory(UObject
* objToAdopt
,
34 const UnicodeString
& locale
,
37 : LocaleKeyFactory(coverage
)
44 SimpleLocaleKeyFactory::SimpleLocaleKeyFactory(UObject
* objToAdopt
,
48 : LocaleKeyFactory(coverage
)
53 LocaleUtility::initNameFromLocale(locale
, _id
);
56 SimpleLocaleKeyFactory::~SimpleLocaleKeyFactory()
63 SimpleLocaleKeyFactory::create(const ICUServiceKey
& key
, const ICUService
* service
, UErrorCode
& status
) const
65 if (U_SUCCESS(status
)) {
66 const LocaleKey
& lkey
= (const LocaleKey
&)key
;
67 if (_kind
== LocaleKey::KIND_ANY
|| _kind
== lkey
.kind()) {
69 lkey
.currentID(keyID
);
71 return service
->cloneInstance(_obj
);
79 //SimpleLocaleKeyFactory::isSupportedID(const UnicodeString& id, UErrorCode& /* status */) const
85 SimpleLocaleKeyFactory::updateVisibleIDs(Hashtable
& result
, UErrorCode
& status
) const
87 if (U_SUCCESS(status
)) {
88 if (_coverage
& 0x1) {
91 result
.put(_id
, (void*)this, status
);
98 SimpleLocaleKeyFactory::debug(UnicodeString
& result
) const
100 LocaleKeyFactory::debug(result
);
101 result
.append(", id: ");
103 result
.append(", kind: ");
104 result
.append(_kind
);
109 SimpleLocaleKeyFactory::debugClass(UnicodeString
& result
) const
111 return result
.append("SimpleLocaleKeyFactory");
115 UOBJECT_DEFINE_RTTI_IMPLEMENTATION(SimpleLocaleKeyFactory
)
119 /* !UCONFIG_NO_SERVICE */