resolving ambiguities; getting the new string APIs to build everywhere

This commit is contained in:
scc%netscape.com 2000-03-23 22:42:34 +00:00
Родитель bd13aa02fa
Коммит 440183335b
21 изменённых файлов: 96 добавлений и 48 удалений

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

@ -898,6 +898,7 @@ nsCString& nsCString::Assign(char aChar) {
return Append(aChar);
}
#ifndef NEW_STRING_APIS
/**
* WARNING! THIS IS A VERY SPECIAL METHOD.
* This method "steals" the contents of aSource and hands it to aDest.
@ -916,7 +917,7 @@ nsCString& nsCString::operator=(nsSubsumeCStr& aSubsumeString) {
#endif // AIX
return *this;
}
#endif
/**
* append given string to this string

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

@ -420,28 +420,33 @@ public:
* @param aString: string to be added to this
* @return this
*/
nsCString& operator=(const nsCString& aString) {return Assign(aString);}
nsCString& operator=(const nsStr& aString) {return Assign(aString);}
nsCString& operator=(PRUnichar aChar) {return Assign(aChar);}
nsCString& operator=(char aChar) {return Assign(aChar);}
nsCString& operator=(const char* aCString) {return Assign(aCString);}
nsCString& operator=(const PRUnichar* aString) {return Assign(aString);}
#ifndef NEW_STRING_APIS
nsCString& operator=(const nsCString& aString) {return Assign(aString);}
nsCString& operator=(const nsStr& aString) {return Assign(aString);}
nsCString& operator=(const char* aCString) {return Assign(aCString);}
#ifdef AIX
nsCString& operator=(const nsSubsumeCStr& aSubsumeString); // AIX requires a const here
#else
nsCString& operator=(nsSubsumeCStr& aSubsumeString);
#endif
#endif
/**
* Here's a bunch of methods that append varying types...
* @param various...
* @return this
*/
nsCString& operator+=(const nsCString& aString){return Append(aString,(PRInt32)aString.mLength);}
nsCString& operator+=(const char* aCString) {return Append(aCString);}
nsCString& operator+=(const PRUnichar aChar){return Append(aChar);}
nsCString& operator+=(const char aChar){return Append(aChar);}
nsCString& operator+=(const int anInt){return Append(anInt,10);}
#ifndef NEW_STRING_APIS
nsCString& operator+=(const nsCString& aString){return Append(aString,(PRInt32)aString.mLength);}
nsCString& operator+=(const char* aCString) {return Append(aCString);}
#endif
/*
* Appends n characters from given string to this,

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

@ -1028,6 +1028,7 @@ nsString& nsString::Assign(PRUnichar aChar) {
return Append(aChar);
}
#ifndef NEW_STRING_APIS
/**
* WARNING! THIS IS A VERY SPECIAL METHOD.
* This method "steals" the contents of aSource and hands it to aDest.
@ -1046,7 +1047,7 @@ nsString& nsString::operator=(const nsSubsumeStr& aSubsumeString) {
#endif // AIX
return *this;
}
#endif
/**
* append given string to this string;

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

@ -235,6 +235,7 @@ public:
PRBool SetCharAt(PRUnichar aChar,PRUint32 anIndex);
#ifndef NEW_STRING_APIS
/**********************************************************************
String concatenation methods...
*********************************************************************/
@ -274,6 +275,7 @@ public:
* @return newly created string
*/
nsSubsumeStr operator+(PRUnichar aChar);
#endif
/**********************************************************************
Lexomorphic transforms...
@ -464,34 +466,38 @@ public:
* @param aString: string to be added to this
* @return this
*/
nsString& operator=(const nsString& aString) {return Assign(aString);}
nsString& operator=(const nsStr& aString) {return Assign(aString);}
nsString& operator=(char aChar) {return Assign(aChar);}
nsString& operator=(PRUnichar aChar) {return Assign(aChar);}
nsString& operator=(const char* aCString) {return Assign(aCString);}
#ifndef NEW_STRING_APIS
nsString& operator=(const nsString& aString) {return Assign(aString);}
nsString& operator=(const nsStr& aString) {return Assign(aString);}
nsString& operator=(const PRUnichar* aString) {return Assign(aString);}
#ifdef AIX
nsString& operator=(const nsSubsumeStr& aSubsumeString); // AIX requires a const here
#else
nsString& operator=(nsSubsumeStr& aSubsumeString);
#endif
#endif
/**
* Here's a bunch of methods that append varying types...
* @param various...
* @return this
*/
nsString& operator+=(const nsStr& aString){return Append(aString,(PRInt32)aString.mLength);}
nsString& operator+=(const nsString& aString){return Append(aString,(PRInt32)aString.mLength);}
nsString& operator+=(const char* aCString) {return Append(aCString);}
nsString& operator+=(const char aChar) {
return Append((PRUnichar) (unsigned char)aChar);
}
nsString& operator+=(const PRUnichar* aUCString) {return Append(aUCString);}
nsString& operator+=(const PRUnichar aChar){return Append(aChar);}
nsString& operator+=(const int anInt){return Append(anInt,10);}
#ifndef NEW_STRING_APIS
nsString& operator+=(const nsStr& aString){return Append(aString,(PRInt32)aString.mLength);}
nsString& operator+=(const nsString& aString){return Append(aString,(PRInt32)aString.mLength);}
nsString& operator+=(const PRUnichar* aUCString) {return Append(aUCString);}
#endif
/*
* Appends n characters from given string to this,
* This version computes the length of your given string

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

@ -38,7 +38,8 @@
#include <iterator>
// for |bidirectional_iterator_tag|
#include <algorithm.h>
#include <algorithm>
// for |min|, |copy|
/*

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

@ -321,7 +321,6 @@ class basic_nsAWritableString
}
};
NS_DEF_STRING_COMPARISONS(basic_nsAWritableString<CharT>)
template <class CharT>
typename basic_nsAWritableString<CharT>::WritingIterator

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

@ -24,7 +24,8 @@
#ifndef _nsCharTraits_h__
#define _nsCharTraits_h__
#include <eof.h>
#include <ctype.h>
// for |EOF|, |WEOF|
#include <string.h>
// for |memcpy|, et al
@ -330,6 +331,7 @@ struct nsCharTraits<char>
#endif
};
#if 0
NS_SPECIALIZE_TEMPLATE
struct nsCharTraits<wchar_t>
{
@ -454,5 +456,6 @@ struct nsCharTraits<wchar_t>
// static state_type get_state( pos_type );
#endif
};
#endif
#endif // !defined(_nsCharTraits_h__)

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

@ -38,7 +38,8 @@
#include <iterator>
// for |bidirectional_iterator_tag|
#include <algorithm.h>
#include <algorithm>
// for |min|, |copy|
/*

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

@ -321,7 +321,6 @@ class basic_nsAWritableString
}
};
NS_DEF_STRING_COMPARISONS(basic_nsAWritableString<CharT>)
template <class CharT>
typename basic_nsAWritableString<CharT>::WritingIterator

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

@ -24,7 +24,8 @@
#ifndef _nsCharTraits_h__
#define _nsCharTraits_h__
#include <eof.h>
#include <ctype.h>
// for |EOF|, |WEOF|
#include <string.h>
// for |memcpy|, et al
@ -330,6 +331,7 @@ struct nsCharTraits<char>
#endif
};
#if 0
NS_SPECIALIZE_TEMPLATE
struct nsCharTraits<wchar_t>
{
@ -454,5 +456,6 @@ struct nsCharTraits<wchar_t>
// static state_type get_state( pos_type );
#endif
};
#endif
#endif // !defined(_nsCharTraits_h__)

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

@ -898,6 +898,7 @@ nsCString& nsCString::Assign(char aChar) {
return Append(aChar);
}
#ifndef NEW_STRING_APIS
/**
* WARNING! THIS IS A VERY SPECIAL METHOD.
* This method "steals" the contents of aSource and hands it to aDest.
@ -916,7 +917,7 @@ nsCString& nsCString::operator=(nsSubsumeCStr& aSubsumeString) {
#endif // AIX
return *this;
}
#endif
/**
* append given string to this string

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

@ -420,28 +420,33 @@ public:
* @param aString: string to be added to this
* @return this
*/
nsCString& operator=(const nsCString& aString) {return Assign(aString);}
nsCString& operator=(const nsStr& aString) {return Assign(aString);}
nsCString& operator=(PRUnichar aChar) {return Assign(aChar);}
nsCString& operator=(char aChar) {return Assign(aChar);}
nsCString& operator=(const char* aCString) {return Assign(aCString);}
nsCString& operator=(const PRUnichar* aString) {return Assign(aString);}
#ifndef NEW_STRING_APIS
nsCString& operator=(const nsCString& aString) {return Assign(aString);}
nsCString& operator=(const nsStr& aString) {return Assign(aString);}
nsCString& operator=(const char* aCString) {return Assign(aCString);}
#ifdef AIX
nsCString& operator=(const nsSubsumeCStr& aSubsumeString); // AIX requires a const here
#else
nsCString& operator=(nsSubsumeCStr& aSubsumeString);
#endif
#endif
/**
* Here's a bunch of methods that append varying types...
* @param various...
* @return this
*/
nsCString& operator+=(const nsCString& aString){return Append(aString,(PRInt32)aString.mLength);}
nsCString& operator+=(const char* aCString) {return Append(aCString);}
nsCString& operator+=(const PRUnichar aChar){return Append(aChar);}
nsCString& operator+=(const char aChar){return Append(aChar);}
nsCString& operator+=(const int anInt){return Append(anInt,10);}
#ifndef NEW_STRING_APIS
nsCString& operator+=(const nsCString& aString){return Append(aString,(PRInt32)aString.mLength);}
nsCString& operator+=(const char* aCString) {return Append(aCString);}
#endif
/*
* Appends n characters from given string to this,

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

@ -1028,6 +1028,7 @@ nsString& nsString::Assign(PRUnichar aChar) {
return Append(aChar);
}
#ifndef NEW_STRING_APIS
/**
* WARNING! THIS IS A VERY SPECIAL METHOD.
* This method "steals" the contents of aSource and hands it to aDest.
@ -1046,7 +1047,7 @@ nsString& nsString::operator=(const nsSubsumeStr& aSubsumeString) {
#endif // AIX
return *this;
}
#endif
/**
* append given string to this string;

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

@ -235,6 +235,7 @@ public:
PRBool SetCharAt(PRUnichar aChar,PRUint32 anIndex);
#ifndef NEW_STRING_APIS
/**********************************************************************
String concatenation methods...
*********************************************************************/
@ -274,6 +275,7 @@ public:
* @return newly created string
*/
nsSubsumeStr operator+(PRUnichar aChar);
#endif
/**********************************************************************
Lexomorphic transforms...
@ -464,34 +466,38 @@ public:
* @param aString: string to be added to this
* @return this
*/
nsString& operator=(const nsString& aString) {return Assign(aString);}
nsString& operator=(const nsStr& aString) {return Assign(aString);}
nsString& operator=(char aChar) {return Assign(aChar);}
nsString& operator=(PRUnichar aChar) {return Assign(aChar);}
nsString& operator=(const char* aCString) {return Assign(aCString);}
#ifndef NEW_STRING_APIS
nsString& operator=(const nsString& aString) {return Assign(aString);}
nsString& operator=(const nsStr& aString) {return Assign(aString);}
nsString& operator=(const PRUnichar* aString) {return Assign(aString);}
#ifdef AIX
nsString& operator=(const nsSubsumeStr& aSubsumeString); // AIX requires a const here
#else
nsString& operator=(nsSubsumeStr& aSubsumeString);
#endif
#endif
/**
* Here's a bunch of methods that append varying types...
* @param various...
* @return this
*/
nsString& operator+=(const nsStr& aString){return Append(aString,(PRInt32)aString.mLength);}
nsString& operator+=(const nsString& aString){return Append(aString,(PRInt32)aString.mLength);}
nsString& operator+=(const char* aCString) {return Append(aCString);}
nsString& operator+=(const char aChar) {
return Append((PRUnichar) (unsigned char)aChar);
}
nsString& operator+=(const PRUnichar* aUCString) {return Append(aUCString);}
nsString& operator+=(const PRUnichar aChar){return Append(aChar);}
nsString& operator+=(const int anInt){return Append(anInt,10);}
#ifndef NEW_STRING_APIS
nsString& operator+=(const nsStr& aString){return Append(aString,(PRInt32)aString.mLength);}
nsString& operator+=(const nsString& aString){return Append(aString,(PRInt32)aString.mLength);}
nsString& operator+=(const PRUnichar* aUCString) {return Append(aUCString);}
#endif
/*
* Appends n characters from given string to this,
* This version computes the length of your given string

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

@ -898,6 +898,7 @@ nsCString& nsCString::Assign(char aChar) {
return Append(aChar);
}
#ifndef NEW_STRING_APIS
/**
* WARNING! THIS IS A VERY SPECIAL METHOD.
* This method "steals" the contents of aSource and hands it to aDest.
@ -916,7 +917,7 @@ nsCString& nsCString::operator=(nsSubsumeCStr& aSubsumeString) {
#endif // AIX
return *this;
}
#endif
/**
* append given string to this string

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

@ -420,28 +420,33 @@ public:
* @param aString: string to be added to this
* @return this
*/
nsCString& operator=(const nsCString& aString) {return Assign(aString);}
nsCString& operator=(const nsStr& aString) {return Assign(aString);}
nsCString& operator=(PRUnichar aChar) {return Assign(aChar);}
nsCString& operator=(char aChar) {return Assign(aChar);}
nsCString& operator=(const char* aCString) {return Assign(aCString);}
nsCString& operator=(const PRUnichar* aString) {return Assign(aString);}
#ifndef NEW_STRING_APIS
nsCString& operator=(const nsCString& aString) {return Assign(aString);}
nsCString& operator=(const nsStr& aString) {return Assign(aString);}
nsCString& operator=(const char* aCString) {return Assign(aCString);}
#ifdef AIX
nsCString& operator=(const nsSubsumeCStr& aSubsumeString); // AIX requires a const here
#else
nsCString& operator=(nsSubsumeCStr& aSubsumeString);
#endif
#endif
/**
* Here's a bunch of methods that append varying types...
* @param various...
* @return this
*/
nsCString& operator+=(const nsCString& aString){return Append(aString,(PRInt32)aString.mLength);}
nsCString& operator+=(const char* aCString) {return Append(aCString);}
nsCString& operator+=(const PRUnichar aChar){return Append(aChar);}
nsCString& operator+=(const char aChar){return Append(aChar);}
nsCString& operator+=(const int anInt){return Append(anInt,10);}
#ifndef NEW_STRING_APIS
nsCString& operator+=(const nsCString& aString){return Append(aString,(PRInt32)aString.mLength);}
nsCString& operator+=(const char* aCString) {return Append(aCString);}
#endif
/*
* Appends n characters from given string to this,

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

@ -1028,6 +1028,7 @@ nsString& nsString::Assign(PRUnichar aChar) {
return Append(aChar);
}
#ifndef NEW_STRING_APIS
/**
* WARNING! THIS IS A VERY SPECIAL METHOD.
* This method "steals" the contents of aSource and hands it to aDest.
@ -1046,7 +1047,7 @@ nsString& nsString::operator=(const nsSubsumeStr& aSubsumeString) {
#endif // AIX
return *this;
}
#endif
/**
* append given string to this string;

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

@ -235,6 +235,7 @@ public:
PRBool SetCharAt(PRUnichar aChar,PRUint32 anIndex);
#ifndef NEW_STRING_APIS
/**********************************************************************
String concatenation methods...
*********************************************************************/
@ -274,6 +275,7 @@ public:
* @return newly created string
*/
nsSubsumeStr operator+(PRUnichar aChar);
#endif
/**********************************************************************
Lexomorphic transforms...
@ -464,34 +466,38 @@ public:
* @param aString: string to be added to this
* @return this
*/
nsString& operator=(const nsString& aString) {return Assign(aString);}
nsString& operator=(const nsStr& aString) {return Assign(aString);}
nsString& operator=(char aChar) {return Assign(aChar);}
nsString& operator=(PRUnichar aChar) {return Assign(aChar);}
nsString& operator=(const char* aCString) {return Assign(aCString);}
#ifndef NEW_STRING_APIS
nsString& operator=(const nsString& aString) {return Assign(aString);}
nsString& operator=(const nsStr& aString) {return Assign(aString);}
nsString& operator=(const PRUnichar* aString) {return Assign(aString);}
#ifdef AIX
nsString& operator=(const nsSubsumeStr& aSubsumeString); // AIX requires a const here
#else
nsString& operator=(nsSubsumeStr& aSubsumeString);
#endif
#endif
/**
* Here's a bunch of methods that append varying types...
* @param various...
* @return this
*/
nsString& operator+=(const nsStr& aString){return Append(aString,(PRInt32)aString.mLength);}
nsString& operator+=(const nsString& aString){return Append(aString,(PRInt32)aString.mLength);}
nsString& operator+=(const char* aCString) {return Append(aCString);}
nsString& operator+=(const char aChar) {
return Append((PRUnichar) (unsigned char)aChar);
}
nsString& operator+=(const PRUnichar* aUCString) {return Append(aUCString);}
nsString& operator+=(const PRUnichar aChar){return Append(aChar);}
nsString& operator+=(const int anInt){return Append(anInt,10);}
#ifndef NEW_STRING_APIS
nsString& operator+=(const nsStr& aString){return Append(aString,(PRInt32)aString.mLength);}
nsString& operator+=(const nsString& aString){return Append(aString,(PRInt32)aString.mLength);}
nsString& operator+=(const PRUnichar* aUCString) {return Append(aUCString);}
#endif
/*
* Appends n characters from given string to this,
* This version computes the length of your given string

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

@ -38,7 +38,8 @@
#include <iterator>
// for |bidirectional_iterator_tag|
#include <algorithm.h>
#include <algorithm>
// for |min|, |copy|
/*

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

@ -321,7 +321,6 @@ class basic_nsAWritableString
}
};
NS_DEF_STRING_COMPARISONS(basic_nsAWritableString<CharT>)
template <class CharT>
typename basic_nsAWritableString<CharT>::WritingIterator

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

@ -24,7 +24,8 @@
#ifndef _nsCharTraits_h__
#define _nsCharTraits_h__
#include <eof.h>
#include <ctype.h>
// for |EOF|, |WEOF|
#include <string.h>
// for |memcpy|, et al
@ -330,6 +331,7 @@ struct nsCharTraits<char>
#endif
};
#if 0
NS_SPECIALIZE_TEMPLATE
struct nsCharTraits<wchar_t>
{
@ -454,5 +456,6 @@ struct nsCharTraits<wchar_t>
// static state_type get_state( pos_type );
#endif
};
#endif
#endif // !defined(_nsCharTraits_h__)