bug #75220: sr=jst, r=dr; rename |nsCommon[C]String| to |nsSharable[C]String|. Stop building the old implementation in "nsCommonString.cpp", and |typedef| the old type to an alias for |nsSharable[C]String|.

This commit is contained in:
scc%mozilla.org 2001-05-16 04:49:20 +00:00
parent 0477cde50e
commit 11987640ad
8 changed files with 10 additions and 148 deletions

Binary file not shown.

View File

@ -21,84 +21,17 @@
* Scott Collins <scc@mozilla.org> (original author)
*/
/* nsCommonString.h --- a string implementation that shares its underlying storage */
/* nsCommonString.h --- a deprecated synonym for |nsSharable[C]String| */
#ifndef nsCommonString_h___
#define nsCommonString_h___
#ifndef nsAFlatString_h___
#include "nsAFlatString.h"
#ifndef nsSharableString_h___
#include "nsSharableString.h"
#endif
#ifndef nsBufferHandleUtils_h___
#include "nsBufferHandleUtils.h"
#endif
//-------1---------2---------3---------4---------5---------6---------7---------8
/**
* Not yet ready for non-|const| access
*/
class NS_COM nsCommonString
: public nsAFlatString
{
public:
typedef nsCommonString self_type;
typedef PRUnichar char_type;
typedef nsAString string_type;
public:
nsCommonString() { }
nsCommonString( const self_type& aOther ) : mBuffer(aOther.mBuffer) { }
explicit nsCommonString( const string_type& aReadable ) { assign(aReadable); }
explicit nsCommonString( const nsSharedBufferHandle<char_type>* aHandle ) : mBuffer(aHandle) { }
self_type&
operator=( const string_type& aReadable )
{
assign(aReadable);
return *this;
}
protected:
void assign( const string_type& );
virtual const nsSharedBufferHandle<char_type>* GetSharedBufferHandle() const;
private:
nsAutoBufferHandle<char_type> mBuffer;
};
class NS_COM nsCommonCString
: public nsAFlatCString
{
public:
typedef nsCommonCString self_type;
typedef char char_type;
typedef nsACString string_type;
public:
nsCommonCString() { }
nsCommonCString( const self_type& aOther ) : mBuffer(aOther.mBuffer) { }
explicit nsCommonCString( const string_type& aReadable ) { assign(aReadable); }
explicit nsCommonCString( const nsSharedBufferHandle<char_type>* aHandle ) : mBuffer(aHandle) { }
self_type&
operator=( const string_type& aReadable )
{
assign(aReadable);
return *this;
}
protected:
void assign( const string_type& );
virtual const nsSharedBufferHandle<char_type>* GetSharedBufferHandle() const;
private:
nsAutoBufferHandle<char_type> mBuffer;
};
typedef nsSharableString nsCommonString;
typedef nsSharableCString nsCommonCString;
#endif /* !defined(nsCommonString_h___) */

View File

@ -36,7 +36,6 @@ REQUIRES = xpcom
CPPSRCS = \
nsAFlatString.cpp \
nsAString.cpp \
nsCommonString.cpp \
nsFragmentedString.cpp \
nsLocalString.cpp \
nsPrintfCString.cpp \

View File

@ -31,7 +31,6 @@ LCFLAGS = -D_IMPL_NS_COM -D_IMPL_NS_BASE -DWIN32_LEAN_AND_MEAN
CPP_OBJS = \
.\$(OBJDIR)\nsAFlatString.obj \
.\$(OBJDIR)\nsAString.obj \
.\$(OBJDIR)\nsCommonString.obj \
.\$(OBJDIR)\nsFragmentedString.obj \
.\$(OBJDIR)\nsLocalString.obj \
.\$(OBJDIR)\nsPrintfCString.obj \

Binary file not shown.

View File

@ -21,84 +21,17 @@
* Scott Collins <scc@mozilla.org> (original author)
*/
/* nsCommonString.h --- a string implementation that shares its underlying storage */
/* nsCommonString.h --- a deprecated synonym for |nsSharable[C]String| */
#ifndef nsCommonString_h___
#define nsCommonString_h___
#ifndef nsAFlatString_h___
#include "nsAFlatString.h"
#ifndef nsSharableString_h___
#include "nsSharableString.h"
#endif
#ifndef nsBufferHandleUtils_h___
#include "nsBufferHandleUtils.h"
#endif
//-------1---------2---------3---------4---------5---------6---------7---------8
/**
* Not yet ready for non-|const| access
*/
class NS_COM nsCommonString
: public nsAFlatString
{
public:
typedef nsCommonString self_type;
typedef PRUnichar char_type;
typedef nsAString string_type;
public:
nsCommonString() { }
nsCommonString( const self_type& aOther ) : mBuffer(aOther.mBuffer) { }
explicit nsCommonString( const string_type& aReadable ) { assign(aReadable); }
explicit nsCommonString( const nsSharedBufferHandle<char_type>* aHandle ) : mBuffer(aHandle) { }
self_type&
operator=( const string_type& aReadable )
{
assign(aReadable);
return *this;
}
protected:
void assign( const string_type& );
virtual const nsSharedBufferHandle<char_type>* GetSharedBufferHandle() const;
private:
nsAutoBufferHandle<char_type> mBuffer;
};
class NS_COM nsCommonCString
: public nsAFlatCString
{
public:
typedef nsCommonCString self_type;
typedef char char_type;
typedef nsACString string_type;
public:
nsCommonCString() { }
nsCommonCString( const self_type& aOther ) : mBuffer(aOther.mBuffer) { }
explicit nsCommonCString( const string_type& aReadable ) { assign(aReadable); }
explicit nsCommonCString( const nsSharedBufferHandle<char_type>* aHandle ) : mBuffer(aHandle) { }
self_type&
operator=( const string_type& aReadable )
{
assign(aReadable);
return *this;
}
protected:
void assign( const string_type& );
virtual const nsSharedBufferHandle<char_type>* GetSharedBufferHandle() const;
private:
nsAutoBufferHandle<char_type> mBuffer;
};
typedef nsSharableString nsCommonString;
typedef nsSharableCString nsCommonCString;
#endif /* !defined(nsCommonString_h___) */

View File

@ -36,7 +36,6 @@ REQUIRES = xpcom
CPPSRCS = \
nsAFlatString.cpp \
nsAString.cpp \
nsCommonString.cpp \
nsFragmentedString.cpp \
nsLocalString.cpp \
nsPrintfCString.cpp \

View File

@ -31,7 +31,6 @@ LCFLAGS = -D_IMPL_NS_COM -D_IMPL_NS_BASE -DWIN32_LEAN_AND_MEAN
CPP_OBJS = \
.\$(OBJDIR)\nsAFlatString.obj \
.\$(OBJDIR)\nsAString.obj \
.\$(OBJDIR)\nsCommonString.obj \
.\$(OBJDIR)\nsFragmentedString.obj \
.\$(OBJDIR)\nsLocalString.obj \
.\$(OBJDIR)\nsPrintfCString.obj \