Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 16 additions & 16 deletions icu4c/source/common/servloc.h
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ class U_COMMON_API ICUResourceBundleFactory : public LocaleKeyFactory
******************************************************************
*/

class U_COMMON_API ICULocaleService : public ICUService
class U_COMMON_API_CLASS ICULocaleService : public ICUService
{
private:
Locale fallbackLocale;
Expand All @@ -432,17 +432,17 @@ class U_COMMON_API ICULocaleService : public ICUService
/**
* Construct an ICULocaleService.
*/
ICULocaleService();
U_COMMON_API ICULocaleService();

/**
* Construct an ICULocaleService with a name (useful for debugging).
*/
ICULocaleService(const UnicodeString& name);
U_COMMON_API ICULocaleService(const UnicodeString& name);

/**
* Destructor.
*/
virtual ~ICULocaleService();
U_COMMON_API virtual ~ICULocaleService();

#if 0
// redeclare because of overload resolution rules?
Expand All @@ -462,47 +462,47 @@ class U_COMMON_API ICULocaleService : public ICUService
* get(Locale, int, Locale[]) with KIND_ANY for kind and null for
* actualReturn.
*/
UObject* get(const Locale& locale, UErrorCode& status) const;
U_COMMON_API UObject* get(const Locale& locale, UErrorCode& status) const;

/**
* Convenience override for callers using locales. This calls
* get(Locale, int, Locale[]) with a null actualReturn.
*/
UObject* get(const Locale& locale, int32_t kind, UErrorCode& status) const;
U_COMMON_API UObject* get(const Locale& locale, int32_t kind, UErrorCode& status) const;

/**
* Convenience override for callers using locales. This calls
* get(Locale, String, Locale[]) with a null kind.
*/
UObject* get(const Locale& locale, Locale* actualReturn, UErrorCode& status) const;
U_COMMON_API UObject* get(const Locale& locale, Locale* actualReturn, UErrorCode& status) const;

/**
* Convenience override for callers using locales. This uses
* createKey(Locale.toString(), kind) to create a key, calls getKey, and then
* if actualReturn is not null, returns the actualResult from
* getKey (stripping any prefix) into a Locale.
*/
UObject* get(const Locale& locale, int32_t kind, Locale* actualReturn, UErrorCode& status) const;
U_COMMON_API UObject* get(const Locale& locale, int32_t kind, Locale* actualReturn, UErrorCode& status) const;

/**
* Convenience override for callers using locales. This calls
* registerObject(Object, Locale, int32_t kind, int coverage)
* passing KIND_ANY for the kind, and VISIBLE for the coverage.
*/
virtual URegistryKey registerInstance(UObject* objToAdopt, const Locale& locale, UErrorCode& status);
U_COMMON_API virtual URegistryKey registerInstance(UObject* objToAdopt, const Locale& locale, UErrorCode& status);

/**
* Convenience function for callers using locales. This calls
* registerObject(Object, Locale, int kind, int coverage)
* passing VISIBLE for the coverage.
*/
virtual URegistryKey registerInstance(UObject* objToAdopt, const Locale& locale, int32_t kind, UErrorCode& status);
U_COMMON_API virtual URegistryKey registerInstance(UObject* objToAdopt, const Locale& locale, int32_t kind, UErrorCode& status);

/**
* Convenience function for callers using locales. This instantiates
* a SimpleLocaleKeyFactory, and registers the factory.
*/
virtual URegistryKey registerInstance(UObject* objToAdopt, const Locale& locale, int32_t kind, int32_t coverage, UErrorCode& status);
U_COMMON_API virtual URegistryKey registerInstance(UObject* objToAdopt, const Locale& locale, int32_t kind, int32_t coverage, UErrorCode& status);


/**
Expand All @@ -512,31 +512,31 @@ class U_COMMON_API ICULocaleService : public ICUService
* We really need a flag that is understood by all compilers that will suppress the warning about
* hidden overrides.
*/
virtual URegistryKey registerInstance(UObject* objToAdopt, const UnicodeString& locale, UBool visible, UErrorCode& status) override;
U_COMMON_API virtual URegistryKey registerInstance(UObject* objToAdopt, const UnicodeString& locale, UBool visible, UErrorCode& status) override;

/**
* Convenience method for callers using locales. This returns the standard
* service ID enumeration.
*/
virtual StringEnumeration* getAvailableLocales() const;
U_COMMON_API virtual StringEnumeration* getAvailableLocales() const;

protected:

/**
* Return the name of the current fallback locale. If it has changed since this was
* last accessed, the service cache is cleared.
*/
const UnicodeString& validateFallbackLocale() const;
U_COMMON_API const UnicodeString& validateFallbackLocale() const;

/**
* Override superclass createKey method.
*/
virtual ICUServiceKey* createKey(const UnicodeString* id, UErrorCode& status) const override;
U_COMMON_API virtual ICUServiceKey* createKey(const UnicodeString* id, UErrorCode& status) const override;

/**
* Additional createKey that takes a kind.
*/
virtual ICUServiceKey* createKey(const UnicodeString* id, int32_t kind, UErrorCode& status) const;
U_COMMON_API virtual ICUServiceKey* createKey(const UnicodeString* id, int32_t kind, UErrorCode& status) const;

friend class ServiceEnumeration;
};
Expand Down
78 changes: 39 additions & 39 deletions icu4c/source/common/ulocimp.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,95 +55,95 @@ uloc_getCurrentCountryID(const char* oldID);
U_CFUNC const char*
uloc_getCurrentLanguageID(const char* oldID);

