michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: #ifndef nsHTMLEntities_h___ michael@0: #define nsHTMLEntities_h___ michael@0: michael@0: #include "nsString.h" michael@0: michael@0: class nsHTMLEntities { michael@0: public: michael@0: michael@0: static nsresult AddRefTable(void); michael@0: static void ReleaseTable(void); michael@0: michael@0: /** michael@0: * Translate an entity string into it's unicode value. This call michael@0: * returns -1 if the entity cannot be mapped. Note that the string michael@0: * passed in must NOT have the leading "&" nor the trailing ";" michael@0: * in it. michael@0: */ michael@0: static int32_t EntityToUnicode(const nsAString& aEntity); michael@0: static int32_t EntityToUnicode(const nsCString& aEntity); michael@0: michael@0: /** michael@0: * Translate a unicode value into an entity string. This call michael@0: * returns null if the entity cannot be mapped. michael@0: * Note that the string returned DOES NOT have the leading "&" nor michael@0: * the trailing ";" in it. michael@0: */ michael@0: static const char* UnicodeToEntity(int32_t aUnicode); michael@0: }; michael@0: michael@0: michael@0: #endif /* nsHTMLEntities_h___ */