ICU-2202 getLocale implementation for formatting classes and calendar

X-SVN-Rev: 13779
This commit is contained in:
Vladimir Weinstein 2003-11-19 23:51:38 +00:00
parent b8b1565afe
commit 9f871e852f
7 changed files with 59 additions and 6 deletions

View File

@ -1998,8 +1998,8 @@ private:
*/
static uint8_t julianDayToDayOfWeek(double julian);
Locale validLocale;
Locale actualLocale;
char validLocale[50];
char actualLocale[50];
public:
/**
@ -2077,7 +2077,7 @@ private:
* @return the locale
* @draft ICU 2.8
*/
virtual Locale getLocale(ULocDataLocaleType type, UErrorCode &status);
virtual Locale getLocale(ULocDataLocaleType type, UErrorCode &status) const;
/** Get the locale for this calendar object. You can choose between valid and actual locale.
* @param type type of the locale we're looking for (valid or actual)
@ -2085,7 +2085,7 @@ private:
* @return the locale
* @internal
*/
virtual const char* getLocaleInternal(ULocDataLocaleType type, UErrorCode &status);
virtual const char* getLocaleInternal(ULocDataLocaleType type, UErrorCode &status) const;
};

View File

@ -609,7 +609,7 @@ public:
* @return the locale
* @draft ICU 2.8
*/
virtual Locale getLocale(ULocDataLocaleType type, UErrorCode& status) const;
virtual Locale getLocale(ULocDataLocaleType type, UErrorCode& status) const = 0;
protected:
/**

View File

@ -378,6 +378,12 @@ private:
UnicodeString fLocalPatternChars;
private:
/** valid/actual locale information
* these are always ICU locales, so the length should not be a problem
*/
char validLocale[50];
char actualLocale[50];
/* Sizes for the last resort string arrays */
typedef enum LastResortSize {

View File

@ -241,6 +241,14 @@ public:
*/
virtual Locale getLocale(ULocDataLocaleType type, UErrorCode& status) const = 0;
/** Get the locale for this format object. You can choose between valid and actual locale.
* @param type type of the locale we're looking for (valid or actual)
* @param status error code for the operation
* @return the locale
* @internal
*/
virtual const char* getLocaleInternal(ULocDataLocaleType type, UErrorCode &status) const = 0;
protected:
/**
* Default constructor for subclass use only. Does nothing.

View File

@ -595,7 +595,9 @@ public:
*/
static UClassID getStaticClassID(void);
/** Get the locale for this date format object. You can choose between valid and actual locale.
/** Get the locale for this message format object. You can choose between valid and actual locale.
* In the case of message format, both locales are the same as the locale passed during the
* construction.
* @param type type of the locale we're looking for (valid or actual)
* @param status error code for the operation
* @return the locale
@ -603,6 +605,16 @@ public:
*/
virtual Locale getLocale(ULocDataLocaleType type, UErrorCode& status) const;
/** Get the locale for this message format object. You can choose between valid and actual locale.
* In the case of message format, both locales are the same as the locale passed during the
* construction.
* @param type type of the locale we're looking for (valid or actual)
* @param status error code for the operation
* @return the locale
* @internal
*/
virtual const char* getLocaleInternal(ULocDataLocaleType type, UErrorCode &status) const;
private:
Locale fLocale;

View File

@ -624,6 +624,14 @@ public:
*/
virtual Locale getLocale(ULocDataLocaleType type, UErrorCode& status) const;
/** Get the locale for this numeric format object. You can choose between valid and actual locale.
* @param type type of the locale we're looking for (valid or actual)
* @param status error code for the operation
* @return the locale
* @internal
*/
virtual const char* getLocaleInternal(ULocDataLocaleType type, UErrorCode &status) const;
public:
/**
@ -665,6 +673,9 @@ private:
private:
char validLocale[50];
char actualLocale[50];
enum EStyles {
kNumberStyle,
kCurrencyStyle,

View File

@ -583,6 +583,22 @@ public:
*/
virtual void adoptCalendar(Calendar* calendarToAdopt);
/** Get the locale for this date format object. You can choose between valid and actual locale.
* @param type type of the locale we're looking for (valid or actual)
* @param status error code for the operation
* @return the locale
* @draft ICU 2.8
*/
virtual Locale getLocale(ULocDataLocaleType type, UErrorCode& status) const;
/** Get the locale for this date format object. You can choose between valid and actual locale.
* @param type type of the locale we're looking for (valid or actual)
* @param status error code for the operation
* @return the locale
* @internal
*/
virtual const char* getLocaleInternal(ULocDataLocaleType type, UErrorCode &status) const;
private:
friend class DateFormat;