Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions
nsCaseInsensitiveStringComparator Class Reference

#include <nsUnicharUtils.h>

List of all members.

Public Member Functions

virtual int operator() (const PRUnichar *, const PRUnichar *, PRUint32 aLength) const
virtual int operator() (PRUnichar, PRUnichar) const

Detailed Description

Definition at line 63 of file nsUnicharUtils.h.


Member Function Documentation

int nsCaseInsensitiveStringComparator::operator() ( const PRUnichar lhs,
const PRUnichar rhs,
PRUint32  aLength 
) const [virtual]

Definition at line 274 of file nsUnicharUtils.cpp.

  {
      NS_InitCaseConversion();
      PRInt32 result;
      if (gCaseConv) {
          gCaseConv->CaseInsensitiveCompare(lhs, rhs, aLength, &result);
      }
      else {
          NS_WARNING("No case converter: using default");
          nsDefaultStringComparator comparator;
          result = comparator(lhs, rhs, aLength);
      }
      return result;
  }

Here is the call graph for this function:

int nsCaseInsensitiveStringComparator::operator() ( PRUnichar  lhs,
PRUnichar  rhs 
) const [virtual]

Definition at line 290 of file nsUnicharUtils.cpp.

  {
      // see if they're an exact match first
      if (lhs == rhs) return 0;
      
      NS_InitCaseConversion();

      if (gCaseConv) {
          gCaseConv->ToLower(lhs, &lhs);
          gCaseConv->ToLower(rhs, &rhs);
      } else {
          if (lhs < 256)
              lhs = tolower(char(lhs));
          if (rhs < 256)
              rhs = tolower(char(rhs));
          NS_WARNING("No case converter: no conversion done");
      }
      
      if (lhs == rhs) return 0;
      if (lhs < rhs) return -1;
      return 1;
  }

Here is the call graph for this function:


The documentation for this class was generated from the following files: