dbertoni    2002/12/22 11:25:49

  Modified:    c/src/XalanDOM XalanDOMString.cpp XalanDOMString.hpp
  Log:
  Moved hash function to XalanDOMString.
  
  Revision  Changes    Path
  1.33      +23 -0     xml-xalan/c/src/XalanDOM/XalanDOMString.cpp
  
  Index: XalanDOMString.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XalanDOM/XalanDOMString.cpp,v
  retrieving revision 1.32
  retrieving revision 1.33
  diff -u -r1.32 -r1.33
  --- XalanDOMString.cpp        3 Dec 2002 22:52:42 -0000       1.32
  +++ XalanDOMString.cpp        22 Dec 2002 19:25:49 -0000      1.33
  @@ -749,6 +749,29 @@
   
   
   
  +XalanDOMString::size_type
  +XalanDOMString::hash(
  +                     const XalanDOMChar*                     theString,
  +                     XalanDOMString::size_type       theLength)
  +{
  +     assert(theString != 0);
  +
  +    size_type        theResult = 0;
  +
  +     const XalanDOMChar* const       theEnd = theString + theLength;
  +
  +     while (theString != theEnd)
  +    {
  +        theResult += (theResult * 37) + (theResult >> 24) + 
size_type(*theString);
  +
  +        ++theString;
  +    }
  +
  +     return theResult;
  +}
  +
  +
  +
   #if defined(XALAN_USE_XERCES_LOCAL_CODEPAGE_TRANSCODERS)
   
   
  
  
  
  1.27      +11 -0     xml-xalan/c/src/XalanDOM/XalanDOMString.hpp
  
  Index: XalanDOMString.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XalanDOM/XalanDOMString.hpp,v
  retrieving revision 1.26
  retrieving revision 1.27
  diff -u -r1.26 -r1.27
  --- XalanDOMString.hpp        22 Nov 2002 02:25:38 -0000      1.26
  +++ XalanDOMString.hpp        22 Dec 2002 19:25:49 -0000      1.27
  @@ -694,6 +694,12 @@
        CharVectorType
        transcode() const;
   
  +     size_type
  +     hash() const
  +     {
  +             return hash(c_str(), size());
  +     }
  +
        static bool
        equals(
                        const XalanDOMChar*             theLHS,
  @@ -749,6 +755,11 @@
         */
        static size_type
        length(const char*      theString);
  +
  +     static size_type
  +     hash(
  +                     const XalanDOMChar*             theString,
  +                     size_type                               theLength);
   
        class TranscodingError : public XalanDOMException
        {
  
  
  

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

Reply via email to