зеркало из https://github.com/mozilla/gecko-dev.git
updating string example/test to include an example of [shared]
This commit is contained in:
Родитель
c59b3c8f0b
Коммит
d0965e0a9d
|
@ -108,4 +108,5 @@ interface nsIXPCTestNoisy : nsISupports {
|
||||||
interface nsIXPCTestString : nsISupports {
|
interface nsIXPCTestString : nsISupports {
|
||||||
string GetStringA();
|
string GetStringA();
|
||||||
void GetStringB(out string s);
|
void GetStringB(out string s);
|
||||||
|
void GetStringC([shared,retval] out string s);
|
||||||
};
|
};
|
||||||
|
|
|
@ -31,6 +31,9 @@ public:
|
||||||
/* void GetStringB (out string s); */
|
/* void GetStringB (out string s); */
|
||||||
NS_IMETHOD GetStringB(char **s);
|
NS_IMETHOD GetStringB(char **s);
|
||||||
|
|
||||||
|
/* void GetStringC ([shared, retval] out string s); */
|
||||||
|
NS_IMETHOD GetStringC(const char **s);
|
||||||
|
|
||||||
xpcstringtest();
|
xpcstringtest();
|
||||||
virtual ~xpcstringtest();
|
virtual ~xpcstringtest();
|
||||||
};
|
};
|
||||||
|
@ -77,6 +80,18 @@ xpcstringtest::GetStringB(char **s)
|
||||||
return *s ? NS_OK : NS_ERROR_OUT_OF_MEMORY;
|
return *s ? NS_OK : NS_ERROR_OUT_OF_MEMORY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* void GetStringC ([shared, retval] out string s); */
|
||||||
|
NS_IMETHODIMP
|
||||||
|
xpcstringtest::GetStringC(const char **s)
|
||||||
|
{
|
||||||
|
static const char myResult[] = "result of xpcstringtest::GetStringC";
|
||||||
|
if(!s)
|
||||||
|
return NS_ERROR_NULL_POINTER;
|
||||||
|
*s = myResult;
|
||||||
|
return NS_OK;
|
||||||
|
}
|
||||||
|
|
||||||
/***************************************************************************/
|
/***************************************************************************/
|
||||||
|
|
||||||
// static
|
// static
|
||||||
|
|
Загрузка…
Ссылка в новой задаче