Part of IDL migration, addding a new member function.
This commit is contained in:
Родитель
85f9ed0f89
Коммит
bf7e3ce4ff
|
@ -37,6 +37,8 @@ public:
|
|||
|
||||
NS_IMETHOD GetCategory(const nsString* category, nsString* result) = 0;
|
||||
|
||||
/* void GetCategory (in string category, out string result); */
|
||||
NS_IMETHOD GetCategory(const char *category, char **result) = 0;
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -91,6 +91,34 @@ nsLocale::GetCategory(const nsString* category,nsString* result)
|
|||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsLocale::GetCategory(const char *category, char **result)
|
||||
{
|
||||
nsAutoString categoryIn(category);
|
||||
nsString resultOut;
|
||||
nsresult res;
|
||||
|
||||
res = GetCategory(&categoryIn, &resultOut);
|
||||
|
||||
if (NS_SUCCEEDED(res)) {
|
||||
// Convert result to C string.
|
||||
char *tmp = resultOut.ToNewCString();
|
||||
if (NULL == tmp) {
|
||||
res = NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
else {
|
||||
*result = PL_strdup(tmp);
|
||||
if (NULL == *result) {
|
||||
res = NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
delete [] tmp;
|
||||
}
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
PLHashNumber
|
||||
nsLocale::Hash_HashFunction(const void* key)
|
||||
{
|
||||
|
|
|
@ -35,6 +35,8 @@ public:
|
|||
|
||||
NS_IMETHOD GetCategory(const nsString* category, nsString* result);
|
||||
|
||||
NS_IMETHOD GetCategory(const char *category, char **result);
|
||||
|
||||
private:
|
||||
|
||||
static PLHashNumber Hash_HashFunction(const void* key);
|
||||
|
|
Загрузка…
Ссылка в новой задаче