From a95627f25bb40338329f4304fd5241101f2027e9 Mon Sep 17 00:00:00 2001 From: "jaggernaut%netscape.com" Date: Sat, 29 Sep 2001 10:18:32 +0000 Subject: [PATCH] Removing dead code, r=dbaron, rs=scc git-svn-id: svn://10.0.0.236/trunk@104216 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/string/public/nsLocalString.h | 127 -------------------- mozilla/string/src/nsLocalString.cpp | 25 ---- mozilla/xpcom/string/public/nsLocalString.h | 127 -------------------- mozilla/xpcom/string/src/nsLocalString.cpp | 25 ---- 4 files changed, 304 deletions(-) delete mode 100644 mozilla/string/public/nsLocalString.h delete mode 100644 mozilla/string/src/nsLocalString.cpp delete mode 100644 mozilla/xpcom/string/public/nsLocalString.h delete mode 100644 mozilla/xpcom/string/src/nsLocalString.cpp diff --git a/mozilla/string/public/nsLocalString.h b/mozilla/string/public/nsLocalString.h deleted file mode 100644 index 59bc4a94b3b..00000000000 --- a/mozilla/string/public/nsLocalString.h +++ /dev/null @@ -1,127 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is Mozilla. - * - * The Initial Developer of the Original Code is Netscape - * Communications. Portions created by Netscape Communications are - * Copyright (C) 2001 by Netscape Communications. All - * Rights Reserved. - * - * Contributor(s): - * Scott Collins (original author) - */ - -#ifndef nsLocalString_h___ -#define nsLocalString_h___ - -#ifndef nsAFlatString_h___ -#include "nsAFlatString.h" -#endif - - /* - ...this class wraps a constant literal string and lets it act like an |nsAReadable...|. - - Use it like this: - - SomeFunctionTakingACString( nsLiteralCString("Hello, World!") ); - - With some tweaking, I think I can make this work as well... - - SomeStringFunc( nsLiteralString( L"Hello, World!" ) ); - - This class just holds a pointer. If you don't supply the length, it must calculate it. - No copying or allocations are performed. - - |const nsLocalString&| appears frequently in interfaces because it - allows the automatic conversion of a |PRUnichar*|. - */ - -class NS_COM nsLocalString - : public nsAFlatString - { - public: - - explicit - nsLocalString( const PRUnichar* aLiteral ) - : mHandle(NS_CONST_CAST(PRUnichar*, aLiteral), aLiteral ? (NS_CONST_CAST(PRUnichar*, aLiteral)+nsCharTraits::length(aLiteral)) : NS_CONST_CAST(PRUnichar*, aLiteral)) - { - // nothing else to do here - } - - nsLocalString( const PRUnichar* aLiteral, PRUint32 aLength ) - : mHandle(NS_CONST_CAST(PRUnichar*, aLiteral), NS_CONST_CAST(PRUnichar*, aLiteral)+aLength) - { - // This is an annoying hack. Callers should be fixed to use the other - // constructor if they don't really know the length. - if ( aLength == PRUint32(-1) ) - { -// NS_WARNING("Tell scc: Caller constructing a string doesn't know the real length. Please use the other constructor."); - mHandle.DataEnd(aLiteral ? (NS_CONST_CAST(PRUnichar*, aLiteral)+nsCharTraits::length(aLiteral)) : NS_CONST_CAST(PRUnichar*, aLiteral)); - } - } - - // nsLocalString( const nsLocalString& ); // auto-generated copy-constructor OK - // ~nsLocalString(); // auto-generated destructor OK - - virtual const nsBufferHandle* GetFlatBufferHandle() const { return &mHandle; } - virtual const nsBufferHandle* GetBufferHandle() const { return &mHandle; } - - private: - nsBufferHandle mHandle; - - private: - // NOT TO BE IMPLEMENTED - void operator=( const nsLocalString& ); // we're immutable - }; - - - -class NS_COM nsLocalCString - : public nsAFlatCString - { - public: - - explicit - nsLocalCString( const char* aLiteral ) - : mHandle(NS_CONST_CAST(char*, aLiteral), aLiteral ? (NS_CONST_CAST(char*, aLiteral)+nsCharTraits::length(aLiteral)) : NS_CONST_CAST(char*, aLiteral)) - { - // nothing else to do here - } - - nsLocalCString( const char* aLiteral, PRUint32 aLength ) - : mHandle(NS_CONST_CAST(char*, aLiteral), NS_CONST_CAST(char*, aLiteral)+aLength) - { - // This is an annoying hack. Callers should be fixed to use the other - // constructor if they don't really know the length. - if ( aLength == PRUint32(-1) ) - { -// NS_WARNING("Tell scc: Caller constructing a string doesn't know the real length. Please use the other constructor."); - mHandle.DataEnd(aLiteral ? (NS_CONST_CAST(char*, aLiteral)+nsCharTraits::length(aLiteral)) : NS_CONST_CAST(char*, aLiteral)); - } - } - - // nsLocalCString( const nsLocalCString& ); // auto-generated copy-constructor OK - // ~nsLocalCString(); // auto-generated destructor OK - - virtual const nsBufferHandle* GetFlatBufferHandle() const { return &mHandle; } - virtual const nsBufferHandle* GetBufferHandle() const { return &mHandle; } - - private: - nsBufferHandle mHandle; - - private: - // NOT TO BE IMPLEMENTED - void operator=( const nsLocalCString& ); // we're immutable - }; - -#endif /* !defined(nsLocalString_h___) */ diff --git a/mozilla/string/src/nsLocalString.cpp b/mozilla/string/src/nsLocalString.cpp deleted file mode 100644 index 5c046c264ff..00000000000 --- a/mozilla/string/src/nsLocalString.cpp +++ /dev/null @@ -1,25 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is Mozilla. - * - * The Initial Developer of the Original Code is Netscape - * Communications. Portions created by Netscape Communications are - * Copyright (C) 2001 by Netscape Communications. All - * Rights Reserved. - * - * Contributor(s): - * Scott Collins (original author) - */ - -#include "nsLocalString.h" - diff --git a/mozilla/xpcom/string/public/nsLocalString.h b/mozilla/xpcom/string/public/nsLocalString.h deleted file mode 100644 index 59bc4a94b3b..00000000000 --- a/mozilla/xpcom/string/public/nsLocalString.h +++ /dev/null @@ -1,127 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is Mozilla. - * - * The Initial Developer of the Original Code is Netscape - * Communications. Portions created by Netscape Communications are - * Copyright (C) 2001 by Netscape Communications. All - * Rights Reserved. - * - * Contributor(s): - * Scott Collins (original author) - */ - -#ifndef nsLocalString_h___ -#define nsLocalString_h___ - -#ifndef nsAFlatString_h___ -#include "nsAFlatString.h" -#endif - - /* - ...this class wraps a constant literal string and lets it act like an |nsAReadable...|. - - Use it like this: - - SomeFunctionTakingACString( nsLiteralCString("Hello, World!") ); - - With some tweaking, I think I can make this work as well... - - SomeStringFunc( nsLiteralString( L"Hello, World!" ) ); - - This class just holds a pointer. If you don't supply the length, it must calculate it. - No copying or allocations are performed. - - |const nsLocalString&| appears frequently in interfaces because it - allows the automatic conversion of a |PRUnichar*|. - */ - -class NS_COM nsLocalString - : public nsAFlatString - { - public: - - explicit - nsLocalString( const PRUnichar* aLiteral ) - : mHandle(NS_CONST_CAST(PRUnichar*, aLiteral), aLiteral ? (NS_CONST_CAST(PRUnichar*, aLiteral)+nsCharTraits::length(aLiteral)) : NS_CONST_CAST(PRUnichar*, aLiteral)) - { - // nothing else to do here - } - - nsLocalString( const PRUnichar* aLiteral, PRUint32 aLength ) - : mHandle(NS_CONST_CAST(PRUnichar*, aLiteral), NS_CONST_CAST(PRUnichar*, aLiteral)+aLength) - { - // This is an annoying hack. Callers should be fixed to use the other - // constructor if they don't really know the length. - if ( aLength == PRUint32(-1) ) - { -// NS_WARNING("Tell scc: Caller constructing a string doesn't know the real length. Please use the other constructor."); - mHandle.DataEnd(aLiteral ? (NS_CONST_CAST(PRUnichar*, aLiteral)+nsCharTraits::length(aLiteral)) : NS_CONST_CAST(PRUnichar*, aLiteral)); - } - } - - // nsLocalString( const nsLocalString& ); // auto-generated copy-constructor OK - // ~nsLocalString(); // auto-generated destructor OK - - virtual const nsBufferHandle* GetFlatBufferHandle() const { return &mHandle; } - virtual const nsBufferHandle* GetBufferHandle() const { return &mHandle; } - - private: - nsBufferHandle mHandle; - - private: - // NOT TO BE IMPLEMENTED - void operator=( const nsLocalString& ); // we're immutable - }; - - - -class NS_COM nsLocalCString - : public nsAFlatCString - { - public: - - explicit - nsLocalCString( const char* aLiteral ) - : mHandle(NS_CONST_CAST(char*, aLiteral), aLiteral ? (NS_CONST_CAST(char*, aLiteral)+nsCharTraits::length(aLiteral)) : NS_CONST_CAST(char*, aLiteral)) - { - // nothing else to do here - } - - nsLocalCString( const char* aLiteral, PRUint32 aLength ) - : mHandle(NS_CONST_CAST(char*, aLiteral), NS_CONST_CAST(char*, aLiteral)+aLength) - { - // This is an annoying hack. Callers should be fixed to use the other - // constructor if they don't really know the length. - if ( aLength == PRUint32(-1) ) - { -// NS_WARNING("Tell scc: Caller constructing a string doesn't know the real length. Please use the other constructor."); - mHandle.DataEnd(aLiteral ? (NS_CONST_CAST(char*, aLiteral)+nsCharTraits::length(aLiteral)) : NS_CONST_CAST(char*, aLiteral)); - } - } - - // nsLocalCString( const nsLocalCString& ); // auto-generated copy-constructor OK - // ~nsLocalCString(); // auto-generated destructor OK - - virtual const nsBufferHandle* GetFlatBufferHandle() const { return &mHandle; } - virtual const nsBufferHandle* GetBufferHandle() const { return &mHandle; } - - private: - nsBufferHandle mHandle; - - private: - // NOT TO BE IMPLEMENTED - void operator=( const nsLocalCString& ); // we're immutable - }; - -#endif /* !defined(nsLocalString_h___) */ diff --git a/mozilla/xpcom/string/src/nsLocalString.cpp b/mozilla/xpcom/string/src/nsLocalString.cpp deleted file mode 100644 index 5c046c264ff..00000000000 --- a/mozilla/xpcom/string/src/nsLocalString.cpp +++ /dev/null @@ -1,25 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is Mozilla. - * - * The Initial Developer of the Original Code is Netscape - * Communications. Portions created by Netscape Communications are - * Copyright (C) 2001 by Netscape Communications. All - * Rights Reserved. - * - * Contributor(s): - * Scott Collins (original author) - */ - -#include "nsLocalString.h" -