You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xalan.apache.org by db...@apache.org on 2001/01/26 22:57:05 UTC
cvs commit: xml-xalan/c/src/ICUBridge ICUBridgeCollationCompareFunctor.cpp ICUBridgeCollationCompareFunctor.hpp
dbertoni 01/01/26 13:57:03
Modified: c/src/ICUBridge ICUBridgeCollationCompareFunctor.cpp
ICUBridgeCollationCompareFunctor.hpp
Log:
Fixed const issues.
Revision Changes Path
1.10 +37 -2 xml-xalan/c/src/ICUBridge/ICUBridgeCollationCompareFunctor.cpp
Index: ICUBridgeCollationCompareFunctor.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/ICUBridge/ICUBridgeCollationCompareFunctor.cpp,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- ICUBridgeCollationCompareFunctor.cpp 2001/01/23 18:09:25 1.9
+++ ICUBridgeCollationCompareFunctor.cpp 2001/01/26 21:56:56 1.10
@@ -60,6 +60,10 @@
+#include <Include/XalanAutoPtr.hpp>
+
+
+
#include <PlatformSupport/DOMStringHelper.hpp>
@@ -95,14 +99,45 @@
-static UChar dummy = 0;
+int
+ICUBridgeCollationCompareFunctor::operator()(
+ const XalanDOMChar* theLHS,
+ const XalanDOMChar* theRHS) const
+{
+ UErrorCode theStatus = U_ZERO_ERROR;
+ XalanAutoPtr<Collator> theCollator(Collator::createInstance(theStatus));
+ if (theStatus == U_ZERO_ERROR || theStatus == U_USING_DEFAULT_ERROR)
+ {
+ assert(theCollator.get() != 0);
+#if U_SIZEOF_WCHAR_T==2
+ return theCollator->compare(
+ (wchar_t*)theLHS,
+ length(theLHS),
+ (wchar_t*)theRHS,
+ length(theRHS));
+#else
+ return theCollator->compare(
+ theLHS,
+ length(theLHS),
+ theRHS,
+ length(theRHS));
+#endif
+ }
+ else
+ {
+ return s_defaultFunctor(theLHS, theRHS);
+ }
+}
+
+
+
int
ICUBridgeCollationCompareFunctor::operator()(
const XalanDOMChar* theLHS,
- const XalanDOMChar* theRHS) const
+ const XalanDOMChar* theRHS)
{
if (isValid() == false)
{
1.2 +5 -0 xml-xalan/c/src/ICUBridge/ICUBridgeCollationCompareFunctor.hpp
Index: ICUBridgeCollationCompareFunctor.hpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/ICUBridge/ICUBridgeCollationCompareFunctor.hpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- ICUBridgeCollationCompareFunctor.hpp 2000/07/10 01:04:35 1.1
+++ ICUBridgeCollationCompareFunctor.hpp 2001/01/26 21:56:58 1.2
@@ -84,6 +84,11 @@
virtual int
operator()(
const XalanDOMChar* theLHS,
+ const XalanDOMChar* theRHS);
+
+ virtual int
+ operator()(
+ const XalanDOMChar* theLHS,
const XalanDOMChar* theRHS) const;
bool