This commit is contained in:
cata%netscape.com 2000-04-21 22:50:35 +00:00
Родитель 347df49a60
Коммит e09f227680
2 изменённых файлов: 31 добавлений и 0 удалений

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

@ -45,6 +45,11 @@
* If these problems will hurt us, we'll switch to nsICharacterSet. The
* implementation of this interface is ment to be quite flexible.
*
* I provide here some nonscriptable "friendly methods". They accept nsString
* as params and assign the result to them, freeing the received memory result.
* These methods are prone to optimisation, in order to elliminate any
* allocation when it not strictly necessary.
*
* @created 21/Feb/2000
* @author Catalin Rotaru [CATA]
*/
@ -88,6 +93,12 @@ interface nsICharsetConverterManager2 : nsISupports
*/
wstring GetCharsetTitle([const] in nsIAtom charset);
/**
* Friendlier but non scriptable version.
*/
[noscript] void GetCharsetTitle2([const] in nsIAtom charset,
in nsStringPtr str);
/**
* Get some data about the given charset.
*/

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

@ -66,6 +66,8 @@ public:
/**
* The actual implementation of the nsICharsetConverterManager interface.
*
* XXX optimise the memory allocations in "scriptable" and "friendly" methods
*
* @created 15/Nov/1999
* @author Catalin Rotaru [CATA]
*/
@ -160,6 +162,7 @@ public:
NS_IMETHOD GetCharsetAtom(const PRUnichar * aCharset, nsIAtom ** aResult);
NS_IMETHOD GetCharsetTitle(const nsIAtom * aCharset, PRUnichar ** aResult);
NS_IMETHOD GetCharsetTitle2(const nsIAtom * aCharset, nsString * aResult);
NS_IMETHOD GetCharsetData(const nsIAtom * aCharset, const PRUnichar * aProp,
PRUnichar ** aResult);
NS_IMETHOD GetCharsetData2(const nsIAtom * aCharset, const PRUnichar * aProp,
@ -1054,6 +1057,23 @@ NS_IMETHODIMP nsCharsetConverterManager::GetCharsetTitle(
return res;
}
NS_IMETHODIMP nsCharsetConverterManager::GetCharsetTitle2(
const nsIAtom * aCharset,
nsString * aResult)
{
if (aResult == NULL) return NS_ERROR_NULL_POINTER;
nsresult res = NS_OK;
PRUnichar * title;
res = GetCharsetTitle(aCharset, &title);
if (NS_FAILED(res)) return res;
aResult->Assign(title);
PR_Free(title);
return res;
}
NS_IMETHODIMP nsCharsetConverterManager::GetCharsetData(
const nsIAtom * aCharset,
const PRUnichar * aProp,