Remove overloaded fputs functions, DebugDump, and (from nsCString only) ToCString). b=104763 r=jag rs=scc
git-svn-id: svn://10.0.0.236/trunk@105469 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -1435,84 +1435,6 @@ PRBool nsString::IsDigit(PRUnichar aChar) {
|
||||
return PRBool((aChar >= '0') && (aChar <= '9'));
|
||||
}
|
||||
|
||||
#if 0
|
||||
|
||||
/**
|
||||
*
|
||||
* @update gess8/8/98
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
ostream& operator<<(ostream& aStream,const nsString& aString){
|
||||
if(eOneByte==aString.mCharSize) {
|
||||
aStream<<aString.mStr;
|
||||
}
|
||||
else{
|
||||
PRUint32 theOffset=0;
|
||||
const PRUint32 theBufSize=300;
|
||||
char theBuf[theBufSize+1];
|
||||
PRUint32 theCount=0;
|
||||
PRUint32 theRemains=0;
|
||||
|
||||
while(theOffset<aString.mLength){
|
||||
theRemains=aString.mLength-theOffset;
|
||||
theCount=(theRemains<theBufSize) ? theRemains : theBufSize;
|
||||
aString.ToCString(theBuf,theCount+1,theOffset);
|
||||
theBuf[theCount]=0;
|
||||
aStream<<theBuf;
|
||||
theOffset+=theCount;
|
||||
}
|
||||
}
|
||||
return aStream;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @update gess 01/04/99
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
NS_COM int fputs(const nsString& aString, FILE* out)
|
||||
{
|
||||
char buf[100];
|
||||
char* cp = buf;
|
||||
PRInt32 len = aString.mLength;
|
||||
if (len >= PRInt32(sizeof(buf))) {
|
||||
cp = ToNewCString(aString);
|
||||
} else {
|
||||
aString.ToCString(cp, len + 1);
|
||||
}
|
||||
if(len>0)
|
||||
::fwrite(cp, 1, len, out);
|
||||
if (cp != buf) {
|
||||
Recycle(cp);
|
||||
}
|
||||
return (int) len;
|
||||
}
|
||||
|
||||
/**
|
||||
* Dumps the contents of the string to stdout
|
||||
* @update gess 11/15/99
|
||||
*/
|
||||
void nsString::DebugDump(void) const {
|
||||
#ifdef DEBUG
|
||||
const char* theBuffer=mStr;
|
||||
nsCAutoString temp;
|
||||
|
||||
if(eTwoByte==mCharSize) {
|
||||
nsStr::StrAssign(temp, *this, 0, mLength);
|
||||
theBuffer=temp.get();
|
||||
}
|
||||
|
||||
if(theBuffer) {
|
||||
printf("\n%s",theBuffer);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
IMPLEMENTATION NOTES: AUTOSTRING...
|
||||
|
||||
Reference in New Issue
Block a user