ICU-882 #ifdef the deprecated API out.
X-SVN-Rev: 3907
This commit is contained in:
parent
2b117c5c1a
commit
a733836b79
@ -441,7 +441,7 @@ Locale::getVariant() const
|
||||
return variant;
|
||||
}
|
||||
|
||||
#ifndef ICU_LOCID_NO_DEPRECATES
|
||||
#ifdef ICU_LOCID_USE_DEPRECATES
|
||||
UnicodeString&
|
||||
Locale::getLanguage(UnicodeString& lang) const
|
||||
{
|
||||
@ -490,7 +490,7 @@ Locale::getISO3Country() const
|
||||
return uloc_getISO3Country(fullName);
|
||||
}
|
||||
|
||||
#ifndef ICU_LOCID_NO_DEPRECATES
|
||||
#ifdef ICU_LOCID_USE_DEPRECATES
|
||||
UnicodeString&
|
||||
Locale::getISO3Language(UnicodeString& lang, UErrorCode& status) const
|
||||
{
|
||||
@ -751,7 +751,7 @@ const char* const* Locale::getISOLanguages()
|
||||
}
|
||||
|
||||
|
||||
#ifndef ICU_LOCID_NO_DEPRECATES
|
||||
#ifdef ICU_LOCID_USE_DEPRECATES
|
||||
/**
|
||||
* Returns a list of all 2-letter country codes defined in ISO 3166.
|
||||
* Can be used to create Locales.
|
||||
@ -901,7 +901,7 @@ void Locale::setFromPOSIXID(const char *posixID)
|
||||
init(posixID);
|
||||
}
|
||||
|
||||
#ifndef ICU_LOCID_NO_DEPRECATES
|
||||
#ifdef ICU_LOCID_USE_DEPRECATES
|
||||
// Deprecated APIs
|
||||
Locale::Locale( const UnicodeString& newLanguage)
|
||||
{
|
||||
|
@ -54,13 +54,13 @@
|
||||
#include "unistrm.h"
|
||||
#include "filestrm.h"
|
||||
#include "cstring.h"
|
||||
#include "uhash.h"
|
||||
#include "uresimp.h"
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include "cmemory.h"
|
||||
|
||||
#ifdef ICU_RESBUND_USE_DEPRECATES
|
||||
#include "uhash.h"
|
||||
#endif
|
||||
|
||||
/*-----------------------------------------------------------------------------
|
||||
* Implementation Notes
|
||||
@ -193,7 +193,9 @@ ResourceBundle::ResourceBundle( const UnicodeString& path,
|
||||
}
|
||||
|
||||
ResourceBundle::ResourceBundle(UErrorCode &err) {
|
||||
#ifdef ICU_RESBUND_USE_DEPRECATES
|
||||
fItemCache = 0;
|
||||
#endif
|
||||
resource = ures_open(0, Locale::getDefault().getName(), &err);
|
||||
if(U_SUCCESS(err)) {
|
||||
fRealLocale = Locale(ures_getRealLocale(resource, &err));
|
||||
@ -218,7 +220,9 @@ ResourceBundle::ResourceBundle( const UnicodeString& path,
|
||||
UErrorCode& status)
|
||||
: fRealLocale(localeName)
|
||||
{
|
||||
#ifdef ICU_RESBUND_USE_DEPRECATES
|
||||
fItemCache = 0;
|
||||
#endif
|
||||
int32_t patlen = path.length();
|
||||
|
||||
if(patlen > 0) {
|
||||
@ -245,27 +249,31 @@ ResourceBundle::ResourceBundle(const wchar_t* path,
|
||||
ResourceBundle::ResourceBundle(const ResourceBundle &other) {
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
|
||||
if(other.resource->fIsTopLevel == TRUE) {
|
||||
if(other.resource->fIsTopLevel == TRUE) {
|
||||
constructForLocale(ures_getPath(other.resource), Locale(ures_getName(other.resource)), status);
|
||||
} else {
|
||||
resource = 0;
|
||||
fItemCache = 0;
|
||||
resource = copyResb(0, other.resource, &status);
|
||||
}
|
||||
} else {
|
||||
#ifdef ICU_RESBUND_USE_DEPRECATES
|
||||
fItemCache = 0;
|
||||
#endif
|
||||
resource = copyResb(0, other.resource, &status);
|
||||
}
|
||||
}
|
||||
|
||||
ResourceBundle::ResourceBundle(UResourceBundle *res, UErrorCode& err) {
|
||||
resource = 0;
|
||||
#ifdef ICU_RESBUND_USE_DEPRECATES
|
||||
fItemCache = 0;
|
||||
#endif
|
||||
resource = copyResb(0, res, &err);
|
||||
}
|
||||
|
||||
ResourceBundle::ResourceBundle( const char* path, const Locale& locale, UErrorCode& err) {
|
||||
fItemCache = 0;
|
||||
resource = ures_open(path, locale.getName(), &err);
|
||||
if(U_SUCCESS(err)) {
|
||||
fRealLocale = Locale(ures_getRealLocale(resource, &err));
|
||||
}
|
||||
#ifdef ICU_RESBUND_USE_DEPRECATES
|
||||
fItemCache = 0;
|
||||
#endif
|
||||
resource = ures_open(path, locale.getName(), &err);
|
||||
if(U_SUCCESS(err)) {
|
||||
fRealLocale = Locale(ures_getRealLocale(resource, &err));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -275,11 +283,12 @@ ResourceBundle& ResourceBundle::operator=(const ResourceBundle& other)
|
||||
if(this == &other) {
|
||||
return *this;
|
||||
}
|
||||
|
||||
#ifdef ICU_RESBUND_USE_DEPRECATES
|
||||
if(fItemCache != 0) {
|
||||
uhash_close(fItemCache);
|
||||
fItemCache = 0;
|
||||
}
|
||||
#endif
|
||||
if(resource != 0) {
|
||||
ures_close(resource);
|
||||
resource = 0;
|
||||
@ -295,9 +304,11 @@ ResourceBundle& ResourceBundle::operator=(const ResourceBundle& other)
|
||||
|
||||
ResourceBundle::~ResourceBundle()
|
||||
{
|
||||
#ifdef ICU_RESBUND_USE_DEPRECATES
|
||||
if(fItemCache != 0) {
|
||||
uhash_close(fItemCache);
|
||||
}
|
||||
#endif
|
||||
if(resource != 0) {
|
||||
ures_close(resource);
|
||||
}
|
||||
@ -308,12 +319,14 @@ ResourceBundle::deleteValue(void *value) {
|
||||
delete (ResourceBundleData *)value;
|
||||
}
|
||||
|
||||
#ifdef ICU_RESBUND_USE_DEPRECATES
|
||||
void ResourceBundle::initItemCache(UErrorCode& error) {
|
||||
if(fItemCache == 0) {
|
||||
fItemCache = uhash_open(uhash_hashChars, uhash_compareChars, &error);
|
||||
uhash_setValueDeleter(fItemCache, deleteValue);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
void
|
||||
ResourceBundle::constructForLocale(const UnicodeString& path,
|
||||
@ -321,9 +334,11 @@ ResourceBundle::constructForLocale(const UnicodeString& path,
|
||||
UErrorCode& error)
|
||||
{
|
||||
char name[128];
|
||||
fItemCache = 0;
|
||||
int32_t patlen = path.length();
|
||||
|
||||
#ifdef ICU_RESBUND_USE_DEPRECATES
|
||||
fItemCache = 0;
|
||||
#endif
|
||||
|
||||
if(patlen > 0) {
|
||||
path.extract(0, patlen, name);
|
||||
@ -342,7 +357,9 @@ ResourceBundle::constructForLocale(const wchar_t* path,
|
||||
const Locale& locale,
|
||||
UErrorCode& error)
|
||||
{
|
||||
#ifdef ICU_RESBUND_USE_DEPRECATES
|
||||
fItemCache = 0;
|
||||
#endif
|
||||
|
||||
if(path != 0) {
|
||||
resource = ures_openW(path, locale.getName(), &error);
|
||||
@ -452,6 +469,7 @@ const Locale &ResourceBundle::getLocale(void) const
|
||||
return fRealLocale;
|
||||
}
|
||||
|
||||
#ifdef ICU_RESBUND_USE_DEPRECATES
|
||||
// Start deprecated API
|
||||
const UnicodeString*
|
||||
ResourceBundle::getString( const char *resourceTag,
|
||||
@ -715,12 +733,7 @@ ResourceBundle::getTaggedArray( const char *resourceTag,
|
||||
return;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
//eof
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -211,7 +211,7 @@ public:
|
||||
* needed.
|
||||
* @stable
|
||||
*/
|
||||
Locale();
|
||||
Locale();
|
||||
|
||||
/**
|
||||
* Construct a locale from language, country, variant.
|
||||
@ -222,10 +222,11 @@ public:
|
||||
* description. (optional)
|
||||
* @draft
|
||||
*/
|
||||
Locale( const char * language,
|
||||
const char * country = 0,
|
||||
const char * variant = 0);
|
||||
#ifndef ICU_LOCID_NO_DEPRECATES
|
||||
Locale( const char * language,
|
||||
const char * country = 0,
|
||||
const char * variant = 0);
|
||||
|
||||
#ifdef ICU_LOCID_USE_DEPRECATES
|
||||
/**
|
||||
* Construct a locale from language, country, variant.
|
||||
*
|
||||
@ -235,9 +236,9 @@ public:
|
||||
* description. (optional)
|
||||
* @deprecated Remove in the first release of 2001.
|
||||
*/
|
||||
Locale( const UnicodeString& language,
|
||||
const UnicodeString& country ,
|
||||
const UnicodeString& variant );
|
||||
Locale( const UnicodeString& language,
|
||||
const UnicodeString& country ,
|
||||
const UnicodeString& variant );
|
||||
|
||||
/**
|
||||
* Construct a locale from language, country.
|
||||
@ -246,8 +247,8 @@ public:
|
||||
* @param country Uppercase two-letter ISO-3166 code. (optional)
|
||||
* @deprecated Remove in the first release of 2001.
|
||||
*/
|
||||
Locale( const UnicodeString& language,
|
||||
const UnicodeString& country );
|
||||
Locale( const UnicodeString& language,
|
||||
const UnicodeString& country );
|
||||
|
||||
/**
|
||||
* Construct a locale from language.
|
||||
@ -255,24 +256,24 @@ public:
|
||||
* @param language Lowercase two-letter ISO-639 code.
|
||||
* @deprecated Remove in the first release of 2001.
|
||||
*/
|
||||
Locale( const UnicodeString& language);
|
||||
Locale( const UnicodeString& language);
|
||||
|
||||
|
||||
#endif /* ICU_LOCID_NO_DEPRECATES */
|
||||
#endif /* ICU_LOCID_USE_DEPRECATES */
|
||||
/**
|
||||
* Initializes a Locale object from another Locale object.
|
||||
*
|
||||
* @param other The Locale object being copied in.
|
||||
* @stable
|
||||
*/
|
||||
Locale(const Locale& other);
|
||||
Locale(const Locale& other);
|
||||
|
||||
|
||||
/**
|
||||
* Destructor
|
||||
* @stable
|
||||
*/
|
||||
~Locale() ;
|
||||
~Locale() ;
|
||||
|
||||
/**
|
||||
* Replaces the entire contents of *this with the specified value.
|
||||
@ -281,7 +282,7 @@ public:
|
||||
* @return *this
|
||||
* @stable
|
||||
*/
|
||||
Locale& operator=(const Locale& other);
|
||||
Locale& operator=(const Locale& other);
|
||||
|
||||
/**
|
||||
* Checks if two locale keys are the same.
|
||||
@ -290,7 +291,7 @@ public:
|
||||
* @return True if the two locale keys are the same, false otherwise.
|
||||
* @stable
|
||||
*/
|
||||
UBool operator==(const Locale& other) const;
|
||||
UBool operator==(const Locale& other) const;
|
||||
|
||||
/**
|
||||
* Checks if two locale keys are not the same.
|
||||
@ -300,7 +301,7 @@ public:
|
||||
* otherwise.
|
||||
* @stable
|
||||
*/
|
||||
UBool operator!=(const Locale& other) const;
|
||||
UBool operator!=(const Locale& other) const;
|
||||
|
||||
/**
|
||||
* Common methods of getting the current default Locale. Used for the
|
||||
@ -316,7 +317,7 @@ public:
|
||||
* @system
|
||||
* @stable
|
||||
*/
|
||||
static Locale& getDefault(void);
|
||||
static Locale& getDefault(void);
|
||||
|
||||
/**
|
||||
* Sets the default. Normally set once at the beginning of applet or
|
||||
@ -326,7 +327,7 @@ public:
|
||||
* @system
|
||||
* @stable
|
||||
*/
|
||||
static void setDefault(const Locale& newLocale,
|
||||
static void setDefault(const Locale& newLocale,
|
||||
UErrorCode& success);
|
||||
|
||||
|
||||
@ -347,19 +348,21 @@ public:
|
||||
* @return An alias to the code
|
||||
* @draft
|
||||
*/
|
||||
const char * getLanguage( ) const;
|
||||
const char * getLanguage( ) const;
|
||||
|
||||
/**
|
||||
* Returns the locale's two-letter ISO-3166 country code.
|
||||
* @return An alias to the code
|
||||
* @draft
|
||||
*/
|
||||
const char * getCountry( ) const;
|
||||
const char * getCountry( ) const;
|
||||
|
||||
/**
|
||||
* Returns the locale's variant code.
|
||||
* @return An alias to the code
|
||||
* @draft
|
||||
*/
|
||||
const char * getVariant( ) const;
|
||||
const char * getVariant( ) const;
|
||||
|
||||
/**
|
||||
* Returns the programmatic name of the entire locale, with the language,
|
||||
@ -368,7 +371,7 @@ public:
|
||||
* "de__POSIX", "fr__MAC", "__MAC", "_MT", "_FR_EURO"
|
||||
* @return A pointer to "name".
|
||||
*/
|
||||
const char * getName() const;
|
||||
const char * getName() const;
|
||||
|
||||
/**
|
||||
* returns the locale's three-letter language code, as specified
|
||||
@ -376,16 +379,16 @@ public:
|
||||
* @return An alias to the code, or NULL
|
||||
* @draft
|
||||
*/
|
||||
const char * getISO3Language() const;
|
||||
const char * getISO3Language() const;
|
||||
|
||||
/**
|
||||
* Fills in "name" with the locale's three-letter ISO-3166 country code.
|
||||
* @return An alias to the code, or NULL
|
||||
* @draft
|
||||
*/
|
||||
const char * getISO3Country() const;
|
||||
const char * getISO3Country() const;
|
||||
|
||||
#ifndef ICU_LOCID_NO_DEPRECATES
|
||||
#ifdef ICU_LOCID_USE_DEPRECATES
|
||||
/* begin deprecated versions */
|
||||
|
||||
/**
|
||||
@ -441,8 +444,8 @@ public:
|
||||
*/
|
||||
UnicodeString& getISO3Country( UnicodeString& name, UErrorCode& status) const;
|
||||
|
||||
/* END deprecated [ ICU_LOCID_NO_DEPRECATES ] */
|
||||
#endif /* ICU_LOCID_NO_DEPRECATES */
|
||||
/* END deprecated [ ICU_LOCID_USE_DEPRECATES ] */
|
||||
#endif /* ICU_LOCID_USE_DEPRECATES */
|
||||
/**
|
||||
* Returns the Windows LCID value corresponding to this locale.
|
||||
* This value is stored in the resource data for the locale as a one-to-four-digit
|
||||
@ -450,7 +453,7 @@ public:
|
||||
* there is no Windows LCID value that corresponds to this locale, returns 0.
|
||||
* @stable
|
||||
*/
|
||||
uint32_t getLCID(void) const;
|
||||
uint32_t getLCID(void) const;
|
||||
|
||||
/**
|
||||
* Fills in "dispLang" with the name of this locale's language in a format suitable for
|
||||
@ -461,7 +464,7 @@ public:
|
||||
* @return A reference to "dispLang".
|
||||
* @stable
|
||||
*/
|
||||
UnicodeString& getDisplayLanguage(UnicodeString& dispLang) const;
|
||||
UnicodeString& getDisplayLanguage(UnicodeString& dispLang) const;
|
||||
|
||||
/**
|
||||
* Fills in "dispLang" with the name of this locale's language in a format suitable for
|
||||
@ -476,8 +479,9 @@ public:
|
||||
* @return A reference to "dispLang".
|
||||
* @stable
|
||||
*/
|
||||
UnicodeString& getDisplayLanguage( const Locale& inLocale,
|
||||
UnicodeString& dispLang) const;
|
||||
UnicodeString& getDisplayLanguage( const Locale& inLocale,
|
||||
UnicodeString& dispLang) const;
|
||||
|
||||
/**
|
||||
* Fills in "dispCountry" with the name of this locale's country in a format suitable
|
||||
* for user display in the default locale. For example, if the locale's country code
|
||||
@ -487,7 +491,8 @@ public:
|
||||
* @return A reference to "dispCountry".
|
||||
* @stable
|
||||
*/
|
||||
UnicodeString& getDisplayCountry( UnicodeString& dispCountry) const;
|
||||
UnicodeString& getDisplayCountry( UnicodeString& dispCountry) const;
|
||||
|
||||
/**
|
||||
* Fills in "dispCountry" with the name of this locale's country in a format suitable
|
||||
* for user display in the locale specified by "inLocale". For example, if the locale's
|
||||
@ -502,8 +507,8 @@ public:
|
||||
* @return A reference to "dispCountry".
|
||||
* @stable
|
||||
*/
|
||||
UnicodeString& getDisplayCountry( const Locale& inLocale,
|
||||
UnicodeString& dispCountry) const;
|
||||
UnicodeString& getDisplayCountry( const Locale& inLocale,
|
||||
UnicodeString& dispCountry) const;
|
||||
|
||||
/**
|
||||
* Fills in "dispVar" with the name of this locale's variant code in a format suitable
|
||||
@ -512,7 +517,8 @@ public:
|
||||
* @return A reference to "dispVar".
|
||||
* @stable
|
||||
*/
|
||||
UnicodeString& getDisplayVariant( UnicodeString& dispVar) const;
|
||||
UnicodeString& getDisplayVariant( UnicodeString& dispVar) const;
|
||||
|
||||
/**
|
||||
* Fills in "dispVar" with the name of this locale's variant code in a format
|
||||
* suitable for user display in the locale specified by "inLocale".
|
||||
@ -521,8 +527,9 @@ public:
|
||||
* @return A reference to "dispVar".
|
||||
* @stable
|
||||
*/
|
||||
UnicodeString& getDisplayVariant( const Locale& inLocale,
|
||||
UnicodeString& dispVar) const;
|
||||
UnicodeString& getDisplayVariant( const Locale& inLocale,
|
||||
UnicodeString& dispVar) const;
|
||||
|
||||
/**
|
||||
* Fills in "name" with the name of this locale in a format suitable for user display
|
||||
* in the default locale. This function uses getDisplayLanguage(), getDisplayCountry(),
|
||||
@ -534,7 +541,8 @@ public:
|
||||
* @return A reference to "name".
|
||||
* @stable
|
||||
*/
|
||||
UnicodeString& getDisplayName( UnicodeString& name) const;
|
||||
UnicodeString& getDisplayName( UnicodeString& name) const;
|
||||
|
||||
/**
|
||||
* Fills in "name" with the name of this locale in a format suitable for user display
|
||||
* in the locale specfied by "inLocale". This function uses getDisplayLanguage(),
|
||||
@ -547,13 +555,14 @@ public:
|
||||
* @return A reference to "name".
|
||||
* @stable
|
||||
*/
|
||||
UnicodeString& getDisplayName( const Locale& inLocale,
|
||||
UnicodeString& name) const;
|
||||
UnicodeString& getDisplayName( const Locale& inLocale,
|
||||
UnicodeString& name) const;
|
||||
|
||||
/**
|
||||
* Generates a hash code for the locale.
|
||||
* @stable
|
||||
*/
|
||||
int32_t hashCode(void) const;
|
||||
int32_t hashCode(void) const;
|
||||
|
||||
/**
|
||||
* Returns a list of all installed locales.
|
||||
@ -586,7 +595,7 @@ public:
|
||||
static const char* const* getISOLanguages();
|
||||
|
||||
|
||||
#ifndef ICU_LOCID_NO_DEPRECATES
|
||||
#ifdef ICU_LOCID_USE_DEPRECATES
|
||||
/**
|
||||
* Returns a list of all 2-letter country codes defined in ISO 3166.
|
||||
* Can be used to create Locales.
|
||||
@ -629,8 +638,8 @@ protected: /* only protected for testing purposes. DO NOT USE. */
|
||||
* @return A pointer to an array of UnicodeString objects. The caller does NOT
|
||||
* get ownership of this list, and must NOT delete it.
|
||||
*/
|
||||
static const UnicodeString* getLanguagesForCountry( const UnicodeString& country,
|
||||
int32_t& count);
|
||||
static const UnicodeString* getLanguagesForCountry(const UnicodeString& country,
|
||||
int32_t& count);
|
||||
|
||||
|
||||
private:
|
||||
|
@ -59,8 +59,10 @@ typedef struct _FileStream FileStream;
|
||||
class Locale;
|
||||
class RuleBasedCollator;
|
||||
class ResourceBundle;
|
||||
struct UHashtable;
|
||||
|
||||
#ifdef ICU_RESBUND_USE_DEPRECATES
|
||||
struct UHashtable;
|
||||
#endif
|
||||
|
||||
/**
|
||||
* A class representing a collection of resource information pertaining to a given
|
||||
@ -191,150 +193,168 @@ public:
|
||||
* fall back locales could be found.
|
||||
* @draft
|
||||
*/
|
||||
ResourceBundle( const UnicodeString& path,
|
||||
const Locale& locale,
|
||||
UErrorCode& err);
|
||||
ResourceBundle( const UnicodeString& path,
|
||||
UErrorCode& err);
|
||||
ResourceBundle(UErrorCode &err);
|
||||
ResourceBundle( const wchar_t* path,
|
||||
const Locale& locale,
|
||||
UErrorCode& err);
|
||||
ResourceBundle( const char* path,
|
||||
const Locale& locale,
|
||||
UErrorCode& err);
|
||||
ResourceBundle(const ResourceBundle &original);
|
||||
ResourceBundle(UResourceBundle *res, UErrorCode &status);
|
||||
ResourceBundle( const UnicodeString& path,
|
||||
const Locale& locale,
|
||||
UErrorCode& err);
|
||||
ResourceBundle( const UnicodeString& path,
|
||||
UErrorCode& err);
|
||||
ResourceBundle(UErrorCode &err);
|
||||
ResourceBundle( const wchar_t* path,
|
||||
const Locale& locale,
|
||||
UErrorCode& err);
|
||||
ResourceBundle( const char* path,
|
||||
const Locale& locale,
|
||||
UErrorCode& err);
|
||||
ResourceBundle(const ResourceBundle &original);
|
||||
ResourceBundle(UResourceBundle *res, UErrorCode &status);
|
||||
|
||||
ResourceBundle& operator=(const ResourceBundle& other);
|
||||
~ResourceBundle();
|
||||
ResourceBundle& operator=(const ResourceBundle& other);
|
||||
~ResourceBundle();
|
||||
|
||||
/**
|
||||
* Returns the size of a resource. Size for scalar types is always 1, and for vector/table types is
|
||||
* the number of child resources.
|
||||
*
|
||||
* @return number of resources in a given resource.
|
||||
* @draft
|
||||
*/
|
||||
/**
|
||||
* Returns the size of a resource. Size for scalar types is always 1, and for vector/table types is
|
||||
* the number of child resources.
|
||||
*
|
||||
* @return number of resources in a given resource.
|
||||
* @stable
|
||||
*/
|
||||
int32_t getSize(void) const;
|
||||
/**
|
||||
* returns a string from a string resource type
|
||||
*
|
||||
* @param status: fills in the outgoing error code
|
||||
* could be <TT>U_MISSING_RESOURCE_ERROR</T> if the key is not found
|
||||
* could be a non-failing error
|
||||
* e.g.: <TT>U_USING_FALLBACK_ERROR</TT>,<TT>U_USING_DEFAULT_ERROR </TT>
|
||||
* @return a pointer to a zero-terminated UChar array which lives in a memory mapped/DLL file.
|
||||
* @draft
|
||||
*/
|
||||
|
||||
/**
|
||||
* returns a string from a string resource type
|
||||
*
|
||||
* @param status: fills in the outgoing error code
|
||||
* could be <TT>U_MISSING_RESOURCE_ERROR</T> if the key is not found
|
||||
* could be a non-failing error
|
||||
* e.g.: <TT>U_USING_FALLBACK_ERROR</TT>,<TT>U_USING_DEFAULT_ERROR </TT>
|
||||
* @return a pointer to a zero-terminated UChar array which lives in a memory mapped/DLL file.
|
||||
* @stable
|
||||
*/
|
||||
UnicodeString getString(UErrorCode& status) const;
|
||||
|
||||
/**
|
||||
* returns a binary data from a resource. Can be used at most primitive resource types (binaries,
|
||||
* strings, ints)
|
||||
*
|
||||
* @param resourceBundle: a string resource
|
||||
* @param len: fills in the length of resulting byte chunk
|
||||
* @param status: fills in the outgoing error code
|
||||
* could be <TT>U_MISSING_RESOURCE_ERROR</T> if the key is not found
|
||||
* could be a non-failing error
|
||||
* e.g.: <TT>U_USING_FALLBACK_ERROR</TT>,<TT>U_USING_DEFAULT_ERROR </TT>
|
||||
* @return a pointer to a chuck of unsigned bytes which live in a memory mapped/DLL file.
|
||||
* @stable
|
||||
*/
|
||||
const uint8_t *getBinary(int32_t& len, UErrorCode& status) const;
|
||||
|
||||
/**
|
||||
* Checks whether the resource has another element to iterate over.
|
||||
*
|
||||
* @return TRUE if there are more elements, FALSE if there is no more elements
|
||||
* @draft
|
||||
*/
|
||||
/**
|
||||
* Checks whether the resource has another element to iterate over.
|
||||
*
|
||||
* @return TRUE if there are more elements, FALSE if there is no more elements
|
||||
* @draft
|
||||
*/
|
||||
UBool hasNext(void) const;
|
||||
/**
|
||||
* Resets the internal context of a resource so that iteration starts from the first element.
|
||||
*
|
||||
* @draft
|
||||
*/
|
||||
|
||||
/**
|
||||
* Resets the internal context of a resource so that iteration starts from the first element.
|
||||
*
|
||||
* @draft
|
||||
*/
|
||||
void resetIterator(void);
|
||||
|
||||
/**
|
||||
* Returns the key associated with this resource. Not all the resources have a key - only
|
||||
* those that are members of a table.
|
||||
*
|
||||
* @return a key associated to this resource, or NULL if it doesn't have a key
|
||||
* @draft
|
||||
*/
|
||||
/**
|
||||
* Returns the key associated with this resource. Not all the resources have a key - only
|
||||
* those that are members of a table.
|
||||
*
|
||||
* @return a key associated to this resource, or NULL if it doesn't have a key
|
||||
* @draft
|
||||
*/
|
||||
const char *getKey(void);
|
||||
|
||||
const char *getName(void);
|
||||
|
||||
|
||||
/**
|
||||
* Returns the type of a resource. Available types are defined in enum UResType
|
||||
*
|
||||
* @return type of the given resource.
|
||||
* @draft
|
||||
*/
|
||||
/**
|
||||
* Returns the type of a resource. Available types are defined in enum UResType
|
||||
*
|
||||
* @return type of the given resource.
|
||||
* @stable
|
||||
*/
|
||||
UResType getType(void);
|
||||
|
||||
/**
|
||||
* Returns the next resource in a given resource or NULL if there are no more resources
|
||||
*
|
||||
* @param status fills in the outgoing error code
|
||||
* @return ResourceBundle object.
|
||||
* @draft
|
||||
*/
|
||||
/**
|
||||
* Returns the next resource in a given resource or NULL if there are no more resources
|
||||
*
|
||||
* @param status fills in the outgoing error code
|
||||
* @return ResourceBundle object.
|
||||
* @draft
|
||||
*/
|
||||
ResourceBundle getNext(UErrorCode& status);
|
||||
|
||||
/**
|
||||
* Returns the next string in a resource or NULL if there are no more resources
|
||||
* to iterate over.
|
||||
*
|
||||
* @param status fills in the outgoing error code
|
||||
* @return an UnicodeString object.
|
||||
* @draft
|
||||
*/
|
||||
/**
|
||||
* Returns the next string in a resource or NULL if there are no more resources
|
||||
* to iterate over.
|
||||
*
|
||||
* @param status fills in the outgoing error code
|
||||
* @return an UnicodeString object.
|
||||
* @draft
|
||||
*/
|
||||
UnicodeString getNextString(UErrorCode& status);
|
||||
/**
|
||||
* Returns the next string in a resource or NULL if there are no more resources
|
||||
* to iterate over.
|
||||
*
|
||||
* @param key fill in for key associated with this string
|
||||
* @param status fills in the outgoing error code
|
||||
* @return an UnicodeString object.
|
||||
* @draft
|
||||
*/
|
||||
|
||||
/**
|
||||
* Returns the next string in a resource or NULL if there are no more resources
|
||||
* to iterate over.
|
||||
*
|
||||
* @param key fill in for key associated with this string
|
||||
* @param status fills in the outgoing error code
|
||||
* @return an UnicodeString object.
|
||||
* @draft
|
||||
*/
|
||||
UnicodeString getNextString(const char ** key, UErrorCode& status);
|
||||
|
||||
/**
|
||||
* Returns the resource in a resource at the specified index.
|
||||
*
|
||||
* @param index an index to the wanted resource.
|
||||
* @param status fills in the outgoing error code
|
||||
* @return ResourceBundle object. If there is an error, resource is invalid.
|
||||
* @draft
|
||||
*/
|
||||
/**
|
||||
* Returns the resource in a resource at the specified index.
|
||||
*
|
||||
* @param index an index to the wanted resource.
|
||||
* @param status fills in the outgoing error code
|
||||
* @return ResourceBundle object. If there is an error, resource is invalid.
|
||||
* @stable
|
||||
*/
|
||||
ResourceBundle get(int32_t index, UErrorCode& status) const;
|
||||
|
||||
/**
|
||||
* Returns the string in a given resource at the specified index.
|
||||
*
|
||||
* @param index an index to the wanted string.
|
||||
* @param status fills in the outgoing error code
|
||||
* @return an UnicodeString object. If there is an error, string is bogus
|
||||
* @draft
|
||||
*/
|
||||
/**
|
||||
* Returns the string in a given resource at the specified index.
|
||||
*
|
||||
* @param index an index to the wanted string.
|
||||
* @param status fills in the outgoing error code
|
||||
* @return an UnicodeString object. If there is an error, string is bogus
|
||||
* @stable
|
||||
*/
|
||||
UnicodeString getStringEx(int32_t index, UErrorCode& status) const;
|
||||
|
||||
/**
|
||||
* Returns a resource in a resource that has a given key. This procedure works only with table
|
||||
* resources.
|
||||
*
|
||||
* @param key a key associated with the wanted resource
|
||||
* @param status fills in the outgoing error code.
|
||||
* @return ResourceBundle object. If there is an error, resource is invalid.
|
||||
* @draft
|
||||
*/
|
||||
/**
|
||||
* Returns a resource in a resource that has a given key. This procedure works only with table
|
||||
* resources.
|
||||
*
|
||||
* @param key a key associated with the wanted resource
|
||||
* @param status fills in the outgoing error code.
|
||||
* @return ResourceBundle object. If there is an error, resource is invalid.
|
||||
* @stable
|
||||
*/
|
||||
ResourceBundle get(const char* key, UErrorCode& status) const;
|
||||
|
||||
/**
|
||||
* Returns a string in a resource that has a given key. This procedure works only with table
|
||||
* resources.
|
||||
*
|
||||
* @param key a key associated with the wanted string
|
||||
* @param status fills in the outgoing error code
|
||||
* @return an UnicodeString object. If there is an error, string is bogus
|
||||
* @draft
|
||||
*/
|
||||
/**
|
||||
* Returns a string in a resource that has a given key. This procedure works only with table
|
||||
* resources.
|
||||
*
|
||||
* @param key a key associated with the wanted string
|
||||
* @param status fills in the outgoing error code
|
||||
* @return an UnicodeString object. If there is an error, string is bogus
|
||||
* @stable
|
||||
*/
|
||||
UnicodeString getStringEx(const char* key, UErrorCode& status) const;
|
||||
|
||||
#ifdef ICU_RESBUND_USE_DEPRECATES
|
||||
/**
|
||||
* Returns the contents of a string resource. Resource data is undifferentiated
|
||||
* Unicode text. The resource file may contain quoted strings or escape sequences;
|
||||
@ -410,7 +430,7 @@ public:
|
||||
* @return The resource requested, as a UnicodeStrings**. The caller
|
||||
* does not own the storage and must not delete it. (its lifetime
|
||||
* is that of the resource bundle.)
|
||||
* @deprecated to be removed in first release in 2001. Use ures_getBinary instead.
|
||||
* @deprecated to be removed in first release in 2001. Use getStringEx() instead.
|
||||
*/
|
||||
const UnicodeString** get2dArray(const char *resourceTag,
|
||||
int32_t& rowCount,
|
||||
@ -434,7 +454,7 @@ public:
|
||||
* the wrong format, or if either index is out of bounds.
|
||||
* @return A pointer to the text of the array item, or NULL is there was an error.
|
||||
* (its lifetime is that of the resource bundle.)
|
||||
* @deprecated to be removed in first release in 2001. Use ures_getBinary instead.
|
||||
* @deprecated to be removed in first release in 2001. Use getStringEx() instead.
|
||||
*/
|
||||
const UnicodeString* get2dArrayItem( const char *resourceTag,
|
||||
int32_t rowIndex,
|
||||
@ -490,6 +510,7 @@ public:
|
||||
UnicodeString*& items,
|
||||
int32_t& numItems,
|
||||
UErrorCode& err) const;
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Return the version number associated with this ResourceBundle. This version
|
||||
@ -526,7 +547,9 @@ private:
|
||||
UResourceBundle *resource;
|
||||
void constructForLocale(const UnicodeString& path, const Locale& locale, UErrorCode& error);
|
||||
void constructForLocale(const wchar_t* path, const Locale& locale, UErrorCode& error);
|
||||
#ifdef ICU_RESBUND_USE_DEPRECATES
|
||||
void initItemCache(UErrorCode& error);
|
||||
#endif
|
||||
|
||||
friend class RuleBasedCollator;
|
||||
|
||||
@ -535,15 +558,18 @@ private:
|
||||
* file, without trying other files. This is used by the Collation caching
|
||||
* mechanism.
|
||||
*/
|
||||
ResourceBundle( const UnicodeString& path,
|
||||
const char *localeName,
|
||||
UErrorCode& status);
|
||||
ResourceBundle( const UnicodeString& path,
|
||||
const char *localeName,
|
||||
UErrorCode& status);
|
||||
|
||||
private:
|
||||
static void U_CALLCONV deleteValue(void* value);
|
||||
Locale fRealLocale;
|
||||
|
||||
#ifdef ICU_RESBUND_USE_DEPRECATES
|
||||
UHashtable* fItemCache;
|
||||
#endif
|
||||
|
||||
static const char* kDefaultSuffix;
|
||||
static const int32_t kDefaultSuffixLen;
|
||||
static const char* kDefaultFilename;
|
||||
|
@ -494,6 +494,7 @@ uloc_getISOLanguages(void);
|
||||
U_CAPI const char* const* U_EXPORT2
|
||||
uloc_getISOCountries(void);
|
||||
|
||||
#ifdef ICU_ULOC_USE_DEPRECATES
|
||||
/**
|
||||
* Deprecated 1999dec14 - Gets the directory containing the locale data files.
|
||||
*
|
||||
@ -509,6 +510,7 @@ uloc_getISOCountries(void);
|
||||
* @deprecated 1999dec14 - Remove after 2000dec14
|
||||
*/
|
||||
#define uloc_setDataDirectory u_setDataDirectory
|
||||
#endif
|
||||
|
||||
/*Internal function */
|
||||
int32_t U_EXPORT2
|
||||
|
Loading…
Reference in New Issue
Block a user