Go to the source code of this file.
Compounds | |
struct | UHashElement |
struct | UHashtable |
Typedefs | |
typedef struct UHashElement | UHashElement |
Enumerations | |
enum | UHashResizePolicy { U_GROW, U_GROW_AND_SHRINK, U_FIXED } |
This specifies whether or not, and how, the hastable resizes itself. More... | |
Functions | |
U_CDECL_END U_CAPI UHashtable* | uhash_open (UHashFunction keyHash, UKeyComparator keyComp, UErrorCode *status) |
Initialize a new UHashtable. More... | |
U_CAPI UHashtable* | uhash_openSize (UHashFunction keyHash, UKeyComparator keyComp, int32_t size, UErrorCode *status) |
Initialize a new UHashtable with a given initial size. More... | |
U_CAPI void | uhash_close (UHashtable *hash) |
Close a UHashtable, releasing the memory used. More... | |
U_CAPI UHashFunction | uhash_setKeyHasher (UHashtable *hash, UHashFunction fn) |
Set the function used to hash keys. More... | |
U_CAPI UKeyComparator | uhash_setKeyComparator (UHashtable *hash, UKeyComparator fn) |
Set the function used to compare keys. More... | |
U_CAPI UObjectDeleter | uhash_setKeyDeleter (UHashtable *hash, UObjectDeleter fn) |
Set the function used to delete keys. More... | |
U_CAPI UObjectDeleter | uhash_setValueDeleter (UHashtable *hash, UObjectDeleter fn) |
Set the function used to delete values. More... | |
U_CAPI void | uhash_setResizePolicy (UHashtable *hash, enum UHashResizePolicy policy) |
Specify whether or not, and how, the hastable resizes itself. More... | |
U_CAPI int32_t | uhash_count (const UHashtable *hash) |
Get the number of key-value pairs stored in a UHashtable. More... | |
U_CAPI void* | uhash_put (UHashtable *hash, void *key, void *value, UErrorCode *status) |
Put an item in a UHashtable. More... | |
U_CAPI void* | uhash_get (const UHashtable *hash, const void *key) |
Get an item from a UHashtable. More... | |
U_CAPI void* | uhash_remove (UHashtable *hash, const void *key) |
Remove an item from a UHashtable. More... | |
U_CAPI void | uhash_removeAll (UHashtable *hash) |
Remove all items from a UHashtable. More... | |
U_CAPI const UHashElement* | uhash_nextElement (const UHashtable *hash, int32_t *pos) |
Iterate through the elements of a UHashtable. More... | |
U_CAPI void* | uhash_removeElement (UHashtable *hash, const UHashElement* e) |
Remove an element, returned by uhash_nextElement(), from the table. More... | |
U_CAPI int32_t | uhash_hashUChars (const void *key) |
Generate a hash code for a null-terminated UChar* string. More... | |
U_CAPI int32_t | uhash_hashChars (const void *key) |
Generate a hash code for a null-terminated char* string. More... | |
U_CAPI int32_t | uhash_hashUCharsN (const UChar *key, int32_t length) |
U_CAPI int32_t | uhash_hashIChars (const void *key) |
Generate a case-insensitive hash code for a null-terminated char* string. More... | |
U_CAPI UBool | uhash_compareUChars (const void *key1, const void *key2) |
Comparator for null-terminated UChar* strings. More... | |
U_CAPI UBool | uhash_compareChars (const void *key1, const void *key2) |
Comparator for null-terminated char* strings. More... | |
U_CAPI UBool | uhash_compareIChars (const void *key1, const void *key2) |
Case-insensitive comparator for null-terminated char* strings. More... | |
U_CAPI int32_t | uhash_hashUnicodeString (const void *key) |
Hash function for UnicodeString* keys. | |
U_CAPI UBool | uhash_compareUnicodeString (const void *key1, const void *key2) |
Comparator function for UnicodeString* keys. | |
U_CAPI void | uhash_deleteUnicodeString (void *obj) |
Deleter function for UnicodeString* keys or values. | |
U_CAPI int32_t | uhash_hashLong (const void *key) |
Hash function for 32-bit integer keys. | |
U_CAPI UBool | uhash_compareLong (const void *key1, const void *key2) |
Comparator function for 32-bit integer keys. | |
U_CAPI void | uhash_freeBlock (void *obj) |
Deleter for any key or value allocated using uprv_malloc. More... | |
Variables | |
U_CDECL_BEGIN typedef int32_t (* | U_CALLCONV )(const void* key) |
A hashing function. More... |
|
|
|
This specifies whether or not, and how, the hastable resizes itself. See uhash_setResizePolicy(). |
|
Close a UHashtable, releasing the memory used.
Referenced by Hashtable::~Hashtable(). |
|
Comparator for null-terminated char* strings. Use together with uhash_hashChars. |
|
Case-insensitive comparator for null-terminated char* strings. Use together with uhash_hashIChars. |
|
Comparator function for 32-bit integer keys.
|
|
Comparator for null-terminated UChar* strings. Use together with uhash_hashUChars. |
|
Comparator function for UnicodeString* keys.
|
|
Get the number of key-value pairs stored in a UHashtable.
Referenced by Hashtable::count(). |
|
Deleter function for UnicodeString* keys or values.
|
|
Deleter for any key or value allocated using uprv_malloc. Calls uprv_free. |
|
Get an item from a UHashtable.
Referenced by Hashtable::get(). |
|
Generate a hash code for a null-terminated char* string. If the string is not null-terminated do not use this function. Use together with uhash_compareChars.
|
|
Generate a case-insensitive hash code for a null-terminated char* string. If the string is not null-terminated do not use this function. Use together with uhash_compareIChars.
|
|
Hash function for 32-bit integer keys.
|
|
Generate a hash code for a null-terminated UChar* string. If the string is not null-terminated do not use this function. Use together with uhash_compareUChars.
|
|
|
|
Hash function for UnicodeString* keys.
|
|
Iterate through the elements of a UHashtable. The caller must not modify the returned object. However, uhash_removeElement() may be called during iteration to remove an element from the table. Iteration may safely be resumed afterwards. If uhash_put() is called during iteration the iteration will then be out of sync and should be restarted.
Referenced by Hashtable::nextElement(). |
|
Initialize a new UHashtable.
Referenced by Hashtable::Hashtable(). |
|
Initialize a new UHashtable with a given initial size.
|
|
Put an item in a UHashtable. If the keyDeleter is non-NULL, then the hashtable owns 'key' after this call. If the valueDeleter is non-NULL, then the hashtable owns 'value' after this call. Storing a NULL value is the same as calling uhash_remove().
Referenced by Hashtable::put(). |
|
Remove an item from a UHashtable.
Referenced by Hashtable::remove(). |
|
Remove all items from a UHashtable.
|
|
Remove an element, returned by uhash_nextElement(), from the table. Iteration may be safely continued afterwards.
|
|
Set the function used to compare keys. The default comparison is a void* pointer comparison.
|
|
Set the function used to delete keys. If this function pointer is NULL, this hashtable does not delete keys. If it is non-NULL, this hashtable does delete keys. This function should be set once before any elements are added to the hashtable and should not be changed thereafter.
Referenced by Hashtable::Hashtable(). |
|
Set the function used to hash keys.
|
|
Specify whether or not, and how, the hastable resizes itself. By default, tables grow but do not shrink (policy U_GROW). See enum UHashResizePolicy. |
|
Set the function used to delete values. If this function pointer is NULL, this hashtable does not delete values. If it is non-NULL, this hashtable does delete values. This function should be set once before any elements are added to the hashtable and should not be changed thereafter.
Referenced by Hashtable::setValueDeleter(). |
|
A hashing function.
|