Bug 100476: Convert uses of member functions ToNewUnicode, ToNewCString and ToNewUTF8String to their global versions and remove support from nsCString and nsString. r=dbaron, rs=scc
git-svn-id: svn://10.0.0.236/trunk@104212 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -260,22 +260,6 @@ public:
|
||||
*/
|
||||
nsCString* ToNewString() const;
|
||||
|
||||
/**
|
||||
* Creates an ISOLatin1 clone of this string
|
||||
* Note that calls to this method should be matched with calls to
|
||||
* |nsMemory::Free|.
|
||||
* @return ptr to new isolatin1 string
|
||||
*/
|
||||
char* ToNewCString() const;
|
||||
|
||||
/**
|
||||
* Creates a unicode clone of this string
|
||||
* Note that calls to this method should be matched with calls to
|
||||
* |nsMemory::Free|.
|
||||
* @return ptr to new unicode string
|
||||
*/
|
||||
PRUnichar* ToNewUnicode() const;
|
||||
|
||||
/**
|
||||
* Copies data from internal buffer onto given char* buffer
|
||||
* NOTE: This only copies as many chars as will fit in given buffer (clips)
|
||||
@@ -550,6 +534,34 @@ class NS_COM NS_ConvertUCS2toUTF8
|
||||
operator const char*() const; // use |get()|
|
||||
};
|
||||
|
||||
/**
|
||||
* A helper class that converts a UCS2 string to ASCII in a lossy manner
|
||||
*/
|
||||
class NS_COM NS_LossyConvertUCS2toASCII
|
||||
: public nsCAutoString
|
||||
/*
|
||||
...
|
||||
*/
|
||||
{
|
||||
public:
|
||||
explicit
|
||||
NS_LossyConvertUCS2toASCII( const PRUnichar* aString )
|
||||
{
|
||||
AppendWithConversion( aString, ~PRUint32(0) /* MAXINT */);
|
||||
}
|
||||
|
||||
NS_LossyConvertUCS2toASCII( const PRUnichar* aString, PRUint32 aLength )
|
||||
{
|
||||
AppendWithConversion( aString, aLength );
|
||||
}
|
||||
|
||||
explicit NS_LossyConvertUCS2toASCII( const nsAString& aString );
|
||||
|
||||
private:
|
||||
// NOT TO BE IMPLEMENTED
|
||||
NS_LossyConvertUCS2toASCII( char );
|
||||
operator const char*() const; // use |get()|
|
||||
};
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user