Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Public Attributes
nsCommandParams::HashEntry Struct Reference

#include <nsCommandParams.h>

Inheritance diagram for nsCommandParams::HashEntry:
Inheritance graph
[legend]
Collaboration diagram for nsCommandParams::HashEntry:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 HashEntry (PRUint8 inType, const char *inEntryName)
 HashEntry (const HashEntry &inRHS)
 ~HashEntry ()
void Reset (PRUint8 inNewType)

Public Attributes

nsCString mEntryName
PRUint8 mEntryType
union
nsCommandParams::HashEntry.mData 
mData
nsCOMPtr< nsISupports > mISupports
PLDHashNumber keyHash

Detailed Description

Definition at line 68 of file nsCommandParams.h.


Constructor & Destructor Documentation

nsCommandParams::HashEntry::HashEntry ( PRUint8  inType,
const char *  inEntryName 
) [inline]

Definition at line 84 of file nsCommandParams.h.

    : mEntryName(inEntryName)
    , mEntryType(inType)
    {
      memset(&mData, 0, sizeof(mData));
      Reset(mEntryType);
    }

Here is the call graph for this function:

Definition at line 92 of file nsCommandParams.h.

    : mEntryType(inRHS.mEntryType)
    {
      Reset(mEntryType);
      switch (mEntryType)
      {
        case eBooleanType:      mData.mBoolean = inRHS.mData.mBoolean;  break;
        case eLongType:         mData.mLong    = inRHS.mData.mLong;     break;
        case eDoubleType:       mData.mDouble  = inRHS.mData.mDouble;   break;
        case eWStringType:
          NS_ASSERTION(inRHS.mData.mString, "Source entry has no string");
          mData.mString = new nsString(*inRHS.mData.mString);
          break;      
        case eStringType:
          NS_ASSERTION(inRHS.mData.mCString, "Source entry has no string");
          mData.mCString = new nsCString(*inRHS.mData.mCString);
          break;      
        case eISupportsType:
          mISupports = inRHS.mISupports.get();    // additional addref
          break;
        default:
          NS_ASSERTION(0, "Unknown type");
      }
    }

Here is the call graph for this function:

Definition at line 117 of file nsCommandParams.h.

    {
      if (mEntryType == eWStringType)
        delete mData.mString;
      else if (mEntryType == eStringType)
        delete mData.mCString;
    }

Here is the caller graph for this function:


Member Function Documentation

Definition at line 125 of file nsCommandParams.h.

    {
      switch (mEntryType)
      {
        case eNoType:                                       break;
        case eBooleanType:      mData.mBoolean = PR_FALSE;  break;
        case eLongType:         mData.mLong = 0;            break;
        case eDoubleType:       mData.mDouble = 0.0;        break;
        case eWStringType:      delete mData.mString; mData.mString = nsnull;     break;
        case eISupportsType:    mISupports = nsnull;        break;    // clear the nsCOMPtr
        case eStringType:       delete mData.mCString; mData.mCString = nsnull;   break;
        default:
          NS_ASSERTION(0, "Unknown type");
      }
      
      mEntryType = inNewType;
    }

Here is the caller graph for this function:


Member Data Documentation

Definition at line 113 of file pldhash.h.

Definition at line 70 of file nsCommandParams.h.

Definition at line 72 of file nsCommandParams.h.

Definition at line 82 of file nsCommandParams.h.


The documentation for this struct was generated from the following file: