Fix for bug 230633 (Constify Transformiix code a bit). r=Pike, sr=jst.

git-svn-id: svn://10.0.0.236/trunk@151409 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
peterv%propagandism.org
2004-01-16 13:46:07 +00:00
parent 96b973b116
commit 3587f51557
10 changed files with 324 additions and 340 deletions

View File

@@ -39,7 +39,34 @@
* ***** END LICENSE BLOCK ***** */
#include "txStringUtils.h"
#include "nsDependentString.h"
PRBool
TX_StringEqualsAtom(const nsASingleFragmentString& aString, nsIAtom* aAtom)
{
const char* ASCIIAtom;
aAtom->GetUTF8String(&ASCIIAtom);
PRUint32 UTF16Length = aString.Length();
if (strlen(ASCIIAtom) != UTF16Length) {
return PR_FALSE;
}
const PRUnichar* UTF16Iter;
aString.BeginReading(UTF16Iter);
while (ASCIIAtom) {
if (PRUnichar(*ASCIIAtom) != *UTF16Iter) {
return PR_FALSE;
}
++ASCIIAtom;
++UTF16Iter;
}
return PR_TRUE;
}
#ifdef TX_EXE
int
txCaseInsensitiveStringComparator::operator()(const char_type* lhs,
const char_type* rhs,
@@ -151,3 +178,5 @@ void TX_ToLowerCase(const nsAString& aSource, nsAString& aDest)
copy_string(aSource.BeginReading(fromBegin), aSource.EndReading(fromEnd),
converter);
}
#endif