diff --git a/mozilla/string/obsolete/nsXPIDLString.cpp b/mozilla/string/obsolete/nsXPIDLString.cpp index 1ef8e962683..0c59e6b581e 100644 --- a/mozilla/string/obsolete/nsXPIDLString.cpp +++ b/mozilla/string/obsolete/nsXPIDLString.cpp @@ -33,13 +33,6 @@ //////////////////////////////////////////////////////////////////////// // nsXPIDLString -nsXPIDLString::nsXPIDLString() - : mBuf(0), - mBufOwner(PR_FALSE) -{ -} - - nsXPIDLString::~nsXPIDLString() { if (mBufOwner && mBuf) @@ -47,12 +40,6 @@ nsXPIDLString::~nsXPIDLString() } -nsXPIDLString::operator const PRUnichar*() const -{ - return mBuf; -} - - PRUnichar* nsXPIDLString::Copy(const PRUnichar* aString) { @@ -109,13 +96,6 @@ nsXPIDLString::StartAssignmentByReference() //////////////////////////////////////////////////////////////////////// // nsXPIDLCString -nsXPIDLCString::nsXPIDLCString() - : mBuf(0), - mBufOwner(PR_FALSE) -{ -} - - nsXPIDLCString::~nsXPIDLCString() { if (mBufOwner && mBuf) @@ -141,12 +121,6 @@ nsXPIDLCString& nsXPIDLCString::operator =(const char* aCString) } -nsXPIDLCString::operator const char*() const -{ - return mBuf; -} - - char* nsXPIDLCString::Copy(const char* aCString) { diff --git a/mozilla/string/obsolete/nsXPIDLString.h b/mozilla/string/obsolete/nsXPIDLString.h index 0565a1155a8..9f99d1a4a96 100644 --- a/mozilla/string/obsolete/nsXPIDLString.h +++ b/mozilla/string/obsolete/nsXPIDLString.h @@ -110,14 +110,19 @@ public: /** * Construct a new, uninitialized wrapper for a Unicode string. */ - nsXPIDLString(); + nsXPIDLString() : mBuf(0), mBufOwner(PR_FALSE) {} virtual ~nsXPIDLString(); /** * Return a reference to the immutable Unicode string. */ - operator const PRUnichar*() const; + operator const PRUnichar*() const { return get(); } + + /** + * Return a reference to the immutable Unicode string. + */ + const PRUnichar* get() const { return mBuf; } /** * Make a copy of the Unicode string. Use this function in the @@ -168,7 +173,7 @@ public: private: // not to be implemented nsXPIDLString(nsXPIDLString& /* aXPIDLString */) {} - nsXPIDLString& operator =(nsXPIDLString& /* aXPIDLString */) { return *this; } + void operator=(nsXPIDLString& /* aXPIDLString */) {} }; @@ -248,19 +253,25 @@ public: /** * Construct a new, uninitialized wrapper for a single-byte string. */ - nsXPIDLCString(); + nsXPIDLCString() : mBuf(0), mBufOwner(PR_FALSE) {} virtual ~nsXPIDLCString(); /** - * Assign a single-byte string to this wrapper. Copies and owns the result. + * Assign a single-byte string to this wrapper. Copies + * and owns the result. */ - nsXPIDLCString& operator =(const char* aString); + nsXPIDLCString& operator=(const char* aString); /** * Return a reference to the immutable single-byte string. */ - operator const char*() const; + operator const char*() const { return get(); } + + /** + * Return a reference to the immutable single-byte string. + */ + const char* get() const { return mBuf; } /** * Make a copy of the single-byte string. Use this function in the @@ -311,7 +322,7 @@ public: private: // not to be implemented nsXPIDLCString(nsXPIDLCString& /* aXPIDLString */) {} - nsXPIDLCString& operator =(nsXPIDLCString& /* aXPIDLCString */) { return *this; } + void operator=(nsXPIDLCString& /* aXPIDLCString */) {} }; /** diff --git a/mozilla/xpcom/ds/nsXPIDLString.cpp b/mozilla/xpcom/ds/nsXPIDLString.cpp index 1ef8e962683..0c59e6b581e 100644 --- a/mozilla/xpcom/ds/nsXPIDLString.cpp +++ b/mozilla/xpcom/ds/nsXPIDLString.cpp @@ -33,13 +33,6 @@ //////////////////////////////////////////////////////////////////////// // nsXPIDLString -nsXPIDLString::nsXPIDLString() - : mBuf(0), - mBufOwner(PR_FALSE) -{ -} - - nsXPIDLString::~nsXPIDLString() { if (mBufOwner && mBuf) @@ -47,12 +40,6 @@ nsXPIDLString::~nsXPIDLString() } -nsXPIDLString::operator const PRUnichar*() const -{ - return mBuf; -} - - PRUnichar* nsXPIDLString::Copy(const PRUnichar* aString) { @@ -109,13 +96,6 @@ nsXPIDLString::StartAssignmentByReference() //////////////////////////////////////////////////////////////////////// // nsXPIDLCString -nsXPIDLCString::nsXPIDLCString() - : mBuf(0), - mBufOwner(PR_FALSE) -{ -} - - nsXPIDLCString::~nsXPIDLCString() { if (mBufOwner && mBuf) @@ -141,12 +121,6 @@ nsXPIDLCString& nsXPIDLCString::operator =(const char* aCString) } -nsXPIDLCString::operator const char*() const -{ - return mBuf; -} - - char* nsXPIDLCString::Copy(const char* aCString) { diff --git a/mozilla/xpcom/ds/nsXPIDLString.h b/mozilla/xpcom/ds/nsXPIDLString.h index 0565a1155a8..9f99d1a4a96 100644 --- a/mozilla/xpcom/ds/nsXPIDLString.h +++ b/mozilla/xpcom/ds/nsXPIDLString.h @@ -110,14 +110,19 @@ public: /** * Construct a new, uninitialized wrapper for a Unicode string. */ - nsXPIDLString(); + nsXPIDLString() : mBuf(0), mBufOwner(PR_FALSE) {} virtual ~nsXPIDLString(); /** * Return a reference to the immutable Unicode string. */ - operator const PRUnichar*() const; + operator const PRUnichar*() const { return get(); } + + /** + * Return a reference to the immutable Unicode string. + */ + const PRUnichar* get() const { return mBuf; } /** * Make a copy of the Unicode string. Use this function in the @@ -168,7 +173,7 @@ public: private: // not to be implemented nsXPIDLString(nsXPIDLString& /* aXPIDLString */) {} - nsXPIDLString& operator =(nsXPIDLString& /* aXPIDLString */) { return *this; } + void operator=(nsXPIDLString& /* aXPIDLString */) {} }; @@ -248,19 +253,25 @@ public: /** * Construct a new, uninitialized wrapper for a single-byte string. */ - nsXPIDLCString(); + nsXPIDLCString() : mBuf(0), mBufOwner(PR_FALSE) {} virtual ~nsXPIDLCString(); /** - * Assign a single-byte string to this wrapper. Copies and owns the result. + * Assign a single-byte string to this wrapper. Copies + * and owns the result. */ - nsXPIDLCString& operator =(const char* aString); + nsXPIDLCString& operator=(const char* aString); /** * Return a reference to the immutable single-byte string. */ - operator const char*() const; + operator const char*() const { return get(); } + + /** + * Return a reference to the immutable single-byte string. + */ + const char* get() const { return mBuf; } /** * Make a copy of the single-byte string. Use this function in the @@ -311,7 +322,7 @@ public: private: // not to be implemented nsXPIDLCString(nsXPIDLCString& /* aXPIDLString */) {} - nsXPIDLCString& operator =(nsXPIDLCString& /* aXPIDLCString */) { return *this; } + void operator=(nsXPIDLCString& /* aXPIDLCString */) {} }; /** diff --git a/mozilla/xpcom/string/obsolete/nsXPIDLString.cpp b/mozilla/xpcom/string/obsolete/nsXPIDLString.cpp index 1ef8e962683..0c59e6b581e 100644 --- a/mozilla/xpcom/string/obsolete/nsXPIDLString.cpp +++ b/mozilla/xpcom/string/obsolete/nsXPIDLString.cpp @@ -33,13 +33,6 @@ //////////////////////////////////////////////////////////////////////// // nsXPIDLString -nsXPIDLString::nsXPIDLString() - : mBuf(0), - mBufOwner(PR_FALSE) -{ -} - - nsXPIDLString::~nsXPIDLString() { if (mBufOwner && mBuf) @@ -47,12 +40,6 @@ nsXPIDLString::~nsXPIDLString() } -nsXPIDLString::operator const PRUnichar*() const -{ - return mBuf; -} - - PRUnichar* nsXPIDLString::Copy(const PRUnichar* aString) { @@ -109,13 +96,6 @@ nsXPIDLString::StartAssignmentByReference() //////////////////////////////////////////////////////////////////////// // nsXPIDLCString -nsXPIDLCString::nsXPIDLCString() - : mBuf(0), - mBufOwner(PR_FALSE) -{ -} - - nsXPIDLCString::~nsXPIDLCString() { if (mBufOwner && mBuf) @@ -141,12 +121,6 @@ nsXPIDLCString& nsXPIDLCString::operator =(const char* aCString) } -nsXPIDLCString::operator const char*() const -{ - return mBuf; -} - - char* nsXPIDLCString::Copy(const char* aCString) { diff --git a/mozilla/xpcom/string/obsolete/nsXPIDLString.h b/mozilla/xpcom/string/obsolete/nsXPIDLString.h index 0565a1155a8..9f99d1a4a96 100644 --- a/mozilla/xpcom/string/obsolete/nsXPIDLString.h +++ b/mozilla/xpcom/string/obsolete/nsXPIDLString.h @@ -110,14 +110,19 @@ public: /** * Construct a new, uninitialized wrapper for a Unicode string. */ - nsXPIDLString(); + nsXPIDLString() : mBuf(0), mBufOwner(PR_FALSE) {} virtual ~nsXPIDLString(); /** * Return a reference to the immutable Unicode string. */ - operator const PRUnichar*() const; + operator const PRUnichar*() const { return get(); } + + /** + * Return a reference to the immutable Unicode string. + */ + const PRUnichar* get() const { return mBuf; } /** * Make a copy of the Unicode string. Use this function in the @@ -168,7 +173,7 @@ public: private: // not to be implemented nsXPIDLString(nsXPIDLString& /* aXPIDLString */) {} - nsXPIDLString& operator =(nsXPIDLString& /* aXPIDLString */) { return *this; } + void operator=(nsXPIDLString& /* aXPIDLString */) {} }; @@ -248,19 +253,25 @@ public: /** * Construct a new, uninitialized wrapper for a single-byte string. */ - nsXPIDLCString(); + nsXPIDLCString() : mBuf(0), mBufOwner(PR_FALSE) {} virtual ~nsXPIDLCString(); /** - * Assign a single-byte string to this wrapper. Copies and owns the result. + * Assign a single-byte string to this wrapper. Copies + * and owns the result. */ - nsXPIDLCString& operator =(const char* aString); + nsXPIDLCString& operator=(const char* aString); /** * Return a reference to the immutable single-byte string. */ - operator const char*() const; + operator const char*() const { return get(); } + + /** + * Return a reference to the immutable single-byte string. + */ + const char* get() const { return mBuf; } /** * Make a copy of the single-byte string. Use this function in the @@ -311,7 +322,7 @@ public: private: // not to be implemented nsXPIDLCString(nsXPIDLCString& /* aXPIDLString */) {} - nsXPIDLCString& operator =(nsXPIDLCString& /* aXPIDLCString */) { return *this; } + void operator=(nsXPIDLCString& /* aXPIDLCString */) {} }; /**