Back to index

lightning-sunbird  0.9+nobinonly
Classes | Defines | Functions | Variables
nsHTMLEntities.cpp File Reference
#include "nsHTMLEntities.h"
#include "nsString.h"
#include "nsCRT.h"
#include "prtypes.h"
#include "pldhash.h"
#include "nsHTMLEntityList.h"

Go to the source code of this file.

Classes

struct  EntityNode
struct  EntityNodeEntry

Defines

#define HTML_ENTITY(_name, _value)   { #_name, _value },
#define NS_HTML_ENTITY_COUNT   ((PRInt32)NS_ARRAY_LENGTH(gEntityArray))

Functions

 getStringKey (PLDHashTable *, PLDHashEntryHdr *aHdr)
 getUnicodeKey (PLDHashTable *, PLDHashEntryHdr *aHdr)
 matchNodeString (PLDHashTable *, const PLDHashEntryHdr *aHdr, const void *key)
 matchNodeUnicode (PLDHashTable *, const PLDHashEntryHdr *aHdr, const void *key)
 hashUnicodeValue (PLDHashTable *, const void *key)

Variables

static const PLDHashTableOps EntityToUnicodeOps
static const PLDHashTableOps UnicodeToEntityOps
static PLDHashTable gEntityToUnicode = { 0 }
static PLDHashTable gUnicodeToEntity = { 0 }
static nsrefcnt gTableRefCnt = 0
static const EntityNode gEntityArray []

Class Documentation

struct EntityNode

Definition at line 47 of file nsHTMLEntities.cpp.

Class Members
const char * mStr
PRInt32 mUnicode
PRUint32 mUnicode

Define Documentation

#define HTML_ENTITY (   _name,
  _value 
)    { #_name, _value },

Definition at line 125 of file nsHTMLEntities.cpp.

Definition at line 131 of file nsHTMLEntities.cpp.


Function Documentation

Definition at line 58 of file nsHTMLEntities.cpp.

{
  const EntityNodeEntry* entry = NS_STATIC_CAST(const EntityNodeEntry*, aHdr);
  return entry->node->mStr;
}

Definition at line 65 of file nsHTMLEntities.cpp.

{
  const EntityNodeEntry* entry = NS_STATIC_CAST(const EntityNodeEntry*, aHdr);
  return NS_INT32_TO_PTR(entry->node->mUnicode);
}
hashUnicodeValue ( PLDHashTable ,
const void key 
)

Definition at line 90 of file nsHTMLEntities.cpp.

{
  // key is actually the unicode value
  return PLDHashNumber(NS_PTR_TO_INT32(key));
  }

Definition at line 72 of file nsHTMLEntities.cpp.

{
  const EntityNodeEntry* entry = NS_STATIC_CAST(const EntityNodeEntry*, aHdr);
  const char* str = NS_STATIC_CAST(const char*, key);
  return (nsCRT::strcmp(entry->node->mStr, str) == 0);
}

Definition at line 81 of file nsHTMLEntities.cpp.

{
  const EntityNodeEntry* entry = NS_STATIC_CAST(const EntityNodeEntry*, aHdr);
  const PRInt32 ucode = NS_PTR_TO_INT32(key);
  return (entry->node->mUnicode == ucode);
}

Variable Documentation

Definition at line 126 of file nsHTMLEntities.cpp.

PLDHashTable gEntityToUnicode = { 0 } [static]

Definition at line 121 of file nsHTMLEntities.cpp.

nsrefcnt gTableRefCnt = 0 [static]

Definition at line 123 of file nsHTMLEntities.cpp.

PLDHashTable gUnicodeToEntity = { 0 } [static]

Definition at line 122 of file nsHTMLEntities.cpp.