parser/htmlparser/src/nsHTMLEntities.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/parser/htmlparser/src/nsHTMLEntities.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,35 @@
     1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.8 +#ifndef nsHTMLEntities_h___
     1.9 +#define nsHTMLEntities_h___
    1.10 +
    1.11 +#include "nsString.h"
    1.12 +
    1.13 +class nsHTMLEntities {
    1.14 +public:
    1.15 +
    1.16 +  static nsresult AddRefTable(void);
    1.17 +  static void ReleaseTable(void);
    1.18 +
    1.19 +/**
    1.20 + * Translate an entity string into it's unicode value. This call
    1.21 + * returns -1 if the entity cannot be mapped. Note that the string
    1.22 + * passed in must NOT have the leading "&" nor the trailing ";"
    1.23 + * in it.
    1.24 + */
    1.25 +  static int32_t EntityToUnicode(const nsAString& aEntity);
    1.26 +  static int32_t EntityToUnicode(const nsCString& aEntity);
    1.27 +
    1.28 +/**
    1.29 + * Translate a unicode value into an entity string. This call
    1.30 + * returns null if the entity cannot be mapped. 
    1.31 + * Note that the string returned DOES NOT have the leading "&" nor 
    1.32 + * the trailing ";" in it.
    1.33 + */
    1.34 +  static const char* UnicodeToEntity(int32_t aUnicode);
    1.35 +};
    1.36 +
    1.37 +
    1.38 +#endif /* nsHTMLEntities_h___ */

mercurial