diff --git a/string/obsolete/nsString2.cpp b/string/obsolete/nsString2.cpp index 1565df86da4..a310463c2a7 100644 --- a/string/obsolete/nsString2.cpp +++ b/string/obsolete/nsString2.cpp @@ -958,6 +958,7 @@ PRInt32 nsString::ToInteger(PRInt32* anErrorCode,PRUint32 aRadix) const { * @param aString: nsStr to be appended * @return this */ +#ifndef NEW_STRING_APIS nsString& nsString::Assign(const nsStr& aString,PRInt32 aCount) { if(this!=&aString){ nsStr::Truncate(*this,0); @@ -970,7 +971,7 @@ nsString& nsString::Assign(const nsStr& aString,PRInt32 aCount) { } return *this; } - +#endif /** * assign given char* to this string diff --git a/string/obsolete/nsString2.h b/string/obsolete/nsString2.h index bd10e3c631f..be2d6c2e4f8 100644 --- a/string/obsolete/nsString2.h +++ b/string/obsolete/nsString2.h @@ -443,9 +443,15 @@ public: * Functionally equivalent to assign or operator= * */ - nsString& SetString(const char* aString,PRInt32 aLength=-1) {return Assign(aString,aLength);} - nsString& SetString(const PRUnichar* aString,PRInt32 aLength=-1) {return Assign(aString,aLength);} - nsString& SetString(const nsString& aString,PRInt32 aLength=-1) {return Assign(aString,aLength);} +#ifdef NEW_STRING_APIS + nsString& SetString(const char* aString,PRInt32 aLength=-1) {Assign(aString); return *this;} + nsString& SetString(const PRUnichar* aString,PRInt32 aLength=-1) {Assign(aString); return *this;} + nsString& SetString(const nsString& aString,PRInt32 aLength=-1) {Assign(aString); return *this;} +#else + nsString& SetString(const char* aString,PRInt32 aLength=-1) {return Assign(aString, aLength);} + nsString& SetString(const PRUnichar* aString,PRInt32 aLength=-1) {return Assign(aString, aLength);} + nsString& SetString(const nsString& aString,PRInt32 aLength=-1) {return Assign(aString, aLength);} +#endif /** * assign given string to this string @@ -455,7 +461,9 @@ public: * @return this */ +#ifndef NEW_STRING_APIS nsString& Assign(const nsStr& aString,PRInt32 aCount=-1); +#endif nsString& Assign(const char* aString,PRInt32 aCount=-1); nsString& Assign(const PRUnichar* aString,PRInt32 aCount=-1); nsString& Assign(char aChar); @@ -875,12 +883,14 @@ public: nsAutoString(PRUnichar aChar); virtual ~nsAutoString(); +#ifndef NEW_STRING_APIS nsAutoString& operator=(const nsStr& aString) {nsString::Assign(aString); return *this;} nsAutoString& operator=(const nsAutoString& aString) {nsString::Assign(aString); return *this;} nsAutoString& operator=(const char* aCString) {nsString::Assign(aCString); return *this;} nsAutoString& operator=(char aChar) {nsString::Assign(aChar); return *this;} nsAutoString& operator=(const PRUnichar* aBuffer) {nsString::Assign(aBuffer); return *this;} nsAutoString& operator=(PRUnichar aChar) {nsString::Assign(aChar); return *this;} +#endif /** * Retrieve the size of this string diff --git a/xpcom/ds/nsString2.cpp b/xpcom/ds/nsString2.cpp index 1565df86da4..a310463c2a7 100644 --- a/xpcom/ds/nsString2.cpp +++ b/xpcom/ds/nsString2.cpp @@ -958,6 +958,7 @@ PRInt32 nsString::ToInteger(PRInt32* anErrorCode,PRUint32 aRadix) const { * @param aString: nsStr to be appended * @return this */ +#ifndef NEW_STRING_APIS nsString& nsString::Assign(const nsStr& aString,PRInt32 aCount) { if(this!=&aString){ nsStr::Truncate(*this,0); @@ -970,7 +971,7 @@ nsString& nsString::Assign(const nsStr& aString,PRInt32 aCount) { } return *this; } - +#endif /** * assign given char* to this string diff --git a/xpcom/ds/nsString2.h b/xpcom/ds/nsString2.h index bd10e3c631f..be2d6c2e4f8 100644 --- a/xpcom/ds/nsString2.h +++ b/xpcom/ds/nsString2.h @@ -443,9 +443,15 @@ public: * Functionally equivalent to assign or operator= * */ - nsString& SetString(const char* aString,PRInt32 aLength=-1) {return Assign(aString,aLength);} - nsString& SetString(const PRUnichar* aString,PRInt32 aLength=-1) {return Assign(aString,aLength);} - nsString& SetString(const nsString& aString,PRInt32 aLength=-1) {return Assign(aString,aLength);} +#ifdef NEW_STRING_APIS + nsString& SetString(const char* aString,PRInt32 aLength=-1) {Assign(aString); return *this;} + nsString& SetString(const PRUnichar* aString,PRInt32 aLength=-1) {Assign(aString); return *this;} + nsString& SetString(const nsString& aString,PRInt32 aLength=-1) {Assign(aString); return *this;} +#else + nsString& SetString(const char* aString,PRInt32 aLength=-1) {return Assign(aString, aLength);} + nsString& SetString(const PRUnichar* aString,PRInt32 aLength=-1) {return Assign(aString, aLength);} + nsString& SetString(const nsString& aString,PRInt32 aLength=-1) {return Assign(aString, aLength);} +#endif /** * assign given string to this string @@ -455,7 +461,9 @@ public: * @return this */ +#ifndef NEW_STRING_APIS nsString& Assign(const nsStr& aString,PRInt32 aCount=-1); +#endif nsString& Assign(const char* aString,PRInt32 aCount=-1); nsString& Assign(const PRUnichar* aString,PRInt32 aCount=-1); nsString& Assign(char aChar); @@ -875,12 +883,14 @@ public: nsAutoString(PRUnichar aChar); virtual ~nsAutoString(); +#ifndef NEW_STRING_APIS nsAutoString& operator=(const nsStr& aString) {nsString::Assign(aString); return *this;} nsAutoString& operator=(const nsAutoString& aString) {nsString::Assign(aString); return *this;} nsAutoString& operator=(const char* aCString) {nsString::Assign(aCString); return *this;} nsAutoString& operator=(char aChar) {nsString::Assign(aChar); return *this;} nsAutoString& operator=(const PRUnichar* aBuffer) {nsString::Assign(aBuffer); return *this;} nsAutoString& operator=(PRUnichar aChar) {nsString::Assign(aChar); return *this;} +#endif /** * Retrieve the size of this string diff --git a/xpcom/string/obsolete/nsString2.cpp b/xpcom/string/obsolete/nsString2.cpp index 1565df86da4..a310463c2a7 100644 --- a/xpcom/string/obsolete/nsString2.cpp +++ b/xpcom/string/obsolete/nsString2.cpp @@ -958,6 +958,7 @@ PRInt32 nsString::ToInteger(PRInt32* anErrorCode,PRUint32 aRadix) const { * @param aString: nsStr to be appended * @return this */ +#ifndef NEW_STRING_APIS nsString& nsString::Assign(const nsStr& aString,PRInt32 aCount) { if(this!=&aString){ nsStr::Truncate(*this,0); @@ -970,7 +971,7 @@ nsString& nsString::Assign(const nsStr& aString,PRInt32 aCount) { } return *this; } - +#endif /** * assign given char* to this string diff --git a/xpcom/string/obsolete/nsString2.h b/xpcom/string/obsolete/nsString2.h index bd10e3c631f..be2d6c2e4f8 100644 --- a/xpcom/string/obsolete/nsString2.h +++ b/xpcom/string/obsolete/nsString2.h @@ -443,9 +443,15 @@ public: * Functionally equivalent to assign or operator= * */ - nsString& SetString(const char* aString,PRInt32 aLength=-1) {return Assign(aString,aLength);} - nsString& SetString(const PRUnichar* aString,PRInt32 aLength=-1) {return Assign(aString,aLength);} - nsString& SetString(const nsString& aString,PRInt32 aLength=-1) {return Assign(aString,aLength);} +#ifdef NEW_STRING_APIS + nsString& SetString(const char* aString,PRInt32 aLength=-1) {Assign(aString); return *this;} + nsString& SetString(const PRUnichar* aString,PRInt32 aLength=-1) {Assign(aString); return *this;} + nsString& SetString(const nsString& aString,PRInt32 aLength=-1) {Assign(aString); return *this;} +#else + nsString& SetString(const char* aString,PRInt32 aLength=-1) {return Assign(aString, aLength);} + nsString& SetString(const PRUnichar* aString,PRInt32 aLength=-1) {return Assign(aString, aLength);} + nsString& SetString(const nsString& aString,PRInt32 aLength=-1) {return Assign(aString, aLength);} +#endif /** * assign given string to this string @@ -455,7 +461,9 @@ public: * @return this */ +#ifndef NEW_STRING_APIS nsString& Assign(const nsStr& aString,PRInt32 aCount=-1); +#endif nsString& Assign(const char* aString,PRInt32 aCount=-1); nsString& Assign(const PRUnichar* aString,PRInt32 aCount=-1); nsString& Assign(char aChar); @@ -875,12 +883,14 @@ public: nsAutoString(PRUnichar aChar); virtual ~nsAutoString(); +#ifndef NEW_STRING_APIS nsAutoString& operator=(const nsStr& aString) {nsString::Assign(aString); return *this;} nsAutoString& operator=(const nsAutoString& aString) {nsString::Assign(aString); return *this;} nsAutoString& operator=(const char* aCString) {nsString::Assign(aCString); return *this;} nsAutoString& operator=(char aChar) {nsString::Assign(aChar); return *this;} nsAutoString& operator=(const PRUnichar* aBuffer) {nsString::Assign(aBuffer); return *this;} nsAutoString& operator=(PRUnichar aChar) {nsString::Assign(aChar); return *this;} +#endif /** * Retrieve the size of this string