ICU-1079 add utility deleters for UVector and Hashtable
X-SVN-Rev: 5413
This commit is contained in:
parent
caa1bdd17e
commit
38a35f8596
@ -502,6 +502,18 @@ uhash_compareLong(const UHashKey key1, const UHashKey key2);
|
||||
* Other Support Functions
|
||||
********************************************************************/
|
||||
|
||||
/**
|
||||
* Deleter for Hashtable objects.
|
||||
*/
|
||||
U_CAPI void
|
||||
uhash_deleteHashtable(void *obj);
|
||||
|
||||
/**
|
||||
* Deleter for UVector objects.
|
||||
*/
|
||||
U_CAPI void
|
||||
uhash_deleteUVector(void *obj);
|
||||
|
||||
/**
|
||||
* Deleter for any key or value allocated using uprv_malloc. Calls
|
||||
* uprv_free.
|
||||
|
@ -11,6 +11,8 @@
|
||||
*/
|
||||
|
||||
#include "uhash.h"
|
||||
#include "hash.h"
|
||||
#include "uvector.h"
|
||||
#include "unicode/unistr.h"
|
||||
|
||||
/********************************************************************
|
||||
@ -65,3 +67,21 @@ uhash_compareCaselessUnicodeString(const UHashKey key1, const UHashKey key2) {
|
||||
}
|
||||
return str1->caseCompare(*str2, U_FOLD_CASE_DEFAULT) == 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Deleter for Hashtable objects.
|
||||
*/
|
||||
U_CAPI void
|
||||
uhash_deleteHashtable(void *obj) {
|
||||
delete (Hashtable*) obj;
|
||||
}
|
||||
|
||||
/**
|
||||
* Deleter for UVector objects.
|
||||
*/
|
||||
U_CAPI void
|
||||
uhash_deleteUVector(void *obj) {
|
||||
delete (UVector*) obj;
|
||||
}
|
||||
|
||||
//eof
|
||||
|
Loading…
Reference in New Issue
Block a user