Back to index

lightning-sunbird  0.9+nobinonly
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Private Attributes
nsDepCharHashKey Class Reference

hashkey wrapper for "dependent" const char*; this class does not "own" its string pointer. More...

#include <nsHashKeys.h>

Inheritance diagram for nsDepCharHashKey:
Inheritance graph
Collaboration diagram for nsDepCharHashKey:
Collaboration graph

List of all members.

Public Types

typedef const char * KeyType
typedef const char * KeyTypePointer

Public Member Functions

 nsDepCharHashKey (const char *aKey)
 nsDepCharHashKey (const nsDepCharHashKey &toCopy)
 ~nsDepCharHashKey ()
const char * GetKey () const
const char * GetKeyPointer () const
PRBool KeyEquals (const char *aKey) const

Static Public Member Functions

static const char * KeyToPointer (const char *aKey)
static PLDHashNumber HashKey (const char *aKey)

Public Attributes

PLDHashNumber keyHash

Private Attributes

const char * mKey

Detailed Description

hashkey wrapper for "dependent" const char*; this class does not "own" its string pointer.

This class must only be used if the strings have a lifetime longer than the hashtable they occupy. This normally occurs only for static strings or strings that have been arena-allocated.

See also:
nsTHashtable::EntryType for specification

Definition at line 269 of file nsHashKeys.h.

Member Typedef Documentation

Definition at line 272 of file nsHashKeys.h.

Definition at line 273 of file nsHashKeys.h.

Member Enumeration Documentation

anonymous enum

Definition at line 288 of file nsHashKeys.h.

Constructor & Destructor Documentation

nsDepCharHashKey::nsDepCharHashKey ( const char *  aKey) [inline]

Definition at line 275 of file nsHashKeys.h.

{ mKey = aKey; }

Definition at line 276 of file nsHashKeys.h.

{ mKey = toCopy.mKey; }

Definition at line 277 of file nsHashKeys.h.

{ }

Member Function Documentation

const char* nsDepCharHashKey::GetKey ( void  ) const [inline]

Definition at line 279 of file nsHashKeys.h.

{ return mKey; }

Here is the caller graph for this function:

const char* nsDepCharHashKey::GetKeyPointer ( ) const [inline]

Definition at line 280 of file nsHashKeys.h.

{ return mKey; }
static PLDHashNumber nsDepCharHashKey::HashKey ( const char *  aKey) [inline, static]

Definition at line 287 of file nsHashKeys.h.

{ return HashCString(aKey); }

Here is the call graph for this function:

PRBool nsDepCharHashKey::KeyEquals ( const char *  aKey) const [inline]

Definition at line 281 of file nsHashKeys.h.

    return !strcmp(mKey, aKey);
static const char* nsDepCharHashKey::KeyToPointer ( const char *  aKey) [inline, static]

Definition at line 286 of file nsHashKeys.h.

{ return aKey; }

Member Data Documentation

Definition at line 113 of file pldhash.h.

const char* nsDepCharHashKey::mKey [private]

Definition at line 291 of file nsHashKeys.h.

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