replaced call to deprecated nsString API

This commit is contained in:
rickg%netscape.com 1999-07-26 00:47:36 +00:00
parent 89911e8db8
commit 65fcb776bb
9 changed files with 27 additions and 27 deletions

View File

@ -293,7 +293,7 @@ nsChromeRegistry::ConvertChromeURL(nsIURI* aChromeURL)
{
// There is something to the right of that slash. A provider type must have
// been specified.
slashIndex = restOfURL.Find('/', 1);
slashIndex = restOfURL.FindChar('/', PR_FALSE,1);
if (slashIndex == -1)
slashIndex = restOfURL.Length();

View File

@ -860,7 +860,7 @@ nsNetlibService::SetProxyHTTP(nsString& aProxyHTTP) {
return NS_OK;
}
if ( (colonIdx = aProxyHTTP.Find(colon)) < 0 )
if ( (colonIdx = aProxyHTTP.FindChar(colon)) < 0 )
return NS_FALSE;
aProxyHTTP.Left(nsSProxy, colonIdx);
@ -964,7 +964,7 @@ nsNetlibService::SetCustomUserAgent(nsString aCustom)
nsString newAppVersion = XP_AppVersion;
inIdx = newAppVersion.Find(inChar);
inIdx = newAppVersion.FindChar(inChar);
if (0 > inIdx) {
newAppVersion.Insert(aCustom, inIdx + 1);
}
@ -1074,7 +1074,7 @@ nsNetlibService::CreateURL(nsIURI* *aURL,
nsILoadGroup* aGroup)
{
nsAutoString protoName;
PRInt32 pos = aSpec.Find(':');
PRInt32 pos = aSpec.FindChar(':');
if (pos >= 0) {
aSpec.Left(protoName, pos);
}

View File

@ -1899,7 +1899,7 @@ net_ReadCookiePermissions()
int hostIndex, permissionIndex;
hostIndex = 0;
if ((permissionIndex=buffer->Find('\t', hostIndex)+1) == 0) {
if ((permissionIndex=buffer->FindChar('\t',PR_FALSE, hostIndex)+1) == 0) {
PR_Free(buffer);
continue;
}
@ -2080,12 +2080,12 @@ net_ReadCookies()
int hostIndex, isDomainIndex, pathIndex, xxxIndex, expiresIndex, nameIndex, cookieIndex;
hostIndex = 0;
if ((isDomainIndex=buffer->Find('\t', hostIndex)+1) == 0 ||
(pathIndex=buffer->Find('\t', isDomainIndex)+1) == 0 ||
(xxxIndex=buffer->Find('\t', pathIndex)+1) == 0 ||
(expiresIndex=buffer->Find('\t', xxxIndex)+1) == 0 ||
(nameIndex=buffer->Find('\t', expiresIndex)+1) == 0 ||
(cookieIndex=buffer->Find('\t', nameIndex)+1) == 0 ) {
if ((isDomainIndex=buffer->FindChar('\t', PR_FALSE,hostIndex)+1) == 0 ||
(pathIndex=buffer->FindChar('\t', PR_FALSE,isDomainIndex)+1) == 0 ||
(xxxIndex=buffer->FindChar('\t', PR_FALSE,pathIndex)+1) == 0 ||
(expiresIndex=buffer->FindChar('\t', PR_FALSE,xxxIndex)+1) == 0 ||
(nameIndex=buffer->FindChar('\t', PR_FALSE,expiresIndex)+1) == 0 ||
(cookieIndex=buffer->FindChar('\t', PR_FALSE,nameIndex)+1) == 0 ) {
PR_Free(buffer);
continue;
}
@ -2802,7 +2802,7 @@ cookie_FindValueInArgs(nsAutoString results, char* name) {
return nsAutoString("").ToNewCString();
}
start += PL_strlen(name); /* get passed the |name| part */
length = results.Find('|', start) - start;
length = results.FindChar('|', PR_FALSE,start) - start;
results.Mid(value, start, length);
return value.ToNewCString();
}

View File

@ -210,14 +210,14 @@ static const char kApostrophe = '\'';
offset = aSource.Find(aAttribute);
if (-1 != offset) {
offset = aSource.Find('=', offset);
offset = aSource.FindChar('=', PR_FALSE,offset);
PRUnichar next = aSource.CharAt(++offset);
if (kQuote == next) {
endOffset = aSource.Find(kQuote, ++offset);
endOffset = aSource.FindChar(kQuote, PR_FALSE,++offset);
}
else if (kApostrophe == next) {
endOffset = aSource.Find(kApostrophe, ++offset);
endOffset = aSource.FindChar(kApostrophe, PR_FALSE,++offset);
}
if (-1 != endOffset) {

View File

@ -1137,12 +1137,12 @@ static void
rdf_EscapeAngleBrackets(nsString& s)
{
PRInt32 i;
while ((i = s.Find('<')) != -1) {
while ((i = s.FindChar('<')) != -1) {
s.SetCharAt('&', i);
s.Insert(nsAutoString("lt;"), i + 1);
}
while ((i = s.Find('>')) != -1) {
while ((i = s.FindChar('>')) != -1) {
s.SetCharAt('&', i);
s.Insert(nsAutoString("gt;"), i + 1);
}
@ -1152,7 +1152,7 @@ static void
rdf_EscapeAmpersands(nsString& s)
{
PRInt32 i = 0;
while ((i = s.Find('&', i)) != -1) {
while ((i = s.FindChar('&', PR_FALSE,i)) != -1) {
s.SetCharAt('&', i);
s.Insert(nsAutoString("amp;"), i + 1);
i += 4;

View File

@ -293,7 +293,7 @@ nsChromeRegistry::ConvertChromeURL(nsIURI* aChromeURL)
{
// There is something to the right of that slash. A provider type must have
// been specified.
slashIndex = restOfURL.Find('/', 1);
slashIndex = restOfURL.FindChar('/', PR_FALSE,1);
if (slashIndex == -1)
slashIndex = restOfURL.Length();

View File

@ -482,7 +482,7 @@ nsRDFContentUtils::MakeElementURI(nsIDocument* aDocument, const nsString& aEleme
// Convert an element's ID to a URI that can be used to refer to
// the element in the XUL graph.
if (aElementID.Find(':') > 0) {
if (aElementID.FindChar(':') > 0) {
// Assume it's absolute already. Use as is.
aURI = aElementID;
}

View File

@ -1404,13 +1404,13 @@ SearchDataSource::GetInputs(nsString data, nsString text, nsString &input)
PRInt32 nameOffset = line.Find("name", PR_TRUE);
if (nameOffset >= 0)
{
PRInt32 equal = line.Find(PRUnichar('='), nameOffset);
PRInt32 equal = line.FindChar(PRUnichar('='), nameOffset);
if (equal >= 0)
{
PRInt32 startQuote = line.Find(PRUnichar('\"'), equal + 1);
PRInt32 startQuote = line.FindChar(PRUnichar('\"'), equal + 1);
if (startQuote >= 0)
{
PRInt32 endQuote = line.Find(PRUnichar('\"'), startQuote + 1);
PRInt32 endQuote = line.FindChar(PRUnichar('\"'), startQuote + 1);
if (endQuote >= 0)
{
line.Mid(nameAttrib, startQuote+1, endQuote-startQuote-1);
@ -1437,13 +1437,13 @@ SearchDataSource::GetInputs(nsString data, nsString text, nsString &input)
PRInt32 valueOffset = line.Find("value", PR_TRUE);
if (valueOffset >= 0)
{
PRInt32 equal = line.Find(PRUnichar('='), valueOffset);
PRInt32 equal = line.FindChar(PRUnichar('='), valueOffset);
if (equal >= 0)
{
PRInt32 startQuote = line.Find(PRUnichar('\"'), equal + 1);
PRInt32 startQuote = line.FindChar(PRUnichar('\"'), equal + 1);
if (startQuote >= 0)
{
PRInt32 endQuote = line.Find(PRUnichar('\"'), startQuote + 1);
PRInt32 endQuote = line.FindChar(PRUnichar('\"'), startQuote + 1);
if (endQuote >= 0)
{
line.Mid(valueAttrib, startQuote+1, endQuote-startQuote-1);

View File

@ -753,7 +753,7 @@ static void SplitMimeType(const nsString& aValue, nsString& aType, nsString& aPa
{
aType.Truncate();
aParams.Truncate();
PRInt32 semiIndex = aValue.Find(PRUnichar(';'));
PRInt32 semiIndex = aValue.FindChar(PRUnichar(';'));
if (-1 != semiIndex) {
aValue.Left(aType, semiIndex);
aValue.Right(aParams, (aValue.Length() - semiIndex) - 1);