dbertoni    01/03/29 14:09:06

  Modified:    c/src/ICUBridge ICUBridgeCollationCompareFunctor.cpp
                        ICUBridgeCollationCompareFunctor.hpp
  Log:
  New operator() for locale string.
  
  Revision  Changes    Path
  1.11      +41 -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.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- ICUBridgeCollationCompareFunctor.cpp      2001/01/26 21:56:56     1.10
  +++ ICUBridgeCollationCompareFunctor.cpp      2001/03/29 22:09:03     1.11
  @@ -84,7 +84,8 @@
   
        m_collator = Collator::createInstance(theStatus);
   
  -     if (theStatus == U_ZERO_ERROR || theStatus == U_USING_DEFAULT_ERROR)
  +     if (theStatus == U_ZERO_ERROR ||
  +         (theStatus >= U_ERROR_INFO_START && theStatus < U_ERROR_INFO_LIMIT))
        {
                m_isValid = true;
        }
  @@ -108,7 +109,45 @@
   
        XalanAutoPtr<Collator>  
theCollator(Collator::createInstance(theStatus));
   
  -     if (theStatus == U_ZERO_ERROR || theStatus == U_USING_DEFAULT_ERROR)
  +     if (theStatus == U_ZERO_ERROR ||
  +         (theStatus >= U_ERROR_INFO_START && theStatus < U_ERROR_INFO_LIMIT))
  +     {
  +             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 XalanDOMChar*             theLocale) const
  +{
  +     UErrorCode      theStatus = U_ZERO_ERROR;
  +
  +     XalanAutoPtr<Collator>  
theCollator(Collator::createInstance(Locale(UnicodeString(theLocale)), 
theStatus));
  +
  +     if (theStatus == U_ZERO_ERROR ||
  +         (theStatus >= U_ERROR_INFO_START && theStatus < U_ERROR_INFO_LIMIT))
        {
                assert(theCollator.get() != 0);
   
  
  
  
  1.3       +6 -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.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ICUBridgeCollationCompareFunctor.hpp      2001/01/26 21:56:58     1.2
  +++ ICUBridgeCollationCompareFunctor.hpp      2001/03/29 22:09:04     1.3
  @@ -91,6 +91,12 @@
                        const XalanDOMChar*             theLHS,
                        const XalanDOMChar*             theRHS) const;
   
  +     virtual int
  +     operator()(
  +                     const XalanDOMChar*             theLHS,
  +                     const XalanDOMChar*             theRHS,
  +                     const XalanDOMChar*             theLocale) const;
  +
        bool
        isValid() const
        {
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to