Bug 104337: Remove nsPrivateSharableString from string hierarchy. r=dbaron, rs=scc.

This commit is contained in:
jaggernaut%netscape.com 2001-10-12 07:34:28 +00:00
Родитель 039326bc54
Коммит d845c2f33a
16 изменённых файлов: 226 добавлений и 400 удалений

Просмотреть файл

@ -47,7 +47,6 @@ EXPORTS = \
nsFragmentedString.h \
nsLiteralString.h \
nsPrintfCString.h \
nsPrivateSharableString.h \
nsPromiseFlatString.h \
nsReadableUtils.h \
nsSharableString.h \

Просмотреть файл

@ -43,7 +43,6 @@ EXPORTS = \
nsFragmentedString.h \
nsLiteralString.h \
nsPrintfCString.h \
nsPrivateSharableString.h \
nsPromiseFlatString.h \
nsReadableUtils.h \
nsSharableString.h \

Просмотреть файл

@ -28,8 +28,8 @@
#include "nsStringFwd.h"
#endif
#ifndef nsPrivateSharableString_h___
#include "nsPrivateSharableString.h"
#ifndef nsBufferHandle_h___
#include "nsBufferHandle.h"
#endif
#ifndef nsCharTraits_h___
@ -46,7 +46,6 @@
*/
class NS_COM nsAString
: public nsPrivateSharableString
{
public:
typedef nsAString self_type;
@ -68,6 +67,20 @@ class NS_COM nsAString
// nsAString( const self_type& ); // auto-generated copy-constructor OK (again, only because we're abstract)
virtual ~nsAString() { } // ...yes, I expect to be sub-classed
virtual PRUint32 GetImplementationFlags() const;
virtual const nsBufferHandle<char_type>* GetFlatBufferHandle() const;
virtual const nsBufferHandle<char_type>* GetBufferHandle() const;
virtual const nsSharedBufferHandle<char_type>* GetSharedBufferHandle() const;
/**
* |GetBufferHandle()| will return either |0|, or a reasonable pointer.
* The meaning of |0| is that the string points to a non-contiguous or else empty representation.
* Otherwise |GetBufferHandle()| returns a handle that points to the single contiguous hunk of characters
* that make up this string.
*/
inline const_iterator& BeginReading( const_iterator& ) const;
inline const_iterator& EndReading( const_iterator& ) const;
@ -278,7 +291,6 @@ class NS_COM nsAString
};
class NS_COM nsACString
: public nsPrivateSharableCString
{
public:
typedef nsACString self_type;
@ -300,6 +312,20 @@ class NS_COM nsACString
// nsACString( const self_type& ); // auto-generated copy-constructor OK (again, only because we're abstract)
virtual ~nsACString() { } // ...yes, I expect to be sub-classed
virtual PRUint32 GetImplementationFlags() const;
virtual const nsBufferHandle<char_type>* GetFlatBufferHandle() const;
virtual const nsBufferHandle<char_type>* GetBufferHandle() const;
virtual const nsSharedBufferHandle<char_type>* GetSharedBufferHandle() const;
/**
* |GetBufferHandle()| will return either |0|, or a reasonable pointer.
* The meaning of |0| is that the string points to a non-contiguous or else empty representation.
* Otherwise |GetBufferHandle()| returns a handle that points to the single contiguous hunk of characters
* that make up this string.
*/
inline const_iterator& BeginReading( const_iterator& ) const;
inline const_iterator& EndReading( const_iterator& ) const;

Просмотреть файл

@ -1,82 +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 strings.
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 2000 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
* Scott Collins <scc@mozilla.org> (original author)
*
*/
#ifndef nsPrivateSharableString_h___
#define nsPrivateSharableString_h___
#ifndef nsBufferHandle_h___
#include "nsBufferHandle.h"
#endif
/**
* This class is part of the machinery that makes
* most string implementations in this family share their underlying buffers
* when convenient. It is _not_ part of the abstract string interface,
* though other machinery interested in sharing buffers will know about it.
*
* Normal string clients must _never_ call routines from this interface.
*/
class NS_COM nsPrivateSharableString
{
public:
typedef PRUnichar char_type;
public:
virtual ~nsPrivateSharableString() {}
virtual PRUint32 GetImplementationFlags() const;
virtual const nsBufferHandle<char_type>* GetFlatBufferHandle() const;
virtual const nsBufferHandle<char_type>* GetBufferHandle() const;
virtual const nsSharedBufferHandle<char_type>* GetSharedBufferHandle() const;
/**
* |GetBufferHandle()| will return either |0|, or a reasonable pointer.
* The meaning of |0| is that the string points to a non-contiguous or else empty representation.
* Otherwise |GetBufferHandle()| returns a handle that points to the single contiguous hunk of characters
* that make up this string.
*/
};
class NS_COM nsPrivateSharableCString
{
public:
typedef char char_type;
public:
virtual ~nsPrivateSharableCString() {}
virtual PRUint32 GetImplementationFlags() const;
virtual const nsBufferHandle<char_type>* GetFlatBufferHandle() const;
virtual const nsBufferHandle<char_type>* GetBufferHandle() const;
virtual const nsSharedBufferHandle<char_type>* GetSharedBufferHandle() const;
/**
* |GetBufferHandle()| will return either |0|, or a reasonable pointer.
* The meaning of |0| is that the string points to a non-contiguous or else empty representation.
* Otherwise |GetBufferHandle()| returns a handle that points to the single contiguous hunk of characters
* that make up this string.
*/
};
#endif // !defined(nsPrivateSharableString_h___)

Просмотреть файл

@ -42,7 +42,6 @@ CPPSRCS = \
nsDependentSubstring.cpp \
nsFragmentedString.cpp \
nsPrintfCString.cpp \
nsPrivateSharableString.cpp \
nsPromiseFlatString.cpp \
nsReadableUtils.cpp \
nsSharableString.cpp \

Просмотреть файл

@ -38,7 +38,6 @@ CPP_OBJS = \
.\$(OBJDIR)\nsDependentSubstring.obj \
.\$(OBJDIR)\nsFragmentedString.obj \
.\$(OBJDIR)\nsPrintfCString.obj \
.\$(OBJDIR)\nsPrivateSharableString.obj \
.\$(OBJDIR)\nsPromiseFlatString.obj \
.\$(OBJDIR)\nsReadableUtils.obj \
.\$(OBJDIR)\nsSharableString.obj \

Просмотреть файл

@ -85,6 +85,35 @@ Compare( const nsAString& lhs, const nsAString& rhs, const nsStringComparator& a
return 0;
}
const nsSharedBufferHandle<PRUnichar>*
nsAString::GetSharedBufferHandle() const
{
return 0;
}
const nsBufferHandle<PRUnichar>*
nsAString::GetFlatBufferHandle() const
{
return GetSharedBufferHandle();
}
const nsBufferHandle<PRUnichar>*
nsAString::GetBufferHandle() const
{
return GetSharedBufferHandle();
}
PRUint32
nsAString::GetImplementationFlags() const
{
PRUint32 flags = 0;
const nsSharedBufferHandle<char_type>* handle = GetSharedBufferHandle();
if ( handle )
flags = handle->GetImplementationFlags();
return flags;
}
PRBool
nsAString::IsVoid() const
{
@ -560,6 +589,35 @@ Compare( const nsACString& lhs, const nsACString& rhs, const nsCStringComparator
return 0;
}
const nsSharedBufferHandle<char>*
nsACString::GetSharedBufferHandle() const
{
return 0;
}
const nsBufferHandle<char>*
nsACString::GetFlatBufferHandle() const
{
return GetSharedBufferHandle();
}
const nsBufferHandle<char>*
nsACString::GetBufferHandle() const
{
return GetSharedBufferHandle();
}
PRUint32
nsACString::GetImplementationFlags() const
{
PRUint32 flags = 0;
const nsSharedBufferHandle<char_type>* handle = GetSharedBufferHandle();
if ( handle )
flags = handle->GetImplementationFlags();
return flags;
}
PRBool
nsACString::IsVoid() const
{

Просмотреть файл

@ -1,85 +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 <scc@mozilla.org> (original author)
*/
#include "nsPrivateSharableString.h"
//-------1---------2---------3---------4---------5---------6---------7---------8
const nsSharedBufferHandle<PRUnichar>*
nsPrivateSharableString::GetSharedBufferHandle() const
{
return 0;
}
const nsBufferHandle<PRUnichar>*
nsPrivateSharableString::GetFlatBufferHandle() const
{
return GetSharedBufferHandle();
}
const nsBufferHandle<PRUnichar>*
nsPrivateSharableString::GetBufferHandle() const
{
return GetSharedBufferHandle();
}
PRUint32
nsPrivateSharableString::GetImplementationFlags() const
{
PRUint32 flags = 0;
const nsSharedBufferHandle<char_type>* handle = GetSharedBufferHandle();
if ( handle )
flags = handle->GetImplementationFlags();
return flags;
}
const nsSharedBufferHandle<char>*
nsPrivateSharableCString::GetSharedBufferHandle() const
{
return 0;
}
const nsBufferHandle<char>*
nsPrivateSharableCString::GetFlatBufferHandle() const
{
return GetSharedBufferHandle();
}
const nsBufferHandle<char>*
nsPrivateSharableCString::GetBufferHandle() const
{
return GetSharedBufferHandle();
}
PRUint32
nsPrivateSharableCString::GetImplementationFlags() const
{
PRUint32 flags = 0;
const nsSharedBufferHandle<char_type>* handle = GetSharedBufferHandle();
if ( handle )
flags = handle->GetImplementationFlags();
return flags;
}

Просмотреть файл

@ -47,7 +47,6 @@ EXPORTS = \
nsFragmentedString.h \
nsLiteralString.h \
nsPrintfCString.h \
nsPrivateSharableString.h \
nsPromiseFlatString.h \
nsReadableUtils.h \
nsSharableString.h \

Просмотреть файл

@ -43,7 +43,6 @@ EXPORTS = \
nsFragmentedString.h \
nsLiteralString.h \
nsPrintfCString.h \
nsPrivateSharableString.h \
nsPromiseFlatString.h \
nsReadableUtils.h \
nsSharableString.h \

Просмотреть файл

@ -28,8 +28,8 @@
#include "nsStringFwd.h"
#endif
#ifndef nsPrivateSharableString_h___
#include "nsPrivateSharableString.h"
#ifndef nsBufferHandle_h___
#include "nsBufferHandle.h"
#endif
#ifndef nsCharTraits_h___
@ -46,7 +46,6 @@
*/
class NS_COM nsAString
: public nsPrivateSharableString
{
public:
typedef nsAString self_type;
@ -68,6 +67,20 @@ class NS_COM nsAString
// nsAString( const self_type& ); // auto-generated copy-constructor OK (again, only because we're abstract)
virtual ~nsAString() { } // ...yes, I expect to be sub-classed
virtual PRUint32 GetImplementationFlags() const;
virtual const nsBufferHandle<char_type>* GetFlatBufferHandle() const;
virtual const nsBufferHandle<char_type>* GetBufferHandle() const;
virtual const nsSharedBufferHandle<char_type>* GetSharedBufferHandle() const;
/**
* |GetBufferHandle()| will return either |0|, or a reasonable pointer.
* The meaning of |0| is that the string points to a non-contiguous or else empty representation.
* Otherwise |GetBufferHandle()| returns a handle that points to the single contiguous hunk of characters
* that make up this string.
*/
inline const_iterator& BeginReading( const_iterator& ) const;
inline const_iterator& EndReading( const_iterator& ) const;
@ -278,7 +291,6 @@ class NS_COM nsAString
};
class NS_COM nsACString
: public nsPrivateSharableCString
{
public:
typedef nsACString self_type;
@ -300,6 +312,20 @@ class NS_COM nsACString
// nsACString( const self_type& ); // auto-generated copy-constructor OK (again, only because we're abstract)
virtual ~nsACString() { } // ...yes, I expect to be sub-classed
virtual PRUint32 GetImplementationFlags() const;
virtual const nsBufferHandle<char_type>* GetFlatBufferHandle() const;
virtual const nsBufferHandle<char_type>* GetBufferHandle() const;
virtual const nsSharedBufferHandle<char_type>* GetSharedBufferHandle() const;
/**
* |GetBufferHandle()| will return either |0|, or a reasonable pointer.
* The meaning of |0| is that the string points to a non-contiguous or else empty representation.
* Otherwise |GetBufferHandle()| returns a handle that points to the single contiguous hunk of characters
* that make up this string.
*/
inline const_iterator& BeginReading( const_iterator& ) const;
inline const_iterator& EndReading( const_iterator& ) const;

Просмотреть файл

@ -1,82 +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 strings.
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 2000 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
* Scott Collins <scc@mozilla.org> (original author)
*
*/
#ifndef nsPrivateSharableString_h___
#define nsPrivateSharableString_h___
#ifndef nsBufferHandle_h___
#include "nsBufferHandle.h"
#endif
/**
* This class is part of the machinery that makes
* most string implementations in this family share their underlying buffers
* when convenient. It is _not_ part of the abstract string interface,
* though other machinery interested in sharing buffers will know about it.
*
* Normal string clients must _never_ call routines from this interface.
*/
class NS_COM nsPrivateSharableString
{
public:
typedef PRUnichar char_type;
public:
virtual ~nsPrivateSharableString() {}
virtual PRUint32 GetImplementationFlags() const;
virtual const nsBufferHandle<char_type>* GetFlatBufferHandle() const;
virtual const nsBufferHandle<char_type>* GetBufferHandle() const;
virtual const nsSharedBufferHandle<char_type>* GetSharedBufferHandle() const;
/**
* |GetBufferHandle()| will return either |0|, or a reasonable pointer.
* The meaning of |0| is that the string points to a non-contiguous or else empty representation.
* Otherwise |GetBufferHandle()| returns a handle that points to the single contiguous hunk of characters
* that make up this string.
*/
};
class NS_COM nsPrivateSharableCString
{
public:
typedef char char_type;
public:
virtual ~nsPrivateSharableCString() {}
virtual PRUint32 GetImplementationFlags() const;
virtual const nsBufferHandle<char_type>* GetFlatBufferHandle() const;
virtual const nsBufferHandle<char_type>* GetBufferHandle() const;
virtual const nsSharedBufferHandle<char_type>* GetSharedBufferHandle() const;
/**
* |GetBufferHandle()| will return either |0|, or a reasonable pointer.
* The meaning of |0| is that the string points to a non-contiguous or else empty representation.
* Otherwise |GetBufferHandle()| returns a handle that points to the single contiguous hunk of characters
* that make up this string.
*/
};
#endif // !defined(nsPrivateSharableString_h___)

Просмотреть файл

@ -42,7 +42,6 @@ CPPSRCS = \
nsDependentSubstring.cpp \
nsFragmentedString.cpp \
nsPrintfCString.cpp \
nsPrivateSharableString.cpp \
nsPromiseFlatString.cpp \
nsReadableUtils.cpp \
nsSharableString.cpp \

Просмотреть файл

@ -38,7 +38,6 @@ CPP_OBJS = \
.\$(OBJDIR)\nsDependentSubstring.obj \
.\$(OBJDIR)\nsFragmentedString.obj \
.\$(OBJDIR)\nsPrintfCString.obj \
.\$(OBJDIR)\nsPrivateSharableString.obj \
.\$(OBJDIR)\nsPromiseFlatString.obj \
.\$(OBJDIR)\nsReadableUtils.obj \
.\$(OBJDIR)\nsSharableString.obj \

Просмотреть файл

@ -85,6 +85,35 @@ Compare( const nsAString& lhs, const nsAString& rhs, const nsStringComparator& a
return 0;
}
const nsSharedBufferHandle<PRUnichar>*
nsAString::GetSharedBufferHandle() const
{
return 0;
}
const nsBufferHandle<PRUnichar>*
nsAString::GetFlatBufferHandle() const
{
return GetSharedBufferHandle();
}
const nsBufferHandle<PRUnichar>*
nsAString::GetBufferHandle() const
{
return GetSharedBufferHandle();
}
PRUint32
nsAString::GetImplementationFlags() const
{
PRUint32 flags = 0;
const nsSharedBufferHandle<char_type>* handle = GetSharedBufferHandle();
if ( handle )
flags = handle->GetImplementationFlags();
return flags;
}
PRBool
nsAString::IsVoid() const
{
@ -560,6 +589,35 @@ Compare( const nsACString& lhs, const nsACString& rhs, const nsCStringComparator
return 0;
}
const nsSharedBufferHandle<char>*
nsACString::GetSharedBufferHandle() const
{
return 0;
}
const nsBufferHandle<char>*
nsACString::GetFlatBufferHandle() const
{
return GetSharedBufferHandle();
}
const nsBufferHandle<char>*
nsACString::GetBufferHandle() const
{
return GetSharedBufferHandle();
}
PRUint32
nsACString::GetImplementationFlags() const
{
PRUint32 flags = 0;
const nsSharedBufferHandle<char_type>* handle = GetSharedBufferHandle();
if ( handle )
flags = handle->GetImplementationFlags();
return flags;
}
PRBool
nsACString::IsVoid() const
{

Просмотреть файл

@ -1,85 +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 <scc@mozilla.org> (original author)
*/
#include "nsPrivateSharableString.h"
//-------1---------2---------3---------4---------5---------6---------7---------8
const nsSharedBufferHandle<PRUnichar>*
nsPrivateSharableString::GetSharedBufferHandle() const
{
return 0;
}
const nsBufferHandle<PRUnichar>*
nsPrivateSharableString::GetFlatBufferHandle() const
{
return GetSharedBufferHandle();
}
const nsBufferHandle<PRUnichar>*
nsPrivateSharableString::GetBufferHandle() const
{
return GetSharedBufferHandle();
}
PRUint32
nsPrivateSharableString::GetImplementationFlags() const
{
PRUint32 flags = 0;
const nsSharedBufferHandle<char_type>* handle = GetSharedBufferHandle();
if ( handle )
flags = handle->GetImplementationFlags();
return flags;
}
const nsSharedBufferHandle<char>*
nsPrivateSharableCString::GetSharedBufferHandle() const
{
return 0;
}
const nsBufferHandle<char>*
nsPrivateSharableCString::GetFlatBufferHandle() const
{
return GetSharedBufferHandle();
}
const nsBufferHandle<char>*
nsPrivateSharableCString::GetBufferHandle() const
{
return GetSharedBufferHandle();
}
PRUint32
nsPrivateSharableCString::GetImplementationFlags() const
{
PRUint32 flags = 0;
const nsSharedBufferHandle<char_type>* handle = GetSharedBufferHandle();
if ( handle )
flags = handle->GetImplementationFlags();
return flags;
}