Lots of changes to get this stuff building on Solaris, et al. None of these changes effect the mainline build yet, and won't until |NEW_STRING_APIS| is defined for everyone (coming soon)

This commit is contained in:
scc%netscape.com 2000-03-24 21:33:58 +00:00
Родитель 28862c4529
Коммит 6afbcb203d
2 изменённых файлов: 11 добавлений и 11 удалений

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

@ -46,10 +46,6 @@ class basic_nsStdStringWrapper
protected:
std::basic_string<CharT, TraitsT, AllocatorT> mRawString;
typedef typename basic_nsAWritableString<CharT>::FragmentRequest FragmentRequest;
typedef typename basic_nsAWritableString<CharT>::ReadableFragment ReadableFragment;
typedef typename basic_nsAWritableString<CharT>::WritableFragment WritableFragment;
typedef std::basic_string<CharT, TraitsT, AllocatorT> basic_string_t;
using typename basic_string_t::traits_type;
@ -71,8 +67,8 @@ class basic_nsStdStringWrapper
protected:
virtual const void* Implementation() const;
virtual const CharT* GetReadableFragment( ReadableFragment&, FragmentRequest, PRUint32 ) const;
virtual CharT* GetWritableFragment( WritableFragment&, FragmentRequest, PRUint32 );
virtual const CharT* GetReadableFragment( nsReadableFragment<CharT>&, nsFragmentRequest, PRUint32 ) const;
virtual CharT* GetWritableFragment( nsWritableFragment<CharT>&, nsFragmentRequest, PRUint32 );
public:
basic_nsStdStringWrapper() { }
@ -164,7 +160,7 @@ basic_nsStdStringWrapper<CharT, TraitsT, AllocatorT>::Implementation() const
template <class CharT, class TraitsT, class AllocatorT>
const CharT*
basic_nsStdStringWrapper<CharT, TraitsT, AllocatorT>::GetReadableFragment( ReadableFragment& aFragment, FragmentRequest aRequest, PRUint32 aOffset ) const
basic_nsStdStringWrapper<CharT, TraitsT, AllocatorT>::GetReadableFragment( nsReadableFragment<CharT>& aFragment, nsFragmentRequest aRequest, PRUint32 aOffset ) const
{
switch ( aRequest )
{
@ -183,7 +179,7 @@ basic_nsStdStringWrapper<CharT, TraitsT, AllocatorT>::GetReadableFragment( Reada
template <class CharT, class TraitsT, class AllocatorT>
CharT*
basic_nsStdStringWrapper<CharT, TraitsT, AllocatorT>::GetWritableFragment( WritableFragment& aFragment, FragmentRequest aRequest, PRUint32 aOffset )
basic_nsStdStringWrapper<CharT, TraitsT, AllocatorT>::GetWritableFragment( nsWritableFragment<CharT>& aFragment, nsFragmentRequest aRequest, PRUint32 aOffset )
{
switch ( aRequest )
{

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

@ -2,6 +2,7 @@
using namespace std;
#include "nsString.h"
#include "nsSharedString.h"
#include "nsStdStringWrapper.h"
// #define NS_USE_WCHAR_T
@ -87,6 +88,7 @@ test_multifragment_iterators( const basic_nsAReadableString<CharT>& aString )
return tests_failed;
}
#if 0
template <class CharT>
int
test_deprecated_GetBufferGetUnicode( const basic_nsAReadableString<CharT>& aReadable )
@ -143,6 +145,7 @@ test_deprecated_GetBufferGetUnicode( const basic_nsAReadableString<PRUnichar>& a
return tests_failed;
}
#endif
template <class CharT>
int
@ -237,7 +240,7 @@ test_readable_hello( const basic_nsAReadableString<CharT>& aReadable )
}
tests_failed += test_multifragment_iterators(aReadable);
tests_failed += test_deprecated_GetBufferGetUnicode(aReadable);
// tests_failed += test_deprecated_GetBufferGetUnicode(aReadable);
return tests_failed;
}
@ -347,8 +350,9 @@ main()
nsStdString s14( s7 + s8 + s9 );
tests_failed += test_readable_hello(s14);
// nsSharedString s15( s7 + s8 + s9 );
// tests_failed += test_readable_hello(s15);
nsSharedString* s15 = new_nsSharedString( s7 + s8 + s9 );
tests_failed += test_readable_hello(*s15);
cout << "Here's a string: \""; print_string(*s15) << "\"" << endl;
nsCString s10("He");
nsLiteralCString s11("l");