ILocaleKey class provides an access mechanism for any localizable resources. The purpose of the locale key component is to provide support for identifying linguistic and local conventions.
Since locales are only a mechanism that allows programmers to access certain resources associated with a given country or region, the ILocaleKey itself is not a set of objects. Rather, it is a key that can be used to access a particular international object. Many international objects can be created using a locale. As a convenience, there is a default locale that is used when none is specified. The locale key mechanism is intended to be used with Unicode text manipulation. Note : International objects are those whose data/code may depend on the country or language, and which are used to support globalized programs. Globalized programs are those written so that they work no matter what language or country they are used with. Examples of international objects are collation, date, time, or number classes.
Do not derive your own classes from this class.
Constructors & DestructorUse the constructors and destructor in this group to create and destroy objects of class ILocaleKey.
![]() |
public:
~ILocaleKey()
| Windows | OS/2 | AIX |
| Yes | Yes | Yes |
![]() |
public:
ILocaleKey(const ILocaleKey& that)
| Windows | OS/2 | AIX |
| Yes | Yes | Yes |
public:
ILocaleKey()
| Windows | OS/2 | AIX |
| Yes | Yes | Yes |
public:
ILocaleKey( const IText& languageID, const IText& regionID = IText ( ), const IText& extension = IText ( ) )
| IInvalidParameter | If an invalid locale ID is given. |
| IInvalidRequestion | When the valid locale ID corresponds to a supported locale that is not installed on the machine; there is no international resources associated with the locale, an IInvalidRequest exception will be thrown. |
| Windows | OS/2 | AIX |
| Yes | Yes | Yes |
public:
ILocaleKey(unsigned long hostLocaleID)
| IInvalidParameter | If an invalid locale ID is given. |
| IInvalidRequestion | When the valid locale ID corresponds to a supported locale that is not installed on the machine; there is no international resources associated with the locale, an IInvalidRequest exception will be thrown. |
| Windows | OS/2 | AIX |
| Yes | Yes | Yes |
Assignment OperatorUse the operator in this group to replace the current locale key object with the given one.
![]() |
public:
ILocaleKey& operator =(const ILocaleKey& that)
| Windows | OS/2 | AIX |
| Yes | Yes | Yes |
Comparing the Given and Current ILocaleKey Objects for Equality or InequalityUse the operators in this group to test the given ILocaleKey object against the current one for equality or inequality.
![]() |
public:
bool operator !=(const ILocaleKey& other) const
| Windows | OS/2 | AIX |
| Yes | Yes | Yes |
![]() |
public:
bool operator ==(const ILocaleKey& other) const
| Windows | OS/2 | AIX |
| Yes | Yes | Yes |
Creating an ILocaleKey Object from the Default LocaleUse this function to create a locale key object based on the default locale.
![]() |
public:
static ILocaleKey defaultLocale()
| Windows | OS/2 | AIX |
| Yes | Yes | Yes |
Displayable NameUse the functions in this group to obtain the locale's displayable based on the given key, language, and search values.
![]() |
public:
IText displayName( const ILocaleKey& desiredLanguage = defaultLocale ( ), ELookupStrategy strategy = kAnyLanguage ) const
| IOutofSystemResource | If there is no display name for the given locale and the locale has associated international resources. |
| IInvalidRequest | If the locale is supported but not installed. |
| IInvalidParameter | If the locale ID is invalid. |
| Windows | OS/2 | AIX |
| Yes | Yes | Yes |
public:
static IText displayName( const IText& key, const ILocaleKey& desiredLanguage = defaultLocale ( ), ELookupStrategy strategy = kAnyLanguage )
| IOutofSystemResource | If there is no display name for the given locale and the locale has associated international resources. |
| IInvalidRequest | If the locale is supported but not installed. |
| IInvalidParameter | If the locale ID is invalid. |
| Windows | OS/2 | AIX |
| Yes | Yes | Yes |
Getting and Setting the ILocaleKey InformationUse these functions to get and set the entire POSIX ID, which is composed of a language ID, region ID and extension, or any of its parts. Using the functions in this group, you can also get and set the host locale ID of the ILocaleKey object and determine whether the current locale is the POSIX C or POSIX locale.
![]() |
public:
IText extension() const
| Windows | OS/2 | AIX |
| Yes | Yes | Yes |
![]() |
public:
unsigned long hostID() const
| Windows | OS/2 | AIX |
| Yes | Yes | Yes |
![]() |
public:
bool isCLocale() const
| Windows | OS/2 | AIX |
| Yes | Yes | Yes |
![]() |
public:
IText languageID() const
| Windows | OS/2 | AIX |
| Yes | Yes | Yes |
![]() |
public:
IText posixID() const
| Windows | OS/2 | AIX |
| Yes | Yes | Yes |
![]() |
public:
IText regionID() const
| Windows | OS/2 | AIX |
| Yes | Yes | Yes |
![]() |
public:
void setExtension(const IText& extension)
| IInvalidParameter | If the new POSIX ID is not a valid locale ID, set the POSIX ID to be the valid locale with the same language ID (the region ID and extension will be ignored). If no corresponding locale can be found, throws the IInvalidParameter exception. |
| IInvalidRequest | If the new POSIX ID of the matched locale is supported but not installed on the machine; there is no associated international resources, an IInvalidRequest exception will be thrown. |
| Windows | OS/2 | AIX |
| Yes | Yes | Yes |
![]() |
public:
void setHostID(unsigned long localeID)
| Windows | OS/2 | AIX |
| Yes | Yes | Yes |
![]() |
public:
void setLanguageID(const IText& languageID)
| IInvalidParameter | If the new POSIX ID is not a valid locale ID, set the POSIX ID to be the valid locale with the same language ID (the region ID and extension will be ignored). If no corresponding locale can be found, throws the IInvalidParameter exception. |
| IInvalidRequest | If the new POSIX ID of the matched locale is supported but not installed on the machine; there is no associated international resources, an IInvalidRequest exception will be thrown. |
| Windows | OS/2 | AIX |
| Yes | Yes | Yes |
![]() |
public:
void setPOSIXID(const IText& localeID)
| IInvalidParameter | If the POSIX ID is not a valid locale ID, set the POSIX ID to be the valid locale with the same language ID (the region ID and extension will be ignored). If no corresponding locale can be found, throws the IInvalidParameter exception. |
| IInvalidRequest | If the POSIX ID of the matched locale is supported but not installed on the machine; there is no associated international resources, an IInvalidRequest exception will be thrown. |
| Windows | OS/2 | AIX |
| Yes | Yes | Yes |
![]() |
public:
void setRegionID(const IText& regionID)
| IInvalidParameter | If the new POSIX ID is not a valid locale ID, set the POSIX ID to be the valid locale with the same language ID (the region ID and extension will be ignored). If no corresponding locale can be found, throws the IInvalidParameter exception. |
| IInvalidRequest | If the new POSIX ID of the matched locale is supported but not installed on the machine; there is no associated international resources, an IInvalidRequest exception will be thrown. |
| Windows | OS/2 | AIX |
| Yes | Yes | Yes |
Streaming an ILocaleKey Object In and OutUse these functions to read the ILocaleKey object in from the given stream or write it out to it.
![]() |
protected:
virtual void readFromStream(IDataStream& fromWhere)
| Windows | OS/2 | AIX |
| Yes | Yes | Yes |
![]() |
protected:
virtual void writeToStream(IDataStream& toWhere) const
| Windows | OS/2 | AIX |
| Yes | Yes | Yes |
![]() |
enum ELookupStrategy { kExactLocale,
kExactLanguage,
kAnyLanguage }| Windows | OS/2 | AIX |
| Yes | Yes | Yes |
virtual ~IMStreamable()
void externalizeToStream(IDataStream& towhere) const
void internalizeFromStream(IDataStream& fromwhere)
virtual const ITypeRepresentation& typeRepresentation() const = 0
IMStreamable()
IMStreamable(const IMStreamable& other)
virtual void readFromStream(IDataStream& fromwhere) = 0
virtual void writeToStream(IDataStream& towhere) const = 0