From d80a2c24a69f5d23cfb9f6ddae2b462d738ac3db Mon Sep 17 00:00:00 2001 From: "scc%netscape.com" Date: Sun, 16 Apr 2000 11:09:16 +0000 Subject: [PATCH] no, the |Equals(PRUnichar*, PRUnichar*, ...)| form is not what you think it is. It has to go. Make comparing with |nsIAtoms| remain avalailable even in |NEW_STRINGS_APIS| git-svn-id: svn://10.0.0.236/trunk@66130 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/string/obsolete/nsString2.cpp | 32 ++++++++++----------- mozilla/string/obsolete/nsString2.h | 5 ++-- mozilla/xpcom/ds/nsString2.cpp | 32 ++++++++++----------- mozilla/xpcom/ds/nsString2.h | 5 ++-- mozilla/xpcom/string/obsolete/nsString2.cpp | 32 ++++++++++----------- mozilla/xpcom/string/obsolete/nsString2.h | 5 ++-- 6 files changed, 57 insertions(+), 54 deletions(-) diff --git a/mozilla/string/obsolete/nsString2.cpp b/mozilla/string/obsolete/nsString2.cpp index 01c51464d29..8252ad64adc 100644 --- a/mozilla/string/obsolete/nsString2.cpp +++ b/mozilla/string/obsolete/nsString2.cpp @@ -1970,21 +1970,6 @@ PRBool nsString::EqualsWithConversion(const PRUnichar* aString,PRBool aIgnoreCas return result; } -#ifndef NEW_STRING_APIS -/** - * Compare this to given string; note that we compare full strings here. - * - * @update gess 01/04/99 - * @param aString is the other nsString to be compared to - * @param aCount tells us how many chars to test; -1 implies full length - * @return TRUE if equal - */ -PRBool nsString::Equals(const nsStr& aString,PRBool aIgnoreCase,PRInt32 aCount) const { - PRInt32 theAnswer=nsStr::StrCompare(*this,aString,aCount,aIgnoreCase); - PRBool result=PRBool(0==theAnswer); - return result; -} - /** * Compare this to given atom; note that we compare full strings here. * The optional length argument just lets us know how long the given string is. @@ -1996,7 +1981,7 @@ PRBool nsString::Equals(const nsStr& aString,PRBool aIgnoreCase,PRInt32 aCount) * @param aLength -- length of given string. * @return TRUE if equal */ -PRBool nsString::Equals(/*FIX: const */nsIAtom* aAtom,PRBool aIgnoreCase) const{ +PRBool nsString::EqualsAtom(/*FIX: const */nsIAtom* aAtom,PRBool aIgnoreCase) const{ NS_ASSERTION(0!=aAtom,kNullPointerError); PRBool result=PR_FALSE; if(aAtom){ @@ -2014,6 +1999,21 @@ PRBool nsString::Equals(/*FIX: const */nsIAtom* aAtom,PRBool aIgnoreCase) const{ return result; } +#ifndef NEW_STRING_APIS +/** + * Compare this to given string; note that we compare full strings here. + * + * @update gess 01/04/99 + * @param aString is the other nsString to be compared to + * @param aCount tells us how many chars to test; -1 implies full length + * @return TRUE if equal + */ +PRBool nsString::Equals(const nsStr& aString,PRBool aIgnoreCase,PRInt32 aCount) const { + PRInt32 theAnswer=nsStr::StrCompare(*this,aString,aCount,aIgnoreCase); + PRBool result=PRBool(0==theAnswer); + return result; +} + /** * Compare given strings * @update gess 7/27/98 diff --git a/mozilla/string/obsolete/nsString2.h b/mozilla/string/obsolete/nsString2.h index ebb9a4786c5..1c8690f8dad 100644 --- a/mozilla/string/obsolete/nsString2.h +++ b/mozilla/string/obsolete/nsString2.h @@ -721,11 +721,11 @@ public: PRBool EqualsWithConversion(const nsString &aString,PRBool aIgnoreCase=PR_FALSE,PRInt32 aCount=-1) const; PRBool EqualsWithConversion(const char* aString,PRBool aIgnoreCase=PR_FALSE,PRInt32 aCount=-1) const; PRBool EqualsWithConversion(const PRUnichar* aString,PRBool aIgnoreCase=PR_FALSE,PRInt32 aCount=-1) const; + PRBool EqualsAtom(/*FIX: const */nsIAtom* anAtom,PRBool aIgnoreCase) const; PRBool EqualsIgnoreCase(const nsString& aString) const; PRBool EqualsIgnoreCase(const char* aString,PRInt32 aCount=-1) const; PRBool EqualsIgnoreCase(/*FIX: const */nsIAtom *aAtom) const; - PRBool EqualsIgnoreCase(const PRUnichar* s1, const PRUnichar* s2) const; #ifndef NEW_STRING_APIS virtual PRInt32 Compare(const char* aString,PRBool aIgnoreCase=PR_FALSE,PRInt32 aCount=-1) const { @@ -765,10 +765,11 @@ public: return EqualsWithConversion(aString,aIgnoreCase,aCount); } - PRBool Equals(/*FIX: const */nsIAtom* anAtom,PRBool aIgnoreCase) const; + PRBool Equals(/*FIX: const */nsIAtom* anAtom,PRBool aIgnoreCase) const { return EqualsAtom(anAtom, aIgnoreCase); } PRBool Equals(const PRUnichar* s1, const PRUnichar* s2,PRBool aIgnoreCase=PR_FALSE) const; PRBool Equals(const nsStr& aString,PRBool aIgnoreCase=PR_FALSE,PRInt32 aCount=-1) const; + PRBool EqualsIgnoreCase(const PRUnichar* s1, const PRUnichar* s2) const; /** * These methods compare a given string type to this one diff --git a/mozilla/xpcom/ds/nsString2.cpp b/mozilla/xpcom/ds/nsString2.cpp index 01c51464d29..8252ad64adc 100644 --- a/mozilla/xpcom/ds/nsString2.cpp +++ b/mozilla/xpcom/ds/nsString2.cpp @@ -1970,21 +1970,6 @@ PRBool nsString::EqualsWithConversion(const PRUnichar* aString,PRBool aIgnoreCas return result; } -#ifndef NEW_STRING_APIS -/** - * Compare this to given string; note that we compare full strings here. - * - * @update gess 01/04/99 - * @param aString is the other nsString to be compared to - * @param aCount tells us how many chars to test; -1 implies full length - * @return TRUE if equal - */ -PRBool nsString::Equals(const nsStr& aString,PRBool aIgnoreCase,PRInt32 aCount) const { - PRInt32 theAnswer=nsStr::StrCompare(*this,aString,aCount,aIgnoreCase); - PRBool result=PRBool(0==theAnswer); - return result; -} - /** * Compare this to given atom; note that we compare full strings here. * The optional length argument just lets us know how long the given string is. @@ -1996,7 +1981,7 @@ PRBool nsString::Equals(const nsStr& aString,PRBool aIgnoreCase,PRInt32 aCount) * @param aLength -- length of given string. * @return TRUE if equal */ -PRBool nsString::Equals(/*FIX: const */nsIAtom* aAtom,PRBool aIgnoreCase) const{ +PRBool nsString::EqualsAtom(/*FIX: const */nsIAtom* aAtom,PRBool aIgnoreCase) const{ NS_ASSERTION(0!=aAtom,kNullPointerError); PRBool result=PR_FALSE; if(aAtom){ @@ -2014,6 +1999,21 @@ PRBool nsString::Equals(/*FIX: const */nsIAtom* aAtom,PRBool aIgnoreCase) const{ return result; } +#ifndef NEW_STRING_APIS +/** + * Compare this to given string; note that we compare full strings here. + * + * @update gess 01/04/99 + * @param aString is the other nsString to be compared to + * @param aCount tells us how many chars to test; -1 implies full length + * @return TRUE if equal + */ +PRBool nsString::Equals(const nsStr& aString,PRBool aIgnoreCase,PRInt32 aCount) const { + PRInt32 theAnswer=nsStr::StrCompare(*this,aString,aCount,aIgnoreCase); + PRBool result=PRBool(0==theAnswer); + return result; +} + /** * Compare given strings * @update gess 7/27/98 diff --git a/mozilla/xpcom/ds/nsString2.h b/mozilla/xpcom/ds/nsString2.h index ebb9a4786c5..1c8690f8dad 100644 --- a/mozilla/xpcom/ds/nsString2.h +++ b/mozilla/xpcom/ds/nsString2.h @@ -721,11 +721,11 @@ public: PRBool EqualsWithConversion(const nsString &aString,PRBool aIgnoreCase=PR_FALSE,PRInt32 aCount=-1) const; PRBool EqualsWithConversion(const char* aString,PRBool aIgnoreCase=PR_FALSE,PRInt32 aCount=-1) const; PRBool EqualsWithConversion(const PRUnichar* aString,PRBool aIgnoreCase=PR_FALSE,PRInt32 aCount=-1) const; + PRBool EqualsAtom(/*FIX: const */nsIAtom* anAtom,PRBool aIgnoreCase) const; PRBool EqualsIgnoreCase(const nsString& aString) const; PRBool EqualsIgnoreCase(const char* aString,PRInt32 aCount=-1) const; PRBool EqualsIgnoreCase(/*FIX: const */nsIAtom *aAtom) const; - PRBool EqualsIgnoreCase(const PRUnichar* s1, const PRUnichar* s2) const; #ifndef NEW_STRING_APIS virtual PRInt32 Compare(const char* aString,PRBool aIgnoreCase=PR_FALSE,PRInt32 aCount=-1) const { @@ -765,10 +765,11 @@ public: return EqualsWithConversion(aString,aIgnoreCase,aCount); } - PRBool Equals(/*FIX: const */nsIAtom* anAtom,PRBool aIgnoreCase) const; + PRBool Equals(/*FIX: const */nsIAtom* anAtom,PRBool aIgnoreCase) const { return EqualsAtom(anAtom, aIgnoreCase); } PRBool Equals(const PRUnichar* s1, const PRUnichar* s2,PRBool aIgnoreCase=PR_FALSE) const; PRBool Equals(const nsStr& aString,PRBool aIgnoreCase=PR_FALSE,PRInt32 aCount=-1) const; + PRBool EqualsIgnoreCase(const PRUnichar* s1, const PRUnichar* s2) const; /** * These methods compare a given string type to this one diff --git a/mozilla/xpcom/string/obsolete/nsString2.cpp b/mozilla/xpcom/string/obsolete/nsString2.cpp index 01c51464d29..8252ad64adc 100644 --- a/mozilla/xpcom/string/obsolete/nsString2.cpp +++ b/mozilla/xpcom/string/obsolete/nsString2.cpp @@ -1970,21 +1970,6 @@ PRBool nsString::EqualsWithConversion(const PRUnichar* aString,PRBool aIgnoreCas return result; } -#ifndef NEW_STRING_APIS -/** - * Compare this to given string; note that we compare full strings here. - * - * @update gess 01/04/99 - * @param aString is the other nsString to be compared to - * @param aCount tells us how many chars to test; -1 implies full length - * @return TRUE if equal - */ -PRBool nsString::Equals(const nsStr& aString,PRBool aIgnoreCase,PRInt32 aCount) const { - PRInt32 theAnswer=nsStr::StrCompare(*this,aString,aCount,aIgnoreCase); - PRBool result=PRBool(0==theAnswer); - return result; -} - /** * Compare this to given atom; note that we compare full strings here. * The optional length argument just lets us know how long the given string is. @@ -1996,7 +1981,7 @@ PRBool nsString::Equals(const nsStr& aString,PRBool aIgnoreCase,PRInt32 aCount) * @param aLength -- length of given string. * @return TRUE if equal */ -PRBool nsString::Equals(/*FIX: const */nsIAtom* aAtom,PRBool aIgnoreCase) const{ +PRBool nsString::EqualsAtom(/*FIX: const */nsIAtom* aAtom,PRBool aIgnoreCase) const{ NS_ASSERTION(0!=aAtom,kNullPointerError); PRBool result=PR_FALSE; if(aAtom){ @@ -2014,6 +1999,21 @@ PRBool nsString::Equals(/*FIX: const */nsIAtom* aAtom,PRBool aIgnoreCase) const{ return result; } +#ifndef NEW_STRING_APIS +/** + * Compare this to given string; note that we compare full strings here. + * + * @update gess 01/04/99 + * @param aString is the other nsString to be compared to + * @param aCount tells us how many chars to test; -1 implies full length + * @return TRUE if equal + */ +PRBool nsString::Equals(const nsStr& aString,PRBool aIgnoreCase,PRInt32 aCount) const { + PRInt32 theAnswer=nsStr::StrCompare(*this,aString,aCount,aIgnoreCase); + PRBool result=PRBool(0==theAnswer); + return result; +} + /** * Compare given strings * @update gess 7/27/98 diff --git a/mozilla/xpcom/string/obsolete/nsString2.h b/mozilla/xpcom/string/obsolete/nsString2.h index ebb9a4786c5..1c8690f8dad 100644 --- a/mozilla/xpcom/string/obsolete/nsString2.h +++ b/mozilla/xpcom/string/obsolete/nsString2.h @@ -721,11 +721,11 @@ public: PRBool EqualsWithConversion(const nsString &aString,PRBool aIgnoreCase=PR_FALSE,PRInt32 aCount=-1) const; PRBool EqualsWithConversion(const char* aString,PRBool aIgnoreCase=PR_FALSE,PRInt32 aCount=-1) const; PRBool EqualsWithConversion(const PRUnichar* aString,PRBool aIgnoreCase=PR_FALSE,PRInt32 aCount=-1) const; + PRBool EqualsAtom(/*FIX: const */nsIAtom* anAtom,PRBool aIgnoreCase) const; PRBool EqualsIgnoreCase(const nsString& aString) const; PRBool EqualsIgnoreCase(const char* aString,PRInt32 aCount=-1) const; PRBool EqualsIgnoreCase(/*FIX: const */nsIAtom *aAtom) const; - PRBool EqualsIgnoreCase(const PRUnichar* s1, const PRUnichar* s2) const; #ifndef NEW_STRING_APIS virtual PRInt32 Compare(const char* aString,PRBool aIgnoreCase=PR_FALSE,PRInt32 aCount=-1) const { @@ -765,10 +765,11 @@ public: return EqualsWithConversion(aString,aIgnoreCase,aCount); } - PRBool Equals(/*FIX: const */nsIAtom* anAtom,PRBool aIgnoreCase) const; + PRBool Equals(/*FIX: const */nsIAtom* anAtom,PRBool aIgnoreCase) const { return EqualsAtom(anAtom, aIgnoreCase); } PRBool Equals(const PRUnichar* s1, const PRUnichar* s2,PRBool aIgnoreCase=PR_FALSE) const; PRBool Equals(const nsStr& aString,PRBool aIgnoreCase=PR_FALSE,PRInt32 aCount=-1) const; + PRBool EqualsIgnoreCase(const PRUnichar* s1, const PRUnichar* s2) const; /** * These methods compare a given string type to this one