From d9e50475598dfefb91561e05a9db2c80e2d84a21 Mon Sep 17 00:00:00 2001 From: Alan Liu Date: Mon, 17 May 2004 21:43:00 +0000 Subject: [PATCH] ICU-3746 add @internal containsAll and equals X-SVN-Rev: 15343 --- icu4c/source/common/unicode/uset.h | 16 +++++++++++++++- icu4c/source/common/uset.cpp | 12 +++++++++++- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/icu4c/source/common/unicode/uset.h b/icu4c/source/common/unicode/uset.h index 365fb9cb9dd..c58bfb9efb6 100644 --- a/icu4c/source/common/unicode/uset.h +++ b/icu4c/source/common/unicode/uset.h @@ -1,7 +1,7 @@ /* ******************************************************************************* * -* Copyright (C) 2002-2003, International Business Machines +* Copyright (C) 2002-2004, International Business Machines * Corporation and others. All Rights Reserved. * ******************************************************************************* @@ -387,6 +387,20 @@ uset_getItem(const USet* set, int32_t itemIndex, UChar* str, int32_t strCapacity, UErrorCode* ec); +/* TODO: propose the following to the list and make them public */ + +/** + * @internal + */ +U_CAPI UBool U_EXPORT2 +uset_containsAll(const USet* set1, const USet* set2); + +/** + * @internal + */ +U_CAPI UBool U_EXPORT2 +uset_equals(const USet* set1, const USet* set2); + /********************************************************************* * Serialized set API *********************************************************************/ diff --git a/icu4c/source/common/uset.cpp b/icu4c/source/common/uset.cpp index 7c7d0346089..98cfc5cce52 100644 --- a/icu4c/source/common/uset.cpp +++ b/icu4c/source/common/uset.cpp @@ -1,7 +1,7 @@ /* ******************************************************************************* * -* Copyright (C) 2002-2003, International Business Machines +* Copyright (C) 2002-2004, International Business Machines * Corporation and others. All Rights Reserved. * ******************************************************************************* @@ -193,6 +193,16 @@ uset_containsString(const USet* set, const UChar* str, int32_t strLen) { return ((const UnicodeSet*) set)->contains(s); } +U_CAPI UBool U_EXPORT2 +uset_containsAll(const USet* set1, const USet* set2) { + return ((const UnicodeSet*) set1)->containsAll(* (const UnicodeSet*) set2); +} + +U_CAPI UBool U_EXPORT2 +uset_equals(const USet* set1, const USet* set2) { + return *(const UnicodeSet*)set1 == *(const UnicodeSet*)set2; +} + U_CAPI int32_t U_EXPORT2 uset_size(const USet* set) { return ((const UnicodeSet*) set)->size();