Added private unimplemented signatures of |...WithConversion| to prevent accidents where I should have used the non-converting form. Removed |AppendWithConversion|s that stood in for |AppendInt| and |AppendFloat|.

This commit is contained in:
scc%netscape.com 2000-04-17 11:06:41 +00:00
Родитель f5c8f79cb9
Коммит 4753a77d13
6 изменённых файлов: 48 добавлений и 18 удалений

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

@ -474,9 +474,6 @@ public:
nsCString& Append(PRInt32 aInteger,PRInt32 aRadix=10) {AppendInt(aInteger,aRadix); return *this;}
nsCString& Append(float aFloat) {AppendFloat(aFloat); return *this;}
void AppendWithConversion(PRInt32 aInteger, PRInt32 aRadix=10) {AppendInt(aInteger,aRadix);}
void AppendWithConversion(float aFloat) {AppendFloat(aFloat);}
/**
* Here's a bunch of methods that append varying types...
* @param various...
@ -775,6 +772,13 @@ public:
static void Recycle(nsCString* aString);
static nsCString* CreateString(void);
private:
// NOT TO BE IMPLEMENTED
// these signatures help clients not accidentally call the wrong thing helped by C++ automatic integral promotion
void AssignWithConversion( char );
void AssignWithConversion( const char*, PRInt32=-1 );
void AppendWithConversion( char );
void InsertWithConversion( char, PRUint32 );
};
#if 0//def NEW_STRING_APIS

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

@ -510,9 +510,6 @@ public:
nsString& Append(const PRUnichar* aString,PRInt32 aCount=-1);
nsString& Append(PRUnichar aChar);
void AppendWithConversion( PRInt32 i, PRInt32 radix=10 ) { AppendInt(i, radix); }
void AppendWithConversion( float f ) { AppendFloat(f); }
nsString& Append(const char* aString,PRInt32 aCount=-1) { AppendWithConversion(aString,aCount); return *this; }
nsString& Append(char aChar) { AppendWithConversion(aChar); return *this; }
nsString& Append(PRInt32 aInteger,PRInt32 aRadix=10) { AppendInt(aInteger,aRadix); return *this; }
@ -714,6 +711,7 @@ public:
* @param aCount tells us how many chars to compare
* @return -1,0,1
*/
PRInt32 CompareWithConversion(const char* aString,PRBool aIgnoreCase=PR_FALSE,PRInt32 aCount=-1) const;
PRInt32 CompareWithConversion(const nsString& aString,PRBool aIgnoreCase=PR_FALSE,PRInt32 aCount=-1) const;
PRInt32 CompareWithConversion(const PRUnichar* aString,PRBool aIgnoreCase=PR_FALSE,PRInt32 aCount=-1) const;
@ -869,6 +867,14 @@ public:
static void Recycle(nsString* aString);
static nsString* CreateString(void);
private:
// NOT TO BE IMPLEMENTED
// these signatures help clients not accidentally call the wrong thing helped by C++ automatic integral promotion
void AssignWithConversion( PRUnichar );
void AssignWithConversion( const PRUnichar*, PRInt32=-1 );
void AppendWithConversion( PRUnichar );
void AppendWithConversion( const PRUnichar*, PRInt32=-1 );
void InsertWithConversion( const PRUnichar*, PRUint32, PRInt32=-1 );
};
#if 0//def NEW_STRING_APIS

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

@ -474,9 +474,6 @@ public:
nsCString& Append(PRInt32 aInteger,PRInt32 aRadix=10) {AppendInt(aInteger,aRadix); return *this;}
nsCString& Append(float aFloat) {AppendFloat(aFloat); return *this;}
void AppendWithConversion(PRInt32 aInteger, PRInt32 aRadix=10) {AppendInt(aInteger,aRadix);}
void AppendWithConversion(float aFloat) {AppendFloat(aFloat);}
/**
* Here's a bunch of methods that append varying types...
* @param various...
@ -775,6 +772,13 @@ public:
static void Recycle(nsCString* aString);
static nsCString* CreateString(void);
private:
// NOT TO BE IMPLEMENTED
// these signatures help clients not accidentally call the wrong thing helped by C++ automatic integral promotion
void AssignWithConversion( char );
void AssignWithConversion( const char*, PRInt32=-1 );
void AppendWithConversion( char );
void InsertWithConversion( char, PRUint32 );
};
#if 0//def NEW_STRING_APIS

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

@ -510,9 +510,6 @@ public:
nsString& Append(const PRUnichar* aString,PRInt32 aCount=-1);
nsString& Append(PRUnichar aChar);
void AppendWithConversion( PRInt32 i, PRInt32 radix=10 ) { AppendInt(i, radix); }
void AppendWithConversion( float f ) { AppendFloat(f); }
nsString& Append(const char* aString,PRInt32 aCount=-1) { AppendWithConversion(aString,aCount); return *this; }
nsString& Append(char aChar) { AppendWithConversion(aChar); return *this; }
nsString& Append(PRInt32 aInteger,PRInt32 aRadix=10) { AppendInt(aInteger,aRadix); return *this; }
@ -714,6 +711,7 @@ public:
* @param aCount tells us how many chars to compare
* @return -1,0,1
*/
PRInt32 CompareWithConversion(const char* aString,PRBool aIgnoreCase=PR_FALSE,PRInt32 aCount=-1) const;
PRInt32 CompareWithConversion(const nsString& aString,PRBool aIgnoreCase=PR_FALSE,PRInt32 aCount=-1) const;
PRInt32 CompareWithConversion(const PRUnichar* aString,PRBool aIgnoreCase=PR_FALSE,PRInt32 aCount=-1) const;
@ -869,6 +867,14 @@ public:
static void Recycle(nsString* aString);
static nsString* CreateString(void);
private:
// NOT TO BE IMPLEMENTED
// these signatures help clients not accidentally call the wrong thing helped by C++ automatic integral promotion
void AssignWithConversion( PRUnichar );
void AssignWithConversion( const PRUnichar*, PRInt32=-1 );
void AppendWithConversion( PRUnichar );
void AppendWithConversion( const PRUnichar*, PRInt32=-1 );
void InsertWithConversion( const PRUnichar*, PRUint32, PRInt32=-1 );
};
#if 0//def NEW_STRING_APIS

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

@ -474,9 +474,6 @@ public:
nsCString& Append(PRInt32 aInteger,PRInt32 aRadix=10) {AppendInt(aInteger,aRadix); return *this;}
nsCString& Append(float aFloat) {AppendFloat(aFloat); return *this;}
void AppendWithConversion(PRInt32 aInteger, PRInt32 aRadix=10) {AppendInt(aInteger,aRadix);}
void AppendWithConversion(float aFloat) {AppendFloat(aFloat);}
/**
* Here's a bunch of methods that append varying types...
* @param various...
@ -775,6 +772,13 @@ public:
static void Recycle(nsCString* aString);
static nsCString* CreateString(void);
private:
// NOT TO BE IMPLEMENTED
// these signatures help clients not accidentally call the wrong thing helped by C++ automatic integral promotion
void AssignWithConversion( char );
void AssignWithConversion( const char*, PRInt32=-1 );
void AppendWithConversion( char );
void InsertWithConversion( char, PRUint32 );
};
#if 0//def NEW_STRING_APIS

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

@ -510,9 +510,6 @@ public:
nsString& Append(const PRUnichar* aString,PRInt32 aCount=-1);
nsString& Append(PRUnichar aChar);
void AppendWithConversion( PRInt32 i, PRInt32 radix=10 ) { AppendInt(i, radix); }
void AppendWithConversion( float f ) { AppendFloat(f); }
nsString& Append(const char* aString,PRInt32 aCount=-1) { AppendWithConversion(aString,aCount); return *this; }
nsString& Append(char aChar) { AppendWithConversion(aChar); return *this; }
nsString& Append(PRInt32 aInteger,PRInt32 aRadix=10) { AppendInt(aInteger,aRadix); return *this; }
@ -714,6 +711,7 @@ public:
* @param aCount tells us how many chars to compare
* @return -1,0,1
*/
PRInt32 CompareWithConversion(const char* aString,PRBool aIgnoreCase=PR_FALSE,PRInt32 aCount=-1) const;
PRInt32 CompareWithConversion(const nsString& aString,PRBool aIgnoreCase=PR_FALSE,PRInt32 aCount=-1) const;
PRInt32 CompareWithConversion(const PRUnichar* aString,PRBool aIgnoreCase=PR_FALSE,PRInt32 aCount=-1) const;
@ -869,6 +867,14 @@ public:
static void Recycle(nsString* aString);
static nsString* CreateString(void);
private:
// NOT TO BE IMPLEMENTED
// these signatures help clients not accidentally call the wrong thing helped by C++ automatic integral promotion
void AssignWithConversion( PRUnichar );
void AssignWithConversion( const PRUnichar*, PRInt32=-1 );
void AppendWithConversion( PRUnichar );
void AppendWithConversion( const PRUnichar*, PRInt32=-1 );
void InsertWithConversion( const PRUnichar*, PRUint32, PRInt32=-1 );
};
#if 0//def NEW_STRING_APIS