]>
git.saurik.com Git - apple/icu.git/blob - icuSources/common/uhash_us.cpp
2 ******************************************************************************
3 * Copyright (C) 1997-2004, International Business Machines
4 * Corporation and others. All Rights Reserved.
5 ******************************************************************************
6 * Date Name Description
7 * 03/22/00 aliu Creation.
8 * 07/06/01 aliu Modified to support int32_t keys on
9 * platforms with sizeof(void*) < 32.
10 ******************************************************************************
16 #include "unicode/unistr.h"
17 #include "unicode/uchar.h"
19 /********************************************************************
20 * PUBLIC UnicodeString support functions for UHashtable
21 ********************************************************************/
23 U_CAPI
int32_t U_EXPORT2
24 uhash_hashUnicodeString(const UHashTok key
) {
26 const UnicodeString
*str
= (const UnicodeString
*) key
.pointer
;
27 return (str
== NULL
) ? 0 : str
->hashCode();
31 uhash_deleteUnicodeString(void *obj
) {
33 delete (UnicodeString
*) obj
;
36 U_CAPI UBool U_EXPORT2
37 uhash_compareUnicodeString(const UHashTok key1
, const UHashTok key2
) {
39 const UnicodeString
*str1
= (const UnicodeString
*) key1
.pointer
;
40 const UnicodeString
*str2
= (const UnicodeString
*) key2
.pointer
;
44 if (str1
== NULL
|| str2
== NULL
) {
47 return *str1
== *str2
;
51 * Deleter for Hashtable objects.
54 uhash_deleteHashtable(void *obj
) {
56 delete (Hashtable
*) obj
;
60 * Deleter for UVector objects.
63 uhash_deleteUVector(void *obj
) {
65 delete (UVector
*) obj
;