Back to index

lightning-sunbird  0.9+nobinonly
Static Public Member Functions
nsCSSKeywords Class Reference

#include <nsCSSKeywords.h>

List of all members.

Static Public Member Functions

static void AddRefTable (void)
static void ReleaseTable (void)
static nsCSSKeyword LookupKeyword (const nsACString &aKeyword)
static nsCSSKeyword LookupKeyword (const nsAString &aKeyword)
static const nsAFlatCStringGetStringValue (nsCSSKeyword aKeyword)

Detailed Description

Definition at line 58 of file nsCSSKeywords.h.


Member Function Documentation

Definition at line 57 of file nsCSSKeywords.cpp.

{
  if (0 == gTableRefCount++) {
    NS_ASSERTION(!gKeywordTable, "pre existing array!");
    gKeywordTable = new nsStaticCaseInsensitiveNameTable();
    if (gKeywordTable) {
#ifdef DEBUG
    {
      // let's verify the table...
      PRInt32 index = 0;
      for (; index < eCSSKeyword_COUNT && kCSSRawKeywords[index]; ++index) {
        nsCAutoString temp1(kCSSRawKeywords[index]);
        nsCAutoString temp2(kCSSRawKeywords[index]);
        ToLowerCase(temp1);
        NS_ASSERTION(temp1.Equals(temp2), "upper case char in table");
        NS_ASSERTION(-1 == temp1.FindChar('_'), "underscore char in table");
      }
      NS_ASSERTION(index == eCSSKeyword_COUNT, "kCSSRawKeywords and eCSSKeyword_COUNT are out of sync");
    }
#endif      
      gKeywordTable->Init(kCSSRawKeywords, eCSSKeyword_COUNT); 
    }
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 114 of file nsCSSKeywords.cpp.

{
  NS_ASSERTION(gKeywordTable, "no lookup table, needs addref");
  if (gKeywordTable) {
    return gKeywordTable->GetStringValue(PRInt32(aKeyword));
  } else {
    static nsDependentCString kNullStr("");
    return kNullStr;
  }
}
nsCSSKeyword nsCSSKeywords::LookupKeyword ( const nsACString &  aKeyword) [static]

Definition at line 94 of file nsCSSKeywords.cpp.

{
  NS_ASSERTION(gKeywordTable, "no lookup table, needs addref");
  if (gKeywordTable) {
    return nsCSSKeyword(gKeywordTable->Lookup(aKeyword));
  }  
  return eCSSKeyword_UNKNOWN;
}

Here is the caller graph for this function:

nsCSSKeyword nsCSSKeywords::LookupKeyword ( const nsAString &  aKeyword) [static]

Definition at line 104 of file nsCSSKeywords.cpp.

{
  NS_ASSERTION(gKeywordTable, "no lookup table, needs addref");
  if (gKeywordTable) {
    return nsCSSKeyword(gKeywordTable->Lookup(aKeyword));
  }  
  return eCSSKeyword_UNKNOWN;
}

Definition at line 83 of file nsCSSKeywords.cpp.

{
  if (0 == --gTableRefCount) {
    if (gKeywordTable) {
      delete gKeywordTable;
      gKeywordTable = nsnull;
    }
  }
}

Here is the caller graph for this function:


The documentation for this class was generated from the following files: