2001-09-26 00:40:45 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 11:12:37 +00:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2002-09-23 16:36:51 +00:00
|
|
|
#ifndef nsHTMLEntities_h___
|
1998-08-10 21:07:40 +00:00
|
|
|
#define nsHTMLEntities_h___
|
1999-07-18 00:12:32 +00:00
|
|
|
|
2000-03-12 09:14:14 +00:00
|
|
|
#include "nsString.h"
|
1999-07-18 00:12:32 +00:00
|
|
|
|
2001-10-23 01:37:21 +00:00
|
|
|
class nsHTMLEntities {
|
1999-07-18 00:12:32 +00:00
|
|
|
public:
|
|
|
|
|
2003-11-05 22:11:55 +00:00
|
|
|
static nsresult AddRefTable(void);
|
1999-07-18 00:12:32 +00:00
|
|
|
static void ReleaseTable(void);
|
|
|
|
|
1998-08-10 21:07:40 +00:00
|
|
|
/**
|
|
|
|
* Translate an entity string into it's unicode value. This call
|
|
|
|
* returns -1 if the entity cannot be mapped. Note that the string
|
|
|
|
* passed in must NOT have the leading "&" nor the trailing ";"
|
|
|
|
* in it.
|
|
|
|
*/
|
2012-08-22 15:56:38 +00:00
|
|
|
static int32_t EntityToUnicode(const nsAString& aEntity);
|
|
|
|
static int32_t EntityToUnicode(const nsCString& aEntity);
|
1998-08-10 21:07:40 +00:00
|
|
|
|
1999-03-15 05:08:36 +00:00
|
|
|
/**
|
2002-06-11 23:37:34 +00:00
|
|
|
* Translate a unicode value into an entity string. This call
|
2001-06-05 00:39:38 +00:00
|
|
|
* returns null if the entity cannot be mapped.
|
1999-07-18 00:12:32 +00:00
|
|
|
* Note that the string returned DOES NOT have the leading "&" nor
|
|
|
|
* the trailing ";" in it.
|
1999-03-15 05:08:36 +00:00
|
|
|
*/
|
2012-08-22 15:56:38 +00:00
|
|
|
static const char* UnicodeToEntity(int32_t aUnicode);
|
1999-07-18 00:12:32 +00:00
|
|
|
};
|
1999-03-15 05:08:36 +00:00
|
|
|
|
|
|
|
|
1999-07-18 00:12:32 +00:00
|
|
|
#endif /* nsHTMLEntities_h___ */
|