Back to index

lightning-sunbird  0.9+nobinonly
Public Types | Public Member Functions | Protected Attributes
CopyToLowerCase Class Reference

A character sink for copying with case conversion. More...

List of all members.

Public Types

typedef PRUnichar value_type
typedef PRUnichar value_type
typedef char value_type

Public Member Functions

 CopyToLowerCase (nsAString::iterator &aDestIter)
PRUint32 write (const PRUnichar *aSource, PRUint32 aSourceLength)
 CopyToLowerCase (nsAString::iterator &aDestIter)
PRUint32 write (const PRUnichar *aSource, PRUint32 aSourceLength)
 CopyToLowerCase (nsACString::iterator &aDestIter)
PRUint32 write (const char *aSource, PRUint32 aSourceLength)

Protected Attributes

nsAString::iterator & mIter
nsACString::iterator & mIter

Detailed Description

A character sink for copying with case conversion.

Definition at line 114 of file txStringUtils.cpp.


Member Typedef Documentation

Definition at line 117 of file txStringUtils.cpp.

Definition at line 143 of file nsUnicharUtils.cpp.

Definition at line 759 of file nsReadableUtils.cpp.


Constructor & Destructor Documentation

CopyToLowerCase::CopyToLowerCase ( nsAString::iterator &  aDestIter) [inline]

Definition at line 119 of file txStringUtils.cpp.

                                                : mIter(aDestIter)
  {
  }
CopyToLowerCase::CopyToLowerCase ( nsAString::iterator &  aDestIter) [inline]

Definition at line 145 of file nsUnicharUtils.cpp.

        : mIter(aDestIter)
        {
          NS_InitCaseConversion();
        }

Here is the call graph for this function:

CopyToLowerCase::CopyToLowerCase ( nsACString::iterator &  aDestIter) [inline]

Definition at line 761 of file nsReadableUtils.cpp.

        : mIter(aDestIter)
        {
        }

Member Function Documentation

PRUint32 CopyToLowerCase::write ( const PRUnichar aSource,
PRUint32  aSourceLength 
) [inline]

Definition at line 123 of file txStringUtils.cpp.

  {
    PRUint32 len = PR_MIN(PRUint32(mIter.size_forward()), aSourceLength);
    PRUnichar* cp = mIter.get();
    const PRUnichar* end = aSource + len;
    while (aSource != end) {
      PRUnichar ch = *aSource;
      if ((ch >= 'A') && (ch <= 'Z'))
        *cp = ch + ('a' - 'A');
      else
        *cp = ch;
      ++aSource;
      ++cp;
    }
    mIter.advance(len);
    return len;
  }
PRUint32 CopyToLowerCase::write ( const PRUnichar aSource,
PRUint32  aSourceLength 
) [inline]

Definition at line 151 of file nsUnicharUtils.cpp.

        {
          PRUint32 len = PR_MIN(PRUint32(mIter.size_forward()), aSourceLength);
          PRUnichar* dest = mIter.get();
          if (gCaseConv)
              gCaseConv->ToLower(aSource, dest, len);
          else {
              NS_WARNING("No case converter: only copying");
              memcpy(dest, aSource, len * sizeof(*aSource));
          }
          mIter.advance(len);
          return len;
        }

Here is the call graph for this function:

PRUint32 CopyToLowerCase::write ( const char *  aSource,
PRUint32  aSourceLength 
) [inline]

Definition at line 767 of file nsReadableUtils.cpp.

        {
          PRUint32 len = PR_MIN(PRUint32(mIter.size_forward()), aSourceLength);
          char* cp = mIter.get();
          const char* end = aSource + len;
          while (aSource != end) {
            char ch = *aSource;
            if ((ch >= 'A') && (ch <= 'Z'))
              *cp = ch + ('a' - 'A');
            else
              *cp = ch;
            ++aSource;
            ++cp;
          }
          mIter.advance(len);
          return len;
        }

Member Data Documentation

nsAString::iterator & CopyToLowerCase::mIter [protected]

Definition at line 142 of file txStringUtils.cpp.

nsACString::iterator& CopyToLowerCase::mIter [protected]

Definition at line 786 of file nsReadableUtils.cpp.


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