]>
git.saurik.com Git - apple/icu.git/blob - icuSources/common/servslkf.cpp
2 *******************************************************************************
3 * Copyright (C) 2001-2014, 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"
22 #define UNDERSCORE_CHAR ((UChar)0x005f)
23 #define AT_SIGN_CHAR ((UChar)64)
24 #define PERIOD_CHAR ((UChar)46)
29 ******************************************************************
32 SimpleLocaleKeyFactory::SimpleLocaleKeyFactory(UObject
* objToAdopt
,
33 const UnicodeString
& locale
,
36 : LocaleKeyFactory(coverage
)
43 SimpleLocaleKeyFactory::SimpleLocaleKeyFactory(UObject
* objToAdopt
,
47 : LocaleKeyFactory(coverage
)
52 LocaleUtility::initNameFromLocale(locale
, _id
);
55 SimpleLocaleKeyFactory::~SimpleLocaleKeyFactory()
62 SimpleLocaleKeyFactory::create(const ICUServiceKey
& key
, const ICUService
* service
, UErrorCode
& status
) const
64 if (U_SUCCESS(status
)) {
65 const LocaleKey
& lkey
= (const LocaleKey
&)key
;
66 if (_kind
== LocaleKey::KIND_ANY
|| _kind
== lkey
.kind()) {
68 lkey
.currentID(keyID
);
70 return service
->cloneInstance(_obj
);
78 //SimpleLocaleKeyFactory::isSupportedID(const UnicodeString& id, UErrorCode& /* status */) const
84 SimpleLocaleKeyFactory::updateVisibleIDs(Hashtable
& result
, UErrorCode
& status
) const
86 if (U_SUCCESS(status
)) {
87 if (_coverage
& 0x1) {
90 result
.put(_id
, (void*)this, status
);
97 SimpleLocaleKeyFactory::debug(UnicodeString
& result
) const
99 LocaleKeyFactory::debug(result
);
100 result
.append((UnicodeString
)", id: ");
102 result
.append((UnicodeString
)", kind: ");
103 result
.append(_kind
);
108 SimpleLocaleKeyFactory::debugClass(UnicodeString
& result
) const
110 return result
.append((UnicodeString
)"SimpleLocaleKeyFactory");
114 UOBJECT_DEFINE_RTTI_IMPLEMENTATION(SimpleLocaleKeyFactory
)
118 /* !UCONFIG_NO_SERVICE */