adding |AppendWithConverison(const PRUnichar*, PRInt32)|, the need for which was brought out by making constructors |explicit|

git-svn-id: svn://10.0.0.236/trunk@76711 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
scc%mozilla.org
2000-08-19 19:34:00 +00:00
parent ff106ebc52
commit b286b36f72
6 changed files with 45 additions and 3 deletions

View File

@@ -1072,6 +1072,19 @@ void nsCString::AppendWithConversion(PRUnichar aChar) {
StrAppend(*this,temp,0,1);
}
void nsCString::AppendWithConversion( const PRUnichar* aBuffer, PRInt32 aLength )
{
nsStr temp;
nsStr::Initialize(temp, eTwoByte);
temp.mUStr = NS_CONST_CAST(PRUnichar*, aBuffer);
if ( aLength < 0 )
aLength = nsCharTraits<PRUnichar>::length(aBuffer);
if ( aLength > 0 )
StrAppend(*this, temp, 0, aLength);
}
/**
* Append the given integer to this string
* @update gess 01/04/99

View File

@@ -472,7 +472,8 @@ public:
void AppendWithConversion(const nsString&, PRInt32=-1);
void AppendWithConversion(PRUnichar aChar);
// Why no |AppendWithConversion(const PRUnichar*)|?
void AppendWithConversion(const PRUnichar*, PRInt32=-1);
// Why no |AppendWithConversion(const PRUnichar*, PRInt32)|? --- now I know, because implicit construction hid the need for this routine
void AppendInt(PRInt32 aInteger,PRInt32 aRadix=10); //radix=8,10 or 16
void AppendFloat( double aFloat );