Bug 332135 - atomservice should provide utf8 accessors, r=darin

This commit is contained in:
benjamin%smedbergs.us 2006-03-30 15:22:42 +00:00
parent 7cd9ba54a0
commit 3f0439ed89
2 changed files with 31 additions and 1 deletions

View File

@ -21,6 +21,7 @@
*
* Contributor(s):
* Alec Flett <alecf@netscape.com>
* Benjamin Smedberg <benjamin@smedbergs.us>
*
* Alternatively, the contents of this file may be used under the terms of
* either of the GNU General Public License Version 2 or later (the "GPL"),
@ -65,3 +66,25 @@ nsAtomService::GetPermanentAtom(const PRUnichar *aString, nsIAtom ** aResult)
return NS_OK;
}
NS_IMETHODIMP
nsAtomService::GetAtomUTF8(const char *aValue, nsIAtom* *aResult)
{
*aResult = NS_NewAtom(aValue);
if (!*aResult)
return NS_ERROR_OUT_OF_MEMORY;
return NS_OK;
}
NS_IMETHODIMP
nsAtomService::GetPermanentAtomUTF8(const char *aValue, nsIAtom* *aResult)
{
*aResult = NS_NewPermanentAtom(aValue);
if (!*aResult)
return NS_ERROR_OUT_OF_MEMORY;
return NS_OK;
}

View File

@ -21,6 +21,7 @@
*
* Contributor(s):
* Alec Flett <alecf@netscape.com>
* Benjamin Smedberg <benjamin@smedbergs.us>
*
* Alternatively, the contents of this file may be used under the terms of
* either of the GNU General Public License Version 2 or later (the "GPL"),
@ -56,7 +57,7 @@
* pointer identity.
*/
[scriptable, uuid(e5d0d92b-ea45-4622-ab48-302baf2094ee)]
[scriptable, uuid(8c0e6018-6a06-47f5-bfa1-2e051705c9de)]
interface nsIAtomService : nsISupports {
/**
@ -70,4 +71,10 @@ interface nsIAtomService : nsISupports {
* the XPCOM library. See nsIAtom.idl.
*/
nsIAtom getPermanentAtom(in wstring value);
/**
* Get an atom with a utf8 string.
*/
[noscript] nsIAtom getAtomUTF8(in string value);
[noscript] nsIAtom getPermanentAtomUTF8(in string value);
};