Bug 98153: Remove SubsumeStr. r=dbaron, sr=scc
git-svn-id: svn://10.0.0.236/trunk@102292 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -45,28 +45,6 @@ nsString::GetFlatBufferHandle() const
|
||||
return NS_REINTERPRET_CAST(const nsBufferHandle<PRUnichar>*, 1);
|
||||
}
|
||||
|
||||
|
||||
|
||||
static void Subsume(nsStr& aDest,nsStr& aSource){
|
||||
if(aSource.mStr && aSource.mLength) {
|
||||
if(aSource.mOwnsBuffer){
|
||||
nsStr::Destroy(aDest);
|
||||
aDest.mStr=aSource.mStr;
|
||||
aDest.mLength=aSource.mLength;
|
||||
aDest.mCharSize=aSource.mCharSize;
|
||||
aDest.mCapacity=aSource.mCapacity;
|
||||
aDest.mOwnsBuffer=aSource.mOwnsBuffer;
|
||||
aSource.mOwnsBuffer=PR_FALSE;
|
||||
aSource.mStr=0;
|
||||
}
|
||||
else{
|
||||
nsStr::StrAssign(aDest,aSource,0,aSource.mLength);
|
||||
}
|
||||
}
|
||||
else nsStr::StrTruncate(aDest,0);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Default constructor.
|
||||
*/
|
||||
@@ -100,25 +78,6 @@ nsString::nsString(const nsString& aString) {
|
||||
StrAssign(*this,aString,0,aString.mLength);
|
||||
}
|
||||
|
||||
/**
|
||||
* construct from subsumeable string
|
||||
* @update gess 1/4/99
|
||||
* @param reference to a subsumeString
|
||||
*/
|
||||
#if defined(AIX) || defined(XP_OS2_VACPP)
|
||||
nsString::nsString(const nsSubsumeStr& aSubsumeStr) {
|
||||
Initialize(*this,eTwoByte);
|
||||
|
||||
nsSubsumeStr temp(aSubsumeStr); // a temp is needed for the AIX and VAC++ compilers
|
||||
Subsume(*this,temp);
|
||||
#else
|
||||
nsString::nsString(nsSubsumeStr& aSubsumeStr) {
|
||||
Initialize(*this,eTwoByte);
|
||||
|
||||
Subsume(*this,aSubsumeStr);
|
||||
#endif /* AIX || XP_OS2_VACPP */
|
||||
}
|
||||
|
||||
/**
|
||||
* Destructor
|
||||
* Make sure we call nsStr::Destroy.
|
||||
@@ -1870,21 +1829,6 @@ nsAutoString::nsAutoString(PRUnichar aChar) : nsString(){
|
||||
Append(aChar);
|
||||
}
|
||||
|
||||
/**
|
||||
* construct from a subsumeable string
|
||||
* @update gess 1/4/99
|
||||
* @param reference to a subsumeString
|
||||
*/
|
||||
#if defined(AIX) || defined(XP_OS2_VACPP)
|
||||
nsAutoString::nsAutoString(const nsSubsumeStr& aSubsumeStr) :nsString() {
|
||||
nsSubsumeStr temp(aSubsumeStr); // a temp is needed for the AIX and VAC++ compilers
|
||||
Subsume(*this,temp);
|
||||
#else
|
||||
nsAutoString::nsAutoString( nsSubsumeStr& aSubsumeStr) :nsString() {
|
||||
Subsume(*this,aSubsumeStr);
|
||||
#endif // AIX || XP_OS2_VACPP
|
||||
}
|
||||
|
||||
/**
|
||||
* deconstruct the autstring
|
||||
* @param
|
||||
@@ -1898,32 +1842,3 @@ void nsAutoString::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const {
|
||||
}
|
||||
}
|
||||
|
||||
nsSubsumeStr::nsSubsumeStr() : nsString() {
|
||||
}
|
||||
|
||||
nsSubsumeStr::nsSubsumeStr(nsStr& aString) : nsString() {
|
||||
::Subsume(*this,aString);
|
||||
}
|
||||
|
||||
nsSubsumeStr::nsSubsumeStr(PRUnichar* aString,PRBool assumeOwnership,PRInt32 aLength) : nsString() {
|
||||
mUStr=aString;
|
||||
mCharSize=eTwoByte;
|
||||
mCapacity=mLength=(-1==aLength) ? nsCRT::strlen(aString) : aLength;
|
||||
mOwnsBuffer=assumeOwnership;
|
||||
}
|
||||
|
||||
nsSubsumeStr::nsSubsumeStr(char* aString,PRBool assumeOwnership,PRInt32 aLength) : nsString() {
|
||||
mStr=aString;
|
||||
mCharSize=eOneByte;
|
||||
mCapacity=mLength=(-1==aLength) ? strlen(aString) : aLength;
|
||||
mOwnsBuffer=assumeOwnership;
|
||||
}
|
||||
|
||||
int nsSubsumeStr::Subsume(PRUnichar* aString,PRBool assumeOwnership,PRInt32 aLength) {
|
||||
mUStr=aString;
|
||||
mCharSize=eTwoByte;
|
||||
mCapacity=mLength=(-1==aLength) ? nsCRT::strlen(aString) : aLength;
|
||||
mOwnsBuffer=assumeOwnership;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user