зеркало из https://github.com/mozilla/gecko-dev.git
Bug 104337: Remove nsPrivateSharableString from string hierarchy. r=dbaron, rs=scc.
This commit is contained in:
Родитель
039326bc54
Коммит
d845c2f33a
|
@ -33,32 +33,31 @@ MODULE = string
|
||||||
EXPORTS = \
|
EXPORTS = \
|
||||||
nsAFlatString.h \
|
nsAFlatString.h \
|
||||||
nsAlgorithm.h \
|
nsAlgorithm.h \
|
||||||
nsAPromiseString.h \
|
nsAPromiseString.h \
|
||||||
nsAReadableString.h \
|
nsAReadableString.h \
|
||||||
nsAString.h \
|
nsAString.h \
|
||||||
nsAStringGenerator.h \
|
nsAStringGenerator.h \
|
||||||
nsAWritableString.h \
|
nsAWritableString.h \
|
||||||
nsBufferHandle.h \
|
nsBufferHandle.h \
|
||||||
nsBufferHandleUtils.h \
|
nsBufferHandleUtils.h \
|
||||||
nsCharTraits.h \
|
nsCharTraits.h \
|
||||||
nsDependentConcatenation.h \
|
nsDependentConcatenation.h \
|
||||||
nsDependentString.h \
|
nsDependentString.h \
|
||||||
nsDependentSubstring.h \
|
nsDependentSubstring.h \
|
||||||
nsFragmentedString.h \
|
nsFragmentedString.h \
|
||||||
nsLiteralString.h \
|
nsLiteralString.h \
|
||||||
nsPrintfCString.h \
|
nsPrintfCString.h \
|
||||||
nsPrivateSharableString.h \
|
nsPromiseFlatString.h \
|
||||||
nsPromiseFlatString.h \
|
nsReadableUtils.h \
|
||||||
nsReadableUtils.h \
|
nsSharableString.h \
|
||||||
nsSharableString.h \
|
nsSharedBufferList.h \
|
||||||
nsSharedBufferList.h \
|
nsSlidingString.h \
|
||||||
nsSlidingString.h \
|
nsStringDefines.h \
|
||||||
nsStringDefines.h \
|
nsStringFragment.h \
|
||||||
nsStringFragment.h \
|
|
||||||
nsStringFwd.h \
|
nsStringFwd.h \
|
||||||
nsStringIterator.h \
|
nsStringIterator.h \
|
||||||
nsStringIteratorUtils.h \
|
nsStringIteratorUtils.h \
|
||||||
nsStringTraits.h \
|
nsStringTraits.h \
|
||||||
nsXPIDLString.h \
|
nsXPIDLString.h \
|
||||||
$(NULL)
|
$(NULL)
|
||||||
|
|
||||||
|
|
|
@ -43,7 +43,6 @@ EXPORTS = \
|
||||||
nsFragmentedString.h \
|
nsFragmentedString.h \
|
||||||
nsLiteralString.h \
|
nsLiteralString.h \
|
||||||
nsPrintfCString.h \
|
nsPrintfCString.h \
|
||||||
nsPrivateSharableString.h \
|
|
||||||
nsPromiseFlatString.h \
|
nsPromiseFlatString.h \
|
||||||
nsReadableUtils.h \
|
nsReadableUtils.h \
|
||||||
nsSharableString.h \
|
nsSharableString.h \
|
||||||
|
|
|
@ -28,8 +28,8 @@
|
||||||
#include "nsStringFwd.h"
|
#include "nsStringFwd.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef nsPrivateSharableString_h___
|
#ifndef nsBufferHandle_h___
|
||||||
#include "nsPrivateSharableString.h"
|
#include "nsBufferHandle.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef nsCharTraits_h___
|
#ifndef nsCharTraits_h___
|
||||||
|
@ -46,7 +46,6 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class NS_COM nsAString
|
class NS_COM nsAString
|
||||||
: public nsPrivateSharableString
|
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
typedef nsAString self_type;
|
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)
|
// 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 ~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& BeginReading( const_iterator& ) const;
|
||||||
inline const_iterator& EndReading( const_iterator& ) const;
|
inline const_iterator& EndReading( const_iterator& ) const;
|
||||||
|
|
||||||
|
@ -278,7 +291,6 @@ class NS_COM nsAString
|
||||||
};
|
};
|
||||||
|
|
||||||
class NS_COM nsACString
|
class NS_COM nsACString
|
||||||
: public nsPrivateSharableCString
|
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
typedef nsACString self_type;
|
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)
|
// 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 ~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& BeginReading( const_iterator& ) const;
|
||||||
inline const_iterator& EndReading( 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___)
|
|
|
@ -36,13 +36,12 @@ REQUIRES = xpcom \
|
||||||
|
|
||||||
CPPSRCS = \
|
CPPSRCS = \
|
||||||
nsAFlatString.cpp \
|
nsAFlatString.cpp \
|
||||||
nsAString.cpp \
|
nsAString.cpp \
|
||||||
nsDependentConcatenation.cpp \
|
nsDependentConcatenation.cpp \
|
||||||
nsDependentString.cpp \
|
nsDependentString.cpp \
|
||||||
nsDependentSubstring.cpp \
|
nsDependentSubstring.cpp \
|
||||||
nsFragmentedString.cpp \
|
nsFragmentedString.cpp \
|
||||||
nsPrintfCString.cpp \
|
nsPrintfCString.cpp \
|
||||||
nsPrivateSharableString.cpp \
|
|
||||||
nsPromiseFlatString.cpp \
|
nsPromiseFlatString.cpp \
|
||||||
nsReadableUtils.cpp \
|
nsReadableUtils.cpp \
|
||||||
nsSharableString.cpp \
|
nsSharableString.cpp \
|
||||||
|
|
|
@ -38,7 +38,6 @@ CPP_OBJS = \
|
||||||
.\$(OBJDIR)\nsDependentSubstring.obj \
|
.\$(OBJDIR)\nsDependentSubstring.obj \
|
||||||
.\$(OBJDIR)\nsFragmentedString.obj \
|
.\$(OBJDIR)\nsFragmentedString.obj \
|
||||||
.\$(OBJDIR)\nsPrintfCString.obj \
|
.\$(OBJDIR)\nsPrintfCString.obj \
|
||||||
.\$(OBJDIR)\nsPrivateSharableString.obj \
|
|
||||||
.\$(OBJDIR)\nsPromiseFlatString.obj \
|
.\$(OBJDIR)\nsPromiseFlatString.obj \
|
||||||
.\$(OBJDIR)\nsReadableUtils.obj \
|
.\$(OBJDIR)\nsReadableUtils.obj \
|
||||||
.\$(OBJDIR)\nsSharableString.obj \
|
.\$(OBJDIR)\nsSharableString.obj \
|
||||||
|
|
|
@ -85,6 +85,35 @@ Compare( const nsAString& lhs, const nsAString& rhs, const nsStringComparator& a
|
||||||
return 0;
|
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
|
PRBool
|
||||||
nsAString::IsVoid() const
|
nsAString::IsVoid() const
|
||||||
{
|
{
|
||||||
|
@ -560,6 +589,35 @@ Compare( const nsACString& lhs, const nsACString& rhs, const nsCStringComparator
|
||||||
return 0;
|
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
|
PRBool
|
||||||
nsACString::IsVoid() const
|
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;
|
|
||||||
}
|
|
|
@ -33,32 +33,31 @@ MODULE = string
|
||||||
EXPORTS = \
|
EXPORTS = \
|
||||||
nsAFlatString.h \
|
nsAFlatString.h \
|
||||||
nsAlgorithm.h \
|
nsAlgorithm.h \
|
||||||
nsAPromiseString.h \
|
nsAPromiseString.h \
|
||||||
nsAReadableString.h \
|
nsAReadableString.h \
|
||||||
nsAString.h \
|
nsAString.h \
|
||||||
nsAStringGenerator.h \
|
nsAStringGenerator.h \
|
||||||
nsAWritableString.h \
|
nsAWritableString.h \
|
||||||
nsBufferHandle.h \
|
nsBufferHandle.h \
|
||||||
nsBufferHandleUtils.h \
|
nsBufferHandleUtils.h \
|
||||||
nsCharTraits.h \
|
nsCharTraits.h \
|
||||||
nsDependentConcatenation.h \
|
nsDependentConcatenation.h \
|
||||||
nsDependentString.h \
|
nsDependentString.h \
|
||||||
nsDependentSubstring.h \
|
nsDependentSubstring.h \
|
||||||
nsFragmentedString.h \
|
nsFragmentedString.h \
|
||||||
nsLiteralString.h \
|
nsLiteralString.h \
|
||||||
nsPrintfCString.h \
|
nsPrintfCString.h \
|
||||||
nsPrivateSharableString.h \
|
nsPromiseFlatString.h \
|
||||||
nsPromiseFlatString.h \
|
nsReadableUtils.h \
|
||||||
nsReadableUtils.h \
|
nsSharableString.h \
|
||||||
nsSharableString.h \
|
nsSharedBufferList.h \
|
||||||
nsSharedBufferList.h \
|
nsSlidingString.h \
|
||||||
nsSlidingString.h \
|
nsStringDefines.h \
|
||||||
nsStringDefines.h \
|
nsStringFragment.h \
|
||||||
nsStringFragment.h \
|
|
||||||
nsStringFwd.h \
|
nsStringFwd.h \
|
||||||
nsStringIterator.h \
|
nsStringIterator.h \
|
||||||
nsStringIteratorUtils.h \
|
nsStringIteratorUtils.h \
|
||||||
nsStringTraits.h \
|
nsStringTraits.h \
|
||||||
nsXPIDLString.h \
|
nsXPIDLString.h \
|
||||||
$(NULL)
|
$(NULL)
|
||||||
|
|
||||||
|
|
|
@ -43,7 +43,6 @@ EXPORTS = \
|
||||||
nsFragmentedString.h \
|
nsFragmentedString.h \
|
||||||
nsLiteralString.h \
|
nsLiteralString.h \
|
||||||
nsPrintfCString.h \
|
nsPrintfCString.h \
|
||||||
nsPrivateSharableString.h \
|
|
||||||
nsPromiseFlatString.h \
|
nsPromiseFlatString.h \
|
||||||
nsReadableUtils.h \
|
nsReadableUtils.h \
|
||||||
nsSharableString.h \
|
nsSharableString.h \
|
||||||
|
|
|
@ -28,8 +28,8 @@
|
||||||
#include "nsStringFwd.h"
|
#include "nsStringFwd.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef nsPrivateSharableString_h___
|
#ifndef nsBufferHandle_h___
|
||||||
#include "nsPrivateSharableString.h"
|
#include "nsBufferHandle.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef nsCharTraits_h___
|
#ifndef nsCharTraits_h___
|
||||||
|
@ -46,7 +46,6 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class NS_COM nsAString
|
class NS_COM nsAString
|
||||||
: public nsPrivateSharableString
|
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
typedef nsAString self_type;
|
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)
|
// 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 ~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& BeginReading( const_iterator& ) const;
|
||||||
inline const_iterator& EndReading( const_iterator& ) const;
|
inline const_iterator& EndReading( const_iterator& ) const;
|
||||||
|
|
||||||
|
@ -278,7 +291,6 @@ class NS_COM nsAString
|
||||||
};
|
};
|
||||||
|
|
||||||
class NS_COM nsACString
|
class NS_COM nsACString
|
||||||
: public nsPrivateSharableCString
|
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
typedef nsACString self_type;
|
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)
|
// 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 ~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& BeginReading( const_iterator& ) const;
|
||||||
inline const_iterator& EndReading( 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___)
|
|
|
@ -36,13 +36,12 @@ REQUIRES = xpcom \
|
||||||
|
|
||||||
CPPSRCS = \
|
CPPSRCS = \
|
||||||
nsAFlatString.cpp \
|
nsAFlatString.cpp \
|
||||||
nsAString.cpp \
|
nsAString.cpp \
|
||||||
nsDependentConcatenation.cpp \
|
nsDependentConcatenation.cpp \
|
||||||
nsDependentString.cpp \
|
nsDependentString.cpp \
|
||||||
nsDependentSubstring.cpp \
|
nsDependentSubstring.cpp \
|
||||||
nsFragmentedString.cpp \
|
nsFragmentedString.cpp \
|
||||||
nsPrintfCString.cpp \
|
nsPrintfCString.cpp \
|
||||||
nsPrivateSharableString.cpp \
|
|
||||||
nsPromiseFlatString.cpp \
|
nsPromiseFlatString.cpp \
|
||||||
nsReadableUtils.cpp \
|
nsReadableUtils.cpp \
|
||||||
nsSharableString.cpp \
|
nsSharableString.cpp \
|
||||||
|
|
|
@ -38,7 +38,6 @@ CPP_OBJS = \
|
||||||
.\$(OBJDIR)\nsDependentSubstring.obj \
|
.\$(OBJDIR)\nsDependentSubstring.obj \
|
||||||
.\$(OBJDIR)\nsFragmentedString.obj \
|
.\$(OBJDIR)\nsFragmentedString.obj \
|
||||||
.\$(OBJDIR)\nsPrintfCString.obj \
|
.\$(OBJDIR)\nsPrintfCString.obj \
|
||||||
.\$(OBJDIR)\nsPrivateSharableString.obj \
|
|
||||||
.\$(OBJDIR)\nsPromiseFlatString.obj \
|
.\$(OBJDIR)\nsPromiseFlatString.obj \
|
||||||
.\$(OBJDIR)\nsReadableUtils.obj \
|
.\$(OBJDIR)\nsReadableUtils.obj \
|
||||||
.\$(OBJDIR)\nsSharableString.obj \
|
.\$(OBJDIR)\nsSharableString.obj \
|
||||||
|
|
|
@ -85,6 +85,35 @@ Compare( const nsAString& lhs, const nsAString& rhs, const nsStringComparator& a
|
||||||
return 0;
|
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
|
PRBool
|
||||||
nsAString::IsVoid() const
|
nsAString::IsVoid() const
|
||||||
{
|
{
|
||||||
|
@ -560,6 +589,35 @@ Compare( const nsACString& lhs, const nsACString& rhs, const nsCStringComparator
|
||||||
return 0;
|
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
|
PRBool
|
||||||
nsACString::IsVoid() const
|
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;
|
|
||||||
}
|
|
Загрузка…
Ссылка в новой задаче