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 4609d0678c
commit ad48b0d1ac
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;
}