ICU-149 make ResourceBundle use new UHashtable API

X-SVN-Rev: 1019
This commit is contained in:
Alan Liu 2000-03-29 19:41:57 +00:00
parent 61c6f2fa23
commit 1d9f6a4c06
2 changed files with 8 additions and 8 deletions

View file

@ -262,12 +262,13 @@ rb_parse(FileStream *f,
if(U_FAILURE(status)) return 0;
/* Open the hashtable for saving data */
retval = uhash_open((UHashFunction)uhash_OLD_hashUString,
uhash_OLD_pointerComparator, &status);
retval = uhash_open(uhash_hashUnicodeString,
uhash_compareUnicodeString, &status);
if(retval == 0 || U_FAILURE(status)) {
status = U_MEMORY_ALLOCATION_ERROR;
return 0;
}
uhash_setKeyDeleter(retval, uhash_deleteUnicodeString);
uhash_setValueDeleter(retval, RBHashtable_valueDeleter);
/* Read the byte order mark from the file */
@ -307,7 +308,7 @@ rb_parse(FileStream *f,
uhash_close(retval);
return 0;
}
uhash_OLD_putKey(retval, listname.hashCode() & 0x7FFFFFFF,
uhash_put(retval, new UnicodeString(listname),
strlist, &status);
if(U_FAILURE(status)) {
uhash_close(retval);
@ -317,7 +318,7 @@ rb_parse(FileStream *f,
case sSTRINGLIST2D:
strlist2d = read_strlist2d(f, listname, status);
uhash_OLD_putKey(retval, listname.hashCode() & 0x7FFFFFFF,
uhash_put(retval, new UnicodeString(listname),
strlist2d, &status);
if(U_FAILURE(status)) {
uhash_close(retval);
@ -327,7 +328,7 @@ rb_parse(FileStream *f,
case sTAGGEDLIST:
taglist = read_taglist(f, listname, status);
uhash_OLD_putKey(retval, listname.hashCode() & 0x7FFFFFFF,
uhash_put(retval, new UnicodeString(listname),
taglist, &status);
if(U_FAILURE(status)) {
uhash_close(retval);

View file

@ -599,8 +599,7 @@ ResourceBundle::getDataForTag(const char *tag,
if(fData[i] != 0) {
const ResourceBundleData* s =
(const ResourceBundleData*)uhash_OLD_get(fData[i],
UnicodeString(tag, "").hashCode() & 0x7FFFFFFF);
(const ResourceBundleData*)uhash_get(fData[i], &UnicodeString(tag, ""));
if(s != 0) {
err = fDataStatus[i]; /* restore the error from the original lookup. */
return s;
@ -952,7 +951,7 @@ ResourceBundle::listInstalledLocales(const UnicodeString& path,
if(h != 0) {
UnicodeString ukIndexTag = UnicodeString(kIndexTag,"");
ResourceBundleData *data =
(ResourceBundleData*) uhash_OLD_get(h, ukIndexTag.hashCode() & 0x7FFFFFFF);
(ResourceBundleData*) uhash_get(h, &ukIndexTag);
if(data != 0
&& data->getDynamicClassID() == StringList::getStaticClassID()) {
numInstalledLocales = ((StringList*)data)->fCount;