U_EXPORT std::optional<std::string_view>
U_COMMON_API std::optional<std::string_view>
ulocimp_toBcpKeyWithFallback(std::string_view keyword);

U_EXPORT std::optional<std::string_view>
U_COMMON_API std::optional<std::string_view>
ulocimp_toBcpTypeWithFallback(std::string_view keyword, std::string_view value);

U_EXPORT std::optional<std::string_view>
U_COMMON_API std::optional<std::string_view>
ulocimp_toLegacyKeyWithFallback(std::string_view keyword);

U_EXPORT std::optional<std::string_view>
U_COMMON_API std::optional<std::string_view>
ulocimp_toLegacyTypeWithFallback(std::string_view keyword, std::string_view value);

U_EXPORT icu::CharString
U_COMMON_API icu::CharString
ulocimp_getKeywords(std::string_view localeID,
char prev,
bool valuesToo,
UErrorCode& status);

U_EXPORT void
U_COMMON_API void
ulocimp_getKeywords(std::string_view localeID,
char prev,
icu::ByteSink& sink,
bool valuesToo,
UErrorCode& status);

U_EXPORT icu::CharString
U_COMMON_API icu::CharString
ulocimp_getName(std::string_view localeID,
UErrorCode& err);

U_EXPORT void
U_COMMON_API void
ulocimp_getName(std::string_view localeID,
icu::ByteSink& sink,
UErrorCode& err);

U_EXPORT icu::CharString
U_COMMON_API icu::CharString
ulocimp_getBaseName(std::string_view localeID,
UErrorCode& err);

U_EXPORT void
U_COMMON_API void
ulocimp_getBaseName(std::string_view localeID,
icu::ByteSink& sink,
UErrorCode& err);

U_EXPORT icu::CharString
U_COMMON_API icu::CharString
ulocimp_canonicalize(std::string_view localeID,
UErrorCode& err);

U_EXPORT void
U_COMMON_API void
ulocimp_canonicalize(std::string_view localeID,
icu::ByteSink& sink,
UErrorCode& err);

U_EXPORT icu::CharString
U_COMMON_API icu::CharString
ulocimp_getKeywordValue(const char* localeID,
std::string_view keywordName,
UErrorCode& status);

U_EXPORT void
U_COMMON_API void
ulocimp_getKeywordValue(const char* localeID,
std::string_view keywordName,
icu::ByteSink& sink,
UErrorCode& status);

U_EXPORT icu::CharString
U_COMMON_API icu::CharString
ulocimp_getLanguage(std::string_view localeID, UErrorCode& status);

U_EXPORT icu::CharString
U_COMMON_API icu::CharString
ulocimp_getScript(std::string_view localeID, UErrorCode& status);

U_EXPORT icu::CharString
U_COMMON_API icu::CharString
ulocimp_getRegion(std::string_view localeID, UErrorCode& status);

U_EXPORT icu::CharString
U_COMMON_API icu::CharString
ulocimp_getVariant(std::string_view localeID, UErrorCode& status);

U_EXPORT void
U_COMMON_API void
ulocimp_setKeywordValue(std::string_view keywordName,
std::string_view keywordValue,
icu::CharString& localeID,
UErrorCode& status);

U_EXPORT int32_t
U_COMMON_API int32_t
ulocimp_setKeywordValue(std::string_view keywords,
std::string_view keywordName,
std::string_view keywordValue,
icu::ByteSink& sink,
UErrorCode& status);

U_EXPORT void
U_COMMON_API void
ulocimp_getSubtags(
std::string_view localeID,
icu::CharString* language,
Expand All @@ -153,7 +153,7 @@ ulocimp_getSubtags(
const char** pEnd,
UErrorCode& status);

U_EXPORT void
U_COMMON_API void
ulocimp_getSubtags(
std::string_view localeID,
icu::ByteSink* language,
Expand Down Expand Up @@ -182,16 +182,16 @@ ulocimp_getSubtags(
status);
}

U_EXPORT icu::CharString
U_COMMON_API icu::CharString
ulocimp_getParent(const char* localeID,
UErrorCode& err);

U_EXPORT void
U_COMMON_API void
ulocimp_getParent(const char* localeID,
icu::ByteSink& sink,
UErrorCode& err);

U_EXPORT icu::CharString
U_COMMON_API icu::CharString
ulocimp_toLanguageTag(const char* localeID,
bool strict,
UErrorCode& status);
Expand All @@ -215,13 +215,13 @@ ulocimp_toLanguageTag(const char* localeID,
*
* @internal ICU 64
*/
U_EXPORT void
U_COMMON_API void
ulocimp_toLanguageTag(const char* localeID,
icu::ByteSink& sink,
bool strict,
UErrorCode& err);

U_EXPORT icu::CharString
U_COMMON_API icu::CharString
ulocimp_forLanguageTag(const char* langtag,
int32_t tagLen,
int32_t* parsedLength,
Expand Down Expand Up @@ -253,7 +253,7 @@ ulocimp_forLanguageTag(const char* langtag,
* failed.
* @internal ICU 63
*/
U_EXPORT void
U_COMMON_API void
ulocimp_forLanguageTag(const char* langtag,
int32_t tagLen,
icu::ByteSink& sink,
Expand All @@ -280,11 +280,11 @@ ulocimp_forLanguageTag(const char* langtag,
* The region code found, empty if none found.
* @internal ICU 57
*/
U_EXPORT icu::CharString
U_COMMON_API icu::CharString
ulocimp_getRegionForSupplementalData(const char *localeID, bool inferRegion,
UErrorCode& status);

U_EXPORT icu::CharString
U_COMMON_API icu::CharString
ulocimp_addLikelySubtags(const char* localeID,
UErrorCode& status);

Expand Down Expand Up @@ -317,12 +317,12 @@ ulocimp_addLikelySubtags(const char* localeID,
* or the localeId is not well-formed, the error code is U_ILLEGAL_ARGUMENT_ERROR.
* @internal ICU 64
*/
U_EXPORT void
U_COMMON_API void
ulocimp_addLikelySubtags(const char* localeID,
icu::ByteSink& sink,
UErrorCode& err);

U_EXPORT icu::CharString
U_COMMON_API icu::CharString
ulocimp_minimizeSubtags(const char* localeID,
bool favorScript,
UErrorCode& status);
Expand Down Expand Up @@ -357,7 +357,7 @@ ulocimp_minimizeSubtags(const char* localeID,
* or the localeId is not well-formed, the error code is U_ILLEGAL_ARGUMENT_ERROR.
* @internal ICU 64
*/
U_EXPORT void
U_COMMON_API void
ulocimp_minimizeSubtags(const char* localeID,
icu::ByteSink& sink,
bool favorScript,
Expand Down Expand Up @@ -405,24 +405,24 @@ ultag_isVariantSubtags(const char* s, int32_t len);
const char*
ultag_getTKeyStart(const char* localeID);

U_EXPORT std::optional<std::string_view>
U_COMMON_API std::optional<std::string_view>
ulocimp_toBcpKey(std::string_view key);

U_EXPORT std::optional<std::string_view>
U_COMMON_API std::optional<std::string_view>
ulocimp_toLegacyKey(std::string_view key);

U_EXPORT std::optional<std::string_view>
U_COMMON_API std::optional<std::string_view>
ulocimp_toBcpType(std::string_view key, std::string_view type);

U_EXPORT std::optional<std::string_view>
U_COMMON_API std::optional<std::string_view>
ulocimp_toLegacyType(std::string_view key, std::string_view type);

/* Function for testing purpose */
U_EXPORT const char* const*
U_COMMON_API const char* const*
ulocimp_getKnownCanonicalizedLocaleForTest(int32_t& length);

// Return true if the value is already canonicalized.
U_EXPORT bool
U_COMMON_API bool
ulocimp_isCanonicalizedLocaleForTest(const char* localeName);

#ifdef __cplusplus
Expand Down
Loading