diff --git a/string/obsolete/nsString.h b/string/obsolete/nsString.h index 2361ed04f39..928c641edbe 100644 --- a/string/obsolete/nsString.h +++ b/string/obsolete/nsString.h @@ -320,6 +320,9 @@ nsCString& CompressWhitespace( PRBool aEliminateLeading=PR_TRUE,PRBool aEliminat string conversion methods... *********************************************************************/ + operator char*() {return mStr;} + operator const char*() const {return (const char*)mStr;} + /** * This method constructs a new nsCString on the stack that is a copy * of this string. @@ -764,9 +767,6 @@ public: nsCAutoString& operator=(const PRUnichar* aBuffer) {nsCString::operator=(aBuffer); return *this;} nsCAutoString& operator=(PRUnichar aChar) {nsCString::operator=(aChar); return *this;} - operator char*() {return mStr;} - operator const char*() {return (const char*)mStr;} - /** * Retrieve the size of this string * @return string length diff --git a/xpcom/ds/nsString.h b/xpcom/ds/nsString.h index 2361ed04f39..928c641edbe 100644 --- a/xpcom/ds/nsString.h +++ b/xpcom/ds/nsString.h @@ -320,6 +320,9 @@ nsCString& CompressWhitespace( PRBool aEliminateLeading=PR_TRUE,PRBool aEliminat string conversion methods... *********************************************************************/ + operator char*() {return mStr;} + operator const char*() const {return (const char*)mStr;} + /** * This method constructs a new nsCString on the stack that is a copy * of this string. @@ -764,9 +767,6 @@ public: nsCAutoString& operator=(const PRUnichar* aBuffer) {nsCString::operator=(aBuffer); return *this;} nsCAutoString& operator=(PRUnichar aChar) {nsCString::operator=(aChar); return *this;} - operator char*() {return mStr;} - operator const char*() {return (const char*)mStr;} - /** * Retrieve the size of this string * @return string length diff --git a/xpcom/string/obsolete/nsString.h b/xpcom/string/obsolete/nsString.h index 2361ed04f39..928c641edbe 100644 --- a/xpcom/string/obsolete/nsString.h +++ b/xpcom/string/obsolete/nsString.h @@ -320,6 +320,9 @@ nsCString& CompressWhitespace( PRBool aEliminateLeading=PR_TRUE,PRBool aEliminat string conversion methods... *********************************************************************/ + operator char*() {return mStr;} + operator const char*() const {return (const char*)mStr;} + /** * This method constructs a new nsCString on the stack that is a copy * of this string. @@ -764,9 +767,6 @@ public: nsCAutoString& operator=(const PRUnichar* aBuffer) {nsCString::operator=(aBuffer); return *this;} nsCAutoString& operator=(PRUnichar aChar) {nsCString::operator=(aChar); return *this;} - operator char*() {return mStr;} - operator const char*() {return (const char*)mStr;} - /** * Retrieve the size of this string * @return string length