зеркало из https://github.com/mozilla/pjs.git
prep work to land nsString2
This commit is contained in:
Родитель
929c4e7c17
Коммит
ede624cbbf
|
@ -419,6 +419,16 @@ PRUnichar& nsString::Last() const{
|
|||
else return gBadChar;
|
||||
}
|
||||
|
||||
PRBool nsString::SetCharAt(PRUnichar aChar,PRInt32 anIndex){
|
||||
PRBool result=PR_FALSE;
|
||||
if(anIndex<mLength){
|
||||
PRUnichar* theStr=(PRUnichar*)mStr;
|
||||
theStr[anIndex]=aChar;
|
||||
result=PR_TRUE;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new string by appending given string to this
|
||||
* @update gess 7/27/98
|
||||
|
|
|
@ -171,6 +171,9 @@ PRUnichar& First() const;
|
|||
*/
|
||||
PRUnichar& Last() const;
|
||||
|
||||
PRBool SetCharAt(PRUnichar aChar,PRInt32 anIndex);
|
||||
|
||||
|
||||
/**********************************************************************
|
||||
String creation methods...
|
||||
*********************************************************************/
|
||||
|
|
|
@ -983,12 +983,12 @@ rdf_EscapeAngleBrackets(nsString& s)
|
|||
{
|
||||
PRInt32 index;
|
||||
while ((index = s.Find('<')) != -1) {
|
||||
s[index] = '&';
|
||||
s.SetCharAt('&',index);
|
||||
s.Insert(nsAutoString("lt;"), index + 1);
|
||||
}
|
||||
|
||||
while ((index = s.Find('>')) != -1) {
|
||||
s[index] = '&';
|
||||
s.SetCharAt('&',index);
|
||||
s.Insert(nsAutoString("gt;"), index + 1);
|
||||
}
|
||||
}
|
||||
|
@ -998,7 +998,7 @@ rdf_EscapeAmpersands(nsString& s)
|
|||
{
|
||||
PRInt32 index = 0;
|
||||
while ((index = s.Find('&', index)) != -1) {
|
||||
s[index] = '&';
|
||||
s.SetCharAt('&',index);
|
||||
s.Insert(nsAutoString("amp;"), index + 1);
|
||||
index += 4;
|
||||
}
|
||||
|
|
|
@ -277,7 +277,7 @@ BookmarkParser::ParseBookmark(const nsString& aLine, nsIRDFResource* aContainer)
|
|||
static const char kEscape22[] = "%22";
|
||||
PRInt32 offset;
|
||||
while ((offset = url.Find(kEscape22)) >= 0) {
|
||||
url[offset] = PRUnichar(' ');
|
||||
url.SetCharAt(' ',offset);
|
||||
url.Cut(offset + 1, sizeof(kEscape22) - 2);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -419,6 +419,16 @@ PRUnichar& nsString::Last() const{
|
|||
else return gBadChar;
|
||||
}
|
||||
|
||||
PRBool nsString::SetCharAt(PRUnichar aChar,PRInt32 anIndex){
|
||||
PRBool result=PR_FALSE;
|
||||
if(anIndex<mLength){
|
||||
PRUnichar* theStr=(PRUnichar*)mStr;
|
||||
theStr[anIndex]=aChar;
|
||||
result=PR_TRUE;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new string by appending given string to this
|
||||
* @update gess 7/27/98
|
||||
|
|
|
@ -171,6 +171,9 @@ PRUnichar& First() const;
|
|||
*/
|
||||
PRUnichar& Last() const;
|
||||
|
||||
PRBool SetCharAt(PRUnichar aChar,PRInt32 anIndex);
|
||||
|
||||
|
||||
/**********************************************************************
|
||||
String creation methods...
|
||||
*********************************************************************/
|
||||
|
|
|
@ -419,6 +419,16 @@ PRUnichar& nsString::Last() const{
|
|||
else return gBadChar;
|
||||
}
|
||||
|
||||
PRBool nsString::SetCharAt(PRUnichar aChar,PRInt32 anIndex){
|
||||
PRBool result=PR_FALSE;
|
||||
if(anIndex<mLength){
|
||||
PRUnichar* theStr=(PRUnichar*)mStr;
|
||||
theStr[anIndex]=aChar;
|
||||
result=PR_TRUE;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new string by appending given string to this
|
||||
* @update gess 7/27/98
|
||||
|
|
|
@ -171,6 +171,9 @@ PRUnichar& First() const;
|
|||
*/
|
||||
PRUnichar& Last() const;
|
||||
|
||||
PRBool SetCharAt(PRUnichar aChar,PRInt32 anIndex);
|
||||
|
||||
|
||||
/**********************************************************************
|
||||
String creation methods...
|
||||
*********************************************************************/
|
||||
|
|
|
@ -419,6 +419,16 @@ PRUnichar& nsString::Last() const{
|
|||
else return gBadChar;
|
||||
}
|
||||
|
||||
PRBool nsString::SetCharAt(PRUnichar aChar,PRInt32 anIndex){
|
||||
PRBool result=PR_FALSE;
|
||||
if(anIndex<mLength){
|
||||
PRUnichar* theStr=(PRUnichar*)mStr;
|
||||
theStr[anIndex]=aChar;
|
||||
result=PR_TRUE;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new string by appending given string to this
|
||||
* @update gess 7/27/98
|
||||
|
|
|
@ -171,6 +171,9 @@ PRUnichar& First() const;
|
|||
*/
|
||||
PRUnichar& Last() const;
|
||||
|
||||
PRBool SetCharAt(PRUnichar aChar,PRInt32 anIndex);
|
||||
|
||||
|
||||
/**********************************************************************
|
||||
String creation methods...
|
||||
*********************************************************************/
|
||||
|
|
Загрузка…
Ссылка в новой задаче