mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-26 14:22:01 +00:00
added some #ifdef logic to allow me to turn NEW_STRING_APIS off, so I can continue to profile for bloat; added an implementation specific |operator+()| to resolve ambiguity with promises on some platforms; added a conversion operator (against my best judgement) to |NS_ConvertASCIItoUCS2| to support the construction of literal strings induced by the bad case of the new macro. I could conditionally define this is the opposite direction.
This commit is contained in:
parent
7f51a498b1
commit
84e47f2424
@ -43,6 +43,11 @@
|
||||
#define NEW_STRING_APIS 1
|
||||
#endif //NEW_STRING_APIS
|
||||
|
||||
// Need this to enable comparison profiling for a while
|
||||
#ifdef OLD_STRING_APIS
|
||||
#undef NEW_STRING_APIS
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef _nsString_
|
||||
#define _nsString_
|
||||
@ -892,6 +897,15 @@ NS_DEF_STRING_COMPARISON_OPERATORS(nsString, PRUnichar)
|
||||
NS_DEF_DERIVED_STRING_OPERATOR_PLUS(nsString, PRUnichar)
|
||||
#endif
|
||||
|
||||
#ifdef NEW_STRING_APIS
|
||||
inline
|
||||
nsPromiseConcatenation<PRUnichar>
|
||||
operator+( const nsPromiseConcatenation<PRUnichar>& lhs, const nsString& rhs )
|
||||
{
|
||||
return nsPromiseConcatenation<PRUnichar>(lhs, rhs);
|
||||
}
|
||||
#endif
|
||||
|
||||
extern NS_COM int fputs(const nsString& aString, FILE* out);
|
||||
//ostream& operator<<(ostream& aStream,const nsString& aString);
|
||||
//virtual void DebugDump(ostream& aStream) const;
|
||||
@ -975,6 +989,13 @@ class NS_COM NS_ConvertASCIItoUCS2
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef NEW_STRING_APIS
|
||||
operator nsLiteralString() const
|
||||
{
|
||||
return nsLiteralString(mUStr, mLength);
|
||||
}
|
||||
#endif
|
||||
|
||||
private:
|
||||
// NOT TO BE IMPLEMENTED
|
||||
NS_ConvertASCIItoUCS2( PRUnichar );
|
||||
|
@ -43,6 +43,11 @@
|
||||
#define NEW_STRING_APIS 1
|
||||
#endif //NEW_STRING_APIS
|
||||
|
||||
// Need this to enable comparison profiling for a while
|
||||
#ifdef OLD_STRING_APIS
|
||||
#undef NEW_STRING_APIS
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef _nsString_
|
||||
#define _nsString_
|
||||
@ -892,6 +897,15 @@ NS_DEF_STRING_COMPARISON_OPERATORS(nsString, PRUnichar)
|
||||
NS_DEF_DERIVED_STRING_OPERATOR_PLUS(nsString, PRUnichar)
|
||||
#endif
|
||||
|
||||
#ifdef NEW_STRING_APIS
|
||||
inline
|
||||
nsPromiseConcatenation<PRUnichar>
|
||||
operator+( const nsPromiseConcatenation<PRUnichar>& lhs, const nsString& rhs )
|
||||
{
|
||||
return nsPromiseConcatenation<PRUnichar>(lhs, rhs);
|
||||
}
|
||||
#endif
|
||||
|
||||
extern NS_COM int fputs(const nsString& aString, FILE* out);
|
||||
//ostream& operator<<(ostream& aStream,const nsString& aString);
|
||||
//virtual void DebugDump(ostream& aStream) const;
|
||||
@ -975,6 +989,13 @@ class NS_COM NS_ConvertASCIItoUCS2
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef NEW_STRING_APIS
|
||||
operator nsLiteralString() const
|
||||
{
|
||||
return nsLiteralString(mUStr, mLength);
|
||||
}
|
||||
#endif
|
||||
|
||||
private:
|
||||
// NOT TO BE IMPLEMENTED
|
||||
NS_ConvertASCIItoUCS2( PRUnichar );
|
||||
|
@ -43,6 +43,11 @@
|
||||
#define NEW_STRING_APIS 1
|
||||
#endif //NEW_STRING_APIS
|
||||
|
||||
// Need this to enable comparison profiling for a while
|
||||
#ifdef OLD_STRING_APIS
|
||||
#undef NEW_STRING_APIS
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef _nsString_
|
||||
#define _nsString_
|
||||
@ -892,6 +897,15 @@ NS_DEF_STRING_COMPARISON_OPERATORS(nsString, PRUnichar)
|
||||
NS_DEF_DERIVED_STRING_OPERATOR_PLUS(nsString, PRUnichar)
|
||||
#endif
|
||||
|
||||
#ifdef NEW_STRING_APIS
|
||||
inline
|
||||
nsPromiseConcatenation<PRUnichar>
|
||||
operator+( const nsPromiseConcatenation<PRUnichar>& lhs, const nsString& rhs )
|
||||
{
|
||||
return nsPromiseConcatenation<PRUnichar>(lhs, rhs);
|
||||
}
|
||||
#endif
|
||||
|
||||
extern NS_COM int fputs(const nsString& aString, FILE* out);
|
||||
//ostream& operator<<(ostream& aStream,const nsString& aString);
|
||||
//virtual void DebugDump(ostream& aStream) const;
|
||||
@ -975,6 +989,13 @@ class NS_COM NS_ConvertASCIItoUCS2
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef NEW_STRING_APIS
|
||||
operator nsLiteralString() const
|
||||
{
|
||||
return nsLiteralString(mUStr, mLength);
|
||||
}
|
||||
#endif
|
||||
|
||||
private:
|
||||
// NOT TO BE IMPLEMENTED
|
||||
NS_ConvertASCIItoUCS2( PRUnichar );
|
||||
|
Loading…
Reference in New Issue
Block a user