diff --git a/mozilla/content/html/style/src/nsCSSLoader.cpp b/mozilla/content/html/style/src/nsCSSLoader.cpp
index 7ea2d3a3f5c..75d17490bb5 100644
--- a/mozilla/content/html/style/src/nsCSSLoader.cpp
+++ b/mozilla/content/html/style/src/nsCSSLoader.cpp
@@ -853,7 +853,7 @@ static PRBool EnumerateMediaString(const nsString& aStringList, nsStringEnumFunc
while (running && (kNullCh != *start)) {
PRBool quoted = PR_FALSE;
- while ((kNullCh != *start) && nsString::IsSpace(*start)) { // skip leading space
+ while ((kNullCh != *start) && nsCRT::IsAsciiSpace(*start)) { // skip leading space
start++;
}
@@ -884,8 +884,8 @@ static PRBool EnumerateMediaString(const nsString& aStringList, nsStringEnumFunc
// truncate at first non letter, digit or hyphen
PRUnichar* test = start;
while (test <= end) {
- if ((PR_FALSE == nsString::IsAlpha(*test)) &&
- (PR_FALSE == nsString::IsDigit(*test)) && (kMinus != *test)) {
+ if ((PR_FALSE == nsCRT::IsAsciiAlpha(*test)) &&
+ (PR_FALSE == nsCRT::IsAsciiDigit(*test)) && (kMinus != *test)) {
*test = kNullCh;
break;
}
diff --git a/mozilla/content/html/style/src/nsCSSStyleSheet.cpp b/mozilla/content/html/style/src/nsCSSStyleSheet.cpp
index 2938bf9e5ff..eedd5ab886d 100644
--- a/mozilla/content/html/style/src/nsCSSStyleSheet.cpp
+++ b/mozilla/content/html/style/src/nsCSSStyleSheet.cpp
@@ -2198,12 +2198,12 @@ static PRBool ValueIncludes(const nsString& aValueList, const nsString& aValue,
PRUnichar* end = start;
while (kNullCh != *start) {
- while ((kNullCh != *start) && nsString::IsSpace(*start)) { // skip leading space
+ while ((kNullCh != *start) && nsCRT::IsAsciiSpace(*start)) { // skip leading space
start++;
}
end = start;
- while ((kNullCh != *end) && (PR_FALSE == nsString::IsSpace(*end))) { // look for space or end
+ while ((kNullCh != *end) && (PR_FALSE == nsCRT::IsAsciiSpace(*end))) { // look for space or end
end++;
}
*end = kNullCh; // end string here
@@ -2239,7 +2239,7 @@ static PRBool ValueDashMatch(const nsString& aValueList, const nsString& aValue,
PRUnichar* end = start;
if (kNullCh != *start) {
- while ((kNullCh != *start) && nsString::IsSpace(*start)) { // skip leading space
+ while ((kNullCh != *start) && nsCRT::IsAsciiSpace(*start)) { // skip leading space
start++;
}
end = start;
diff --git a/mozilla/content/html/style/src/nsHTMLAttributes.cpp b/mozilla/content/html/style/src/nsHTMLAttributes.cpp
index 24723d3644e..b075ad6de63 100644
--- a/mozilla/content/html/style/src/nsHTMLAttributes.cpp
+++ b/mozilla/content/html/style/src/nsHTMLAttributes.cpp
@@ -978,12 +978,12 @@ static void ParseClasses(const nsString& aClassString, nsClassList& aClassList)
nsClassList* list = &aClassList;
while (list && (kNullCh != *start)) {
- while ((kNullCh != *start) && nsString::IsSpace(*start)) { // skip leading space
+ while ((kNullCh != *start) && nsCRT::IsAsciiSpace(*start)) { // skip leading space
start++;
}
end = start;
- while ((kNullCh != *end) && (PR_FALSE == nsString::IsSpace(*end))) { // look for space or end
+ while ((kNullCh != *end) && (PR_FALSE == nsCRT::IsAsciiSpace(*end))) { // look for space or end
end++;
}
*end = kNullCh; // end string here
diff --git a/mozilla/dom/src/base/nsGlobalWindow.cpp b/mozilla/dom/src/base/nsGlobalWindow.cpp
index c6feb2932d8..60b238dd668 100644
--- a/mozilla/dom/src/base/nsGlobalWindow.cpp
+++ b/mozilla/dom/src/base/nsGlobalWindow.cpp
@@ -2771,7 +2771,7 @@ NS_IMETHODIMP GlobalWindowImpl::CheckWindowName(JSContext* cx, nsString& aName)
for(strIndex = 0; strIndex < aName.Length(); strIndex++)
{
mChar = aName.CharAt(strIndex);
- if(!nsString::IsAlpha(mChar) && !nsString::IsDigit(mChar) &&
+ if(!nsCRT::IsAsciiAlpha(mChar) && !nsCRT::IsAsciiDigit(mChar) &&
mChar != '_')
{
char* cp = aName.ToNewCString();
diff --git a/mozilla/editor/base/nsHTMLEditRules.cpp b/mozilla/editor/base/nsHTMLEditRules.cpp
index e6d49be0873..ce278cb157c 100644
--- a/mozilla/editor/base/nsHTMLEditRules.cpp
+++ b/mozilla/editor/base/nsHTMLEditRules.cpp
@@ -3823,7 +3823,7 @@ nsHTMLEditRules::DoTextNodeWhitespace(nsIDOMCharacterData *aTextNode, PRInt32 aS
PRInt32 runStart = -1, runEnd = -1;
do {
PRUnichar c = tempString[j];
- PRBool isSpace = nsString::IsSpace(c);
+ PRBool isSpace = nsCRT::IsAsciiSpace(c);
if (isSpace || c==nbsp)
{
if (runStart<0) runStart = j;
diff --git a/mozilla/editor/base/nsHTMLEditorLog.cpp b/mozilla/editor/base/nsHTMLEditorLog.cpp
index 0b7f083c5a1..ef95d6fb919 100644
--- a/mozilla/editor/base/nsHTMLEditorLog.cpp
+++ b/mozilla/editor/base/nsHTMLEditorLog.cpp
@@ -909,7 +909,7 @@ nsHTMLEditorLog::PrintUnicode(const nsString &aString)
for (i = 0; i < len; i++)
{
- if (nsString::IsAlpha(uc[i]) || nsString::IsDigit(uc[i]) || uc[i] == ' ')
+ if (nsCRT::IsAsciiAlpha(uc[i]) || nsCRT::IsAsciiDigit(uc[i]) || uc[i] == ' ')
sprintf(buf, "%c", uc[i]);
else
sprintf(buf, "\\u%.4x", uc[i]);
diff --git a/mozilla/editor/libeditor/html/nsHTMLEditRules.cpp b/mozilla/editor/libeditor/html/nsHTMLEditRules.cpp
index e6d49be0873..ce278cb157c 100644
--- a/mozilla/editor/libeditor/html/nsHTMLEditRules.cpp
+++ b/mozilla/editor/libeditor/html/nsHTMLEditRules.cpp
@@ -3823,7 +3823,7 @@ nsHTMLEditRules::DoTextNodeWhitespace(nsIDOMCharacterData *aTextNode, PRInt32 aS
PRInt32 runStart = -1, runEnd = -1;
do {
PRUnichar c = tempString[j];
- PRBool isSpace = nsString::IsSpace(c);
+ PRBool isSpace = nsCRT::IsAsciiSpace(c);
if (isSpace || c==nbsp)
{
if (runStart<0) runStart = j;
diff --git a/mozilla/editor/libeditor/html/nsHTMLEditorLog.cpp b/mozilla/editor/libeditor/html/nsHTMLEditorLog.cpp
index 0b7f083c5a1..ef95d6fb919 100644
--- a/mozilla/editor/libeditor/html/nsHTMLEditorLog.cpp
+++ b/mozilla/editor/libeditor/html/nsHTMLEditorLog.cpp
@@ -909,7 +909,7 @@ nsHTMLEditorLog::PrintUnicode(const nsString &aString)
for (i = 0; i < len; i++)
{
- if (nsString::IsAlpha(uc[i]) || nsString::IsDigit(uc[i]) || uc[i] == ' ')
+ if (nsCRT::IsAsciiAlpha(uc[i]) || nsCRT::IsAsciiDigit(uc[i]) || uc[i] == ' ')
sprintf(buf, "%c", uc[i]);
else
sprintf(buf, "\\u%.4x", uc[i]);
diff --git a/mozilla/gfx/src/nsColorNames.cpp b/mozilla/gfx/src/nsColorNames.cpp
index b46598469c8..39f9ae16035 100644
--- a/mozilla/gfx/src/nsColorNames.cpp
+++ b/mozilla/gfx/src/nsColorNames.cpp
@@ -132,18 +132,9 @@ nsColorNames::LookupName(const nsCString& aColorName)
}
nsColorName
-nsColorNames::LookupName(const nsString& aColorName)
-{
- NS_ASSERTION(gColorTree, "no lookup table, needs addref");
- if (gColorTree) {
- ColorNode node(aColorName, eColorName_UNKNOWN);
- ColorNode* found = (ColorNode*)gColorTree->FindItem(&node);
- if (found) {
- NS_ASSERTION(found->mStr.EqualsIgnoreCase(aColorName), "bad tree");
- return found->mEnum;
- }
- }
- return eColorName_UNKNOWN;
+nsColorNames::LookupName(const nsString& aColorName) {
+ nsCAutoString theName(aColorName);
+ return LookupName(theName);
}
diff --git a/mozilla/gfx/src/nsFont.cpp b/mozilla/gfx/src/nsFont.cpp
index 4891040ce33..c927294c55b 100644
--- a/mozilla/gfx/src/nsFont.cpp
+++ b/mozilla/gfx/src/nsFont.cpp
@@ -116,7 +116,7 @@ PRBool nsFont::EnumerateFamilies(nsFontFamilyEnumFunc aFunc, void* aData) const
PRBool quoted = PR_FALSE;
PRBool generic = PR_FALSE;
- while ((kNullCh != *start) && nsString::IsSpace(*start)) { // skip leading space
+ while ((kNullCh != *start) && nsCRT::IsAsciiSpace(*start)) { // skip leading space
start++;
}
diff --git a/mozilla/layout/html/style/src/nsCSSLoader.cpp b/mozilla/layout/html/style/src/nsCSSLoader.cpp
index 7ea2d3a3f5c..75d17490bb5 100644
--- a/mozilla/layout/html/style/src/nsCSSLoader.cpp
+++ b/mozilla/layout/html/style/src/nsCSSLoader.cpp
@@ -853,7 +853,7 @@ static PRBool EnumerateMediaString(const nsString& aStringList, nsStringEnumFunc
while (running && (kNullCh != *start)) {
PRBool quoted = PR_FALSE;
- while ((kNullCh != *start) && nsString::IsSpace(*start)) { // skip leading space
+ while ((kNullCh != *start) && nsCRT::IsAsciiSpace(*start)) { // skip leading space
start++;
}
@@ -884,8 +884,8 @@ static PRBool EnumerateMediaString(const nsString& aStringList, nsStringEnumFunc
// truncate at first non letter, digit or hyphen
PRUnichar* test = start;
while (test <= end) {
- if ((PR_FALSE == nsString::IsAlpha(*test)) &&
- (PR_FALSE == nsString::IsDigit(*test)) && (kMinus != *test)) {
+ if ((PR_FALSE == nsCRT::IsAsciiAlpha(*test)) &&
+ (PR_FALSE == nsCRT::IsAsciiDigit(*test)) && (kMinus != *test)) {
*test = kNullCh;
break;
}
diff --git a/mozilla/layout/html/style/src/nsCSSStyleSheet.cpp b/mozilla/layout/html/style/src/nsCSSStyleSheet.cpp
index 2938bf9e5ff..eedd5ab886d 100644
--- a/mozilla/layout/html/style/src/nsCSSStyleSheet.cpp
+++ b/mozilla/layout/html/style/src/nsCSSStyleSheet.cpp
@@ -2198,12 +2198,12 @@ static PRBool ValueIncludes(const nsString& aValueList, const nsString& aValue,
PRUnichar* end = start;
while (kNullCh != *start) {
- while ((kNullCh != *start) && nsString::IsSpace(*start)) { // skip leading space
+ while ((kNullCh != *start) && nsCRT::IsAsciiSpace(*start)) { // skip leading space
start++;
}
end = start;
- while ((kNullCh != *end) && (PR_FALSE == nsString::IsSpace(*end))) { // look for space or end
+ while ((kNullCh != *end) && (PR_FALSE == nsCRT::IsAsciiSpace(*end))) { // look for space or end
end++;
}
*end = kNullCh; // end string here
@@ -2239,7 +2239,7 @@ static PRBool ValueDashMatch(const nsString& aValueList, const nsString& aValue,
PRUnichar* end = start;
if (kNullCh != *start) {
- while ((kNullCh != *start) && nsString::IsSpace(*start)) { // skip leading space
+ while ((kNullCh != *start) && nsCRT::IsAsciiSpace(*start)) { // skip leading space
start++;
}
end = start;
diff --git a/mozilla/layout/html/style/src/nsHTMLAttributes.cpp b/mozilla/layout/html/style/src/nsHTMLAttributes.cpp
index 24723d3644e..b075ad6de63 100644
--- a/mozilla/layout/html/style/src/nsHTMLAttributes.cpp
+++ b/mozilla/layout/html/style/src/nsHTMLAttributes.cpp
@@ -978,12 +978,12 @@ static void ParseClasses(const nsString& aClassString, nsClassList& aClassList)
nsClassList* list = &aClassList;
while (list && (kNullCh != *start)) {
- while ((kNullCh != *start) && nsString::IsSpace(*start)) { // skip leading space
+ while ((kNullCh != *start) && nsCRT::IsAsciiSpace(*start)) { // skip leading space
start++;
}
end = start;
- while ((kNullCh != *end) && (PR_FALSE == nsString::IsSpace(*end))) { // look for space or end
+ while ((kNullCh != *end) && (PR_FALSE == nsCRT::IsAsciiSpace(*end))) { // look for space or end
end++;
}
*end = kNullCh; // end string here
diff --git a/mozilla/layout/style/nsCSSLoader.cpp b/mozilla/layout/style/nsCSSLoader.cpp
index 7ea2d3a3f5c..75d17490bb5 100644
--- a/mozilla/layout/style/nsCSSLoader.cpp
+++ b/mozilla/layout/style/nsCSSLoader.cpp
@@ -853,7 +853,7 @@ static PRBool EnumerateMediaString(const nsString& aStringList, nsStringEnumFunc
while (running && (kNullCh != *start)) {
PRBool quoted = PR_FALSE;
- while ((kNullCh != *start) && nsString::IsSpace(*start)) { // skip leading space
+ while ((kNullCh != *start) && nsCRT::IsAsciiSpace(*start)) { // skip leading space
start++;
}
@@ -884,8 +884,8 @@ static PRBool EnumerateMediaString(const nsString& aStringList, nsStringEnumFunc
// truncate at first non letter, digit or hyphen
PRUnichar* test = start;
while (test <= end) {
- if ((PR_FALSE == nsString::IsAlpha(*test)) &&
- (PR_FALSE == nsString::IsDigit(*test)) && (kMinus != *test)) {
+ if ((PR_FALSE == nsCRT::IsAsciiAlpha(*test)) &&
+ (PR_FALSE == nsCRT::IsAsciiDigit(*test)) && (kMinus != *test)) {
*test = kNullCh;
break;
}
diff --git a/mozilla/layout/style/nsCSSStyleSheet.cpp b/mozilla/layout/style/nsCSSStyleSheet.cpp
index 2938bf9e5ff..eedd5ab886d 100644
--- a/mozilla/layout/style/nsCSSStyleSheet.cpp
+++ b/mozilla/layout/style/nsCSSStyleSheet.cpp
@@ -2198,12 +2198,12 @@ static PRBool ValueIncludes(const nsString& aValueList, const nsString& aValue,
PRUnichar* end = start;
while (kNullCh != *start) {
- while ((kNullCh != *start) && nsString::IsSpace(*start)) { // skip leading space
+ while ((kNullCh != *start) && nsCRT::IsAsciiSpace(*start)) { // skip leading space
start++;
}
end = start;
- while ((kNullCh != *end) && (PR_FALSE == nsString::IsSpace(*end))) { // look for space or end
+ while ((kNullCh != *end) && (PR_FALSE == nsCRT::IsAsciiSpace(*end))) { // look for space or end
end++;
}
*end = kNullCh; // end string here
@@ -2239,7 +2239,7 @@ static PRBool ValueDashMatch(const nsString& aValueList, const nsString& aValue,
PRUnichar* end = start;
if (kNullCh != *start) {
- while ((kNullCh != *start) && nsString::IsSpace(*start)) { // skip leading space
+ while ((kNullCh != *start) && nsCRT::IsAsciiSpace(*start)) { // skip leading space
start++;
}
end = start;
diff --git a/mozilla/string/obsolete/nsString.cpp b/mozilla/string/obsolete/nsString.cpp
index 58f9d66b8a7..342077ce712 100644
--- a/mozilla/string/obsolete/nsString.cpp
+++ b/mozilla/string/obsolete/nsString.cpp
@@ -143,27 +143,6 @@ void nsCString::Truncate(PRUint32 anIndex) {
nsStr::Truncate(*this,anIndex);
}
-/**
- * Determine whether or not the characters in this
- * string are in sorted order.
- *
- * @update gess 8/25/98
- * @return TRUE if ordered.
- */
-PRBool nsCString::IsOrdered(void) const {
- PRBool result=PR_TRUE;
- if(mLength>1) {
- PRUint32 theIndex;
- for(theIndex=1;theIndexmStr[theIndex]) {
- result=PR_FALSE;
- break;
- }
- }
- }
- return result;
-}
-
/**
* Call this method if you want to force the string to a certain capacity
@@ -1205,30 +1184,6 @@ nsCString& nsCString::Cut(PRUint32 anOffset, PRInt32 aCount) {
Searching methods...
*********************************************************************/
-/**
- * Search for given character within this string.
- * This method does so by using a binary search,
- * so your string HAD BETTER BE ORDERED!
- *
- * @param aChar is the unicode char to be found
- * @return offset in string, or -1 (kNotFound)
- */
-PRInt32 nsCString::BinarySearch(PRUnichar aChar) const{
- PRInt32 low=0;
- PRInt32 high=mLength-1;
-
- while (low <= high) {
- int middle = (low + high) >> 1;
- PRUnichar theChar=GetCharAt(*this,middle);
- if (theChar==aChar)
- return middle;
- if (theChar>aChar)
- high = middle - 1;
- else
- low = middle + 1;
- }
- return kNotFound;
-}
/**
* Search for given cstr within this string
diff --git a/mozilla/string/obsolete/nsString.h b/mozilla/string/obsolete/nsString.h
index 78c405a2be0..c22566b1269 100644
--- a/mozilla/string/obsolete/nsString.h
+++ b/mozilla/string/obsolete/nsString.h
@@ -130,16 +130,6 @@ public:
*/
void Truncate(PRUint32 anIndex=0);
-
- /**
- * Determine whether or not the characters in this
- * string are in sorted order.
- *
- * @return TRUE if ordered.
- */
- PRBool IsOrdered(void) const;
-
-
/**
* Determine whether or not this string has a length of 0
*
@@ -516,15 +506,6 @@ public:
Searching methods...
*********************************************************************/
- /**
- * Search for given character within this string.
- * This method does so by using a binary search,
- * so your string HAD BETTER BE ORDERED!
- *
- * @param aChar is the unicode char to be found
- * @return offset in string, or -1 (kNotFound)
- */
- PRInt32 BinarySearch(PRUnichar aChar) const;
/**
* Search for given substring within this string
diff --git a/mozilla/string/obsolete/nsString2.cpp b/mozilla/string/obsolete/nsString2.cpp
index cd49a01279d..e8a09208970 100644
--- a/mozilla/string/obsolete/nsString2.cpp
+++ b/mozilla/string/obsolete/nsString2.cpp
@@ -153,31 +153,6 @@ void nsString::Truncate(PRUint32 anIndex) {
nsStr::Truncate(*this,anIndex);
}
-/**
- * Determine whether or not the characters in this
- * string are in sorted order.
- *
- * @update gess 8/25/98
- * @return TRUE if ordered.
- */
-PRBool nsString::IsOrdered(void) const {
- PRBool result=PR_TRUE;
- if(mLength>1) {
- PRUint32 theIndex;
- PRUnichar c1=0;
- PRUnichar c2=GetCharAt(*this,0);
- for(theIndex=1;theIndexc2) {
- result=PR_FALSE;
- break;
- }
- }
- }
- return result;
-}
-
/**
* Call this method if you want to force the string to a certain capacity
@@ -1411,31 +1386,6 @@ nsString& nsString::Cut(PRUint32 anOffset, PRInt32 aCount) {
Searching methods...
*********************************************************************/
-/**
- * Search for given character within this string.
- * This method does so by using a binary search,
- * so your string HAD BETTER BE ORDERED!
- *
- * @param aChar is the unicode char to be found
- * @return offset in string, or -1 (kNotFound)
- */
-PRInt32 nsString::BinarySearch(PRUnichar aChar) const{
- PRInt32 low=0;
- PRInt32 high=mLength-1;
-
- while (low <= high) {
- int middle = (low + high) >> 1;
- PRUnichar theChar=GetCharAt(*this,middle);
- if (theChar==aChar)
- return middle;
- if (theChar>aChar)
- high = middle - 1;
- else
- low = middle + 1;
- }
- return kNotFound;
-}
-
/**
* search for given string within this string
*
diff --git a/mozilla/string/obsolete/nsString2.h b/mozilla/string/obsolete/nsString2.h
index 1b8221849c8..f09066e1c9b 100644
--- a/mozilla/string/obsolete/nsString2.h
+++ b/mozilla/string/obsolete/nsString2.h
@@ -144,14 +144,6 @@ public:
void Truncate(PRUint32 anIndex=0);
- /**
- * Determine whether or not the characters in this
- * string are in sorted order.
- *
- * @return TRUE if ordered.
- */
- PRBool IsOrdered(void) const;
-
/**
* Determine whether or not the characters in this
* string are in store as 1 or 2 byte (unicode) strings.
@@ -566,16 +558,6 @@ public:
Searching methods...
*********************************************************************/
- /**
- * Search for given character within this string.
- * This method does so by using a binary search,
- * so your string HAD BETTER BE ORDERED!
- *
- * @param aChar is the unicode char to be found
- * @return offset in string, or -1 (kNotFound)
- */
- PRInt32 BinarySearch(PRUnichar aChar) const;
-
/**
* Search for given substring within this string
*
diff --git a/mozilla/xpcom/ds/nsHashtable.cpp b/mozilla/xpcom/ds/nsHashtable.cpp
index e635c6a1fd0..1a07b1e0a2e 100644
--- a/mozilla/xpcom/ds/nsHashtable.cpp
+++ b/mozilla/xpcom/ds/nsHashtable.cpp
@@ -258,8 +258,11 @@ nsStringKey::nsStringKey(const PRUnichar* str)
mStr.Assign(str);
}
-nsStringKey::nsStringKey(const nsStr& str)
-{
+nsStringKey::nsStringKey(const nsString& str) {
+ mStr.Assign(str);
+}
+
+nsStringKey::nsStringKey(const nsCString& str) {
mStr.Assign(str);
}
diff --git a/mozilla/xpcom/ds/nsHashtable.h b/mozilla/xpcom/ds/nsHashtable.h
index 37cce188ece..c2947f27b4e 100644
--- a/mozilla/xpcom/ds/nsHashtable.h
+++ b/mozilla/xpcom/ds/nsHashtable.h
@@ -203,7 +203,8 @@ protected:
public:
nsStringKey(const char* str);
nsStringKey(const PRUnichar* str);
- nsStringKey(const nsStr& str);
+ nsStringKey(const nsString& str);
+ nsStringKey(const nsCString& str);
~nsStringKey(void);
diff --git a/mozilla/xpcom/ds/nsString.cpp b/mozilla/xpcom/ds/nsString.cpp
index 58f9d66b8a7..342077ce712 100644
--- a/mozilla/xpcom/ds/nsString.cpp
+++ b/mozilla/xpcom/ds/nsString.cpp
@@ -143,27 +143,6 @@ void nsCString::Truncate(PRUint32 anIndex) {
nsStr::Truncate(*this,anIndex);
}
-/**
- * Determine whether or not the characters in this
- * string are in sorted order.
- *
- * @update gess 8/25/98
- * @return TRUE if ordered.
- */
-PRBool nsCString::IsOrdered(void) const {
- PRBool result=PR_TRUE;
- if(mLength>1) {
- PRUint32 theIndex;
- for(theIndex=1;theIndexmStr[theIndex]) {
- result=PR_FALSE;
- break;
- }
- }
- }
- return result;
-}
-
/**
* Call this method if you want to force the string to a certain capacity
@@ -1205,30 +1184,6 @@ nsCString& nsCString::Cut(PRUint32 anOffset, PRInt32 aCount) {
Searching methods...
*********************************************************************/
-/**
- * Search for given character within this string.
- * This method does so by using a binary search,
- * so your string HAD BETTER BE ORDERED!
- *
- * @param aChar is the unicode char to be found
- * @return offset in string, or -1 (kNotFound)
- */
-PRInt32 nsCString::BinarySearch(PRUnichar aChar) const{
- PRInt32 low=0;
- PRInt32 high=mLength-1;
-
- while (low <= high) {
- int middle = (low + high) >> 1;
- PRUnichar theChar=GetCharAt(*this,middle);
- if (theChar==aChar)
- return middle;
- if (theChar>aChar)
- high = middle - 1;
- else
- low = middle + 1;
- }
- return kNotFound;
-}
/**
* Search for given cstr within this string
diff --git a/mozilla/xpcom/ds/nsString.h b/mozilla/xpcom/ds/nsString.h
index 78c405a2be0..c22566b1269 100644
--- a/mozilla/xpcom/ds/nsString.h
+++ b/mozilla/xpcom/ds/nsString.h
@@ -130,16 +130,6 @@ public:
*/
void Truncate(PRUint32 anIndex=0);
-
- /**
- * Determine whether or not the characters in this
- * string are in sorted order.
- *
- * @return TRUE if ordered.
- */
- PRBool IsOrdered(void) const;
-
-
/**
* Determine whether or not this string has a length of 0
*
@@ -516,15 +506,6 @@ public:
Searching methods...
*********************************************************************/
- /**
- * Search for given character within this string.
- * This method does so by using a binary search,
- * so your string HAD BETTER BE ORDERED!
- *
- * @param aChar is the unicode char to be found
- * @return offset in string, or -1 (kNotFound)
- */
- PRInt32 BinarySearch(PRUnichar aChar) const;
/**
* Search for given substring within this string
diff --git a/mozilla/xpcom/ds/nsString2.cpp b/mozilla/xpcom/ds/nsString2.cpp
index cd49a01279d..e8a09208970 100644
--- a/mozilla/xpcom/ds/nsString2.cpp
+++ b/mozilla/xpcom/ds/nsString2.cpp
@@ -153,31 +153,6 @@ void nsString::Truncate(PRUint32 anIndex) {
nsStr::Truncate(*this,anIndex);
}
-/**
- * Determine whether or not the characters in this
- * string are in sorted order.
- *
- * @update gess 8/25/98
- * @return TRUE if ordered.
- */
-PRBool nsString::IsOrdered(void) const {
- PRBool result=PR_TRUE;
- if(mLength>1) {
- PRUint32 theIndex;
- PRUnichar c1=0;
- PRUnichar c2=GetCharAt(*this,0);
- for(theIndex=1;theIndexc2) {
- result=PR_FALSE;
- break;
- }
- }
- }
- return result;
-}
-
/**
* Call this method if you want to force the string to a certain capacity
@@ -1411,31 +1386,6 @@ nsString& nsString::Cut(PRUint32 anOffset, PRInt32 aCount) {
Searching methods...
*********************************************************************/
-/**
- * Search for given character within this string.
- * This method does so by using a binary search,
- * so your string HAD BETTER BE ORDERED!
- *
- * @param aChar is the unicode char to be found
- * @return offset in string, or -1 (kNotFound)
- */
-PRInt32 nsString::BinarySearch(PRUnichar aChar) const{
- PRInt32 low=0;
- PRInt32 high=mLength-1;
-
- while (low <= high) {
- int middle = (low + high) >> 1;
- PRUnichar theChar=GetCharAt(*this,middle);
- if (theChar==aChar)
- return middle;
- if (theChar>aChar)
- high = middle - 1;
- else
- low = middle + 1;
- }
- return kNotFound;
-}
-
/**
* search for given string within this string
*
diff --git a/mozilla/xpcom/ds/nsString2.h b/mozilla/xpcom/ds/nsString2.h
index 1b8221849c8..f09066e1c9b 100644
--- a/mozilla/xpcom/ds/nsString2.h
+++ b/mozilla/xpcom/ds/nsString2.h
@@ -144,14 +144,6 @@ public:
void Truncate(PRUint32 anIndex=0);
- /**
- * Determine whether or not the characters in this
- * string are in sorted order.
- *
- * @return TRUE if ordered.
- */
- PRBool IsOrdered(void) const;
-
/**
* Determine whether or not the characters in this
* string are in store as 1 or 2 byte (unicode) strings.
@@ -566,16 +558,6 @@ public:
Searching methods...
*********************************************************************/
- /**
- * Search for given character within this string.
- * This method does so by using a binary search,
- * so your string HAD BETTER BE ORDERED!
- *
- * @param aChar is the unicode char to be found
- * @return offset in string, or -1 (kNotFound)
- */
- PRInt32 BinarySearch(PRUnichar aChar) const;
-
/**
* Search for given substring within this string
*
diff --git a/mozilla/xpcom/string/obsolete/nsString.cpp b/mozilla/xpcom/string/obsolete/nsString.cpp
index 58f9d66b8a7..342077ce712 100644
--- a/mozilla/xpcom/string/obsolete/nsString.cpp
+++ b/mozilla/xpcom/string/obsolete/nsString.cpp
@@ -143,27 +143,6 @@ void nsCString::Truncate(PRUint32 anIndex) {
nsStr::Truncate(*this,anIndex);
}
-/**
- * Determine whether or not the characters in this
- * string are in sorted order.
- *
- * @update gess 8/25/98
- * @return TRUE if ordered.
- */
-PRBool nsCString::IsOrdered(void) const {
- PRBool result=PR_TRUE;
- if(mLength>1) {
- PRUint32 theIndex;
- for(theIndex=1;theIndexmStr[theIndex]) {
- result=PR_FALSE;
- break;
- }
- }
- }
- return result;
-}
-
/**
* Call this method if you want to force the string to a certain capacity
@@ -1205,30 +1184,6 @@ nsCString& nsCString::Cut(PRUint32 anOffset, PRInt32 aCount) {
Searching methods...
*********************************************************************/
-/**
- * Search for given character within this string.
- * This method does so by using a binary search,
- * so your string HAD BETTER BE ORDERED!
- *
- * @param aChar is the unicode char to be found
- * @return offset in string, or -1 (kNotFound)
- */
-PRInt32 nsCString::BinarySearch(PRUnichar aChar) const{
- PRInt32 low=0;
- PRInt32 high=mLength-1;
-
- while (low <= high) {
- int middle = (low + high) >> 1;
- PRUnichar theChar=GetCharAt(*this,middle);
- if (theChar==aChar)
- return middle;
- if (theChar>aChar)
- high = middle - 1;
- else
- low = middle + 1;
- }
- return kNotFound;
-}
/**
* Search for given cstr within this string
diff --git a/mozilla/xpcom/string/obsolete/nsString.h b/mozilla/xpcom/string/obsolete/nsString.h
index 78c405a2be0..c22566b1269 100644
--- a/mozilla/xpcom/string/obsolete/nsString.h
+++ b/mozilla/xpcom/string/obsolete/nsString.h
@@ -130,16 +130,6 @@ public:
*/
void Truncate(PRUint32 anIndex=0);
-
- /**
- * Determine whether or not the characters in this
- * string are in sorted order.
- *
- * @return TRUE if ordered.
- */
- PRBool IsOrdered(void) const;
-
-
/**
* Determine whether or not this string has a length of 0
*
@@ -516,15 +506,6 @@ public:
Searching methods...
*********************************************************************/
- /**
- * Search for given character within this string.
- * This method does so by using a binary search,
- * so your string HAD BETTER BE ORDERED!
- *
- * @param aChar is the unicode char to be found
- * @return offset in string, or -1 (kNotFound)
- */
- PRInt32 BinarySearch(PRUnichar aChar) const;
/**
* Search for given substring within this string
diff --git a/mozilla/xpcom/string/obsolete/nsString2.cpp b/mozilla/xpcom/string/obsolete/nsString2.cpp
index cd49a01279d..e8a09208970 100644
--- a/mozilla/xpcom/string/obsolete/nsString2.cpp
+++ b/mozilla/xpcom/string/obsolete/nsString2.cpp
@@ -153,31 +153,6 @@ void nsString::Truncate(PRUint32 anIndex) {
nsStr::Truncate(*this,anIndex);
}
-/**
- * Determine whether or not the characters in this
- * string are in sorted order.
- *
- * @update gess 8/25/98
- * @return TRUE if ordered.
- */
-PRBool nsString::IsOrdered(void) const {
- PRBool result=PR_TRUE;
- if(mLength>1) {
- PRUint32 theIndex;
- PRUnichar c1=0;
- PRUnichar c2=GetCharAt(*this,0);
- for(theIndex=1;theIndexc2) {
- result=PR_FALSE;
- break;
- }
- }
- }
- return result;
-}
-
/**
* Call this method if you want to force the string to a certain capacity
@@ -1411,31 +1386,6 @@ nsString& nsString::Cut(PRUint32 anOffset, PRInt32 aCount) {
Searching methods...
*********************************************************************/
-/**
- * Search for given character within this string.
- * This method does so by using a binary search,
- * so your string HAD BETTER BE ORDERED!
- *
- * @param aChar is the unicode char to be found
- * @return offset in string, or -1 (kNotFound)
- */
-PRInt32 nsString::BinarySearch(PRUnichar aChar) const{
- PRInt32 low=0;
- PRInt32 high=mLength-1;
-
- while (low <= high) {
- int middle = (low + high) >> 1;
- PRUnichar theChar=GetCharAt(*this,middle);
- if (theChar==aChar)
- return middle;
- if (theChar>aChar)
- high = middle - 1;
- else
- low = middle + 1;
- }
- return kNotFound;
-}
-
/**
* search for given string within this string
*
diff --git a/mozilla/xpcom/string/obsolete/nsString2.h b/mozilla/xpcom/string/obsolete/nsString2.h
index 1b8221849c8..f09066e1c9b 100644
--- a/mozilla/xpcom/string/obsolete/nsString2.h
+++ b/mozilla/xpcom/string/obsolete/nsString2.h
@@ -144,14 +144,6 @@ public:
void Truncate(PRUint32 anIndex=0);
- /**
- * Determine whether or not the characters in this
- * string are in sorted order.
- *
- * @return TRUE if ordered.
- */
- PRBool IsOrdered(void) const;
-
/**
* Determine whether or not the characters in this
* string are in store as 1 or 2 byte (unicode) strings.
@@ -566,16 +558,6 @@ public:
Searching methods...
*********************************************************************/
- /**
- * Search for given character within this string.
- * This method does so by using a binary search,
- * so your string HAD BETTER BE ORDERED!
- *
- * @param aChar is the unicode char to be found
- * @return offset in string, or -1 (kNotFound)
- */
- PRInt32 BinarySearch(PRUnichar aChar) const;
-
/**
* Search for given substring within this string
*