(file) Return to HashTable.h CVS log (file) (dir) Up to [Pegasus] / pegasus / src / Pegasus / Common

Diff for /pegasus/src/Pegasus/Common/HashTable.h between version 1.20 and 1.21

version 1.20, 2005/08/10 19:42:49 version 1.21, 2005/10/31 16:33:03
Line 70 
Line 70 
     }     }
 }; };
  
 /*  //
     Hash function object that converts to lowercase.  // Computes a hash code for a string without regard to case. For example, it
   // yields the same hash code for "AB", "ab", "Ab", and "aB".
     This function can be used for hash table keys constructed from strings that  //
     should be treated as case insensitive (e.g. class names, namespace names,  struct PEGASUS_COMMON_LINKAGE HashLowerCaseFunc
     system names).  
   
     Note: this function converts to lower case based on the process locale.  
 */  
 struct HashLowerCaseFunc  
 { {
     static Uint32 hash (const String & str)      static Uint32 hash(const String& str);
     {  
         String cpy (str);  
         cpy.toLower ();  
         Uint32 h = 0;  
         for (Uint32 i = 0, n = cpy.size (); i < n; i++)  
             h = 5 * h + cpy [i];  
         return h;  
     }  
 }; };
  
 /*  This is a function object used by the HashTable to compare keys. This is /*  This is a function object used by the HashTable to compare keys. This is


Legend:
Removed from v.1.20  
changed lines
  Added in v.1.21

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2