Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(221)

Unified Diff: icu46/source/common/uhash_us.cpp

Issue 5516007: Check in the pristine copy of ICU 4.6... (Closed) Base URL: svn://chrome-svn/chrome/trunk/deps/third_party/
Patch Set: Created 10 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « icu46/source/common/uhash.c ('k') | icu46/source/common/uidna.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: icu46/source/common/uhash_us.cpp
===================================================================
--- icu46/source/common/uhash_us.cpp (revision 0)
+++ icu46/source/common/uhash_us.cpp (revision 0)
@@ -0,0 +1,68 @@
+/*
+******************************************************************************
+* Copyright (C) 1997-2010, International Business Machines
+* Corporation and others. All Rights Reserved.
+******************************************************************************
+* Date Name Description
+* 03/22/00 aliu Creation.
+* 07/06/01 aliu Modified to support int32_t keys on
+* platforms with sizeof(void*) < 32.
+******************************************************************************
+*/
+
+#include "uhash.h"
+#include "hash.h"
+#include "uvector.h"
+#include "unicode/unistr.h"
+#include "unicode/uchar.h"
+
+/********************************************************************
+ * PUBLIC UnicodeString support functions for UHashtable
+ ********************************************************************/
+
+U_CAPI int32_t U_EXPORT2
+uhash_hashUnicodeString(const UHashTok key) {
+ U_NAMESPACE_USE
+ const UnicodeString *str = (const UnicodeString*) key.pointer;
+ return (str == NULL) ? 0 : str->hashCode();
+}
+
+U_CAPI void U_EXPORT2
+uhash_deleteUnicodeString(void *obj) {
+ U_NAMESPACE_USE
+ delete (UnicodeString*) obj;
+}
+
+U_CAPI UBool U_EXPORT2
+uhash_compareUnicodeString(const UHashTok key1, const UHashTok key2) {
+ U_NAMESPACE_USE
+ const UnicodeString *str1 = (const UnicodeString*) key1.pointer;
+ const UnicodeString *str2 = (const UnicodeString*) key2.pointer;
+ if (str1 == str2) {
+ return TRUE;
+ }
+ if (str1 == NULL || str2 == NULL) {
+ return FALSE;
+ }
+ return *str1 == *str2;
+}
+
+/**
+ * Deleter for Hashtable objects.
+ */
+U_CAPI void U_EXPORT2
+uhash_deleteHashtable(void *obj) {
+ U_NAMESPACE_USE
+ delete (Hashtable*) obj;
+}
+
+/**
+ * Deleter for UObject instances.
+ */
+U_CAPI void U_EXPORT2
+uhash_deleteUObject(void *obj) {
+ U_NAMESPACE_USE
+ delete (UObject*) obj;
+}
+
+//eof
Property changes on: icu46/source/common/uhash_us.cpp
___________________________________________________________________
Added: svn:eol-style
+ LF
« no previous file with comments | « icu46/source/common/uhash.c ('k') | icu46/source/common/uidna.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698