Back to index

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

#include <nsPermissionManager.h>

Inheritance diagram for nsHostEntry:
Inheritance graph
[legend]
Collaboration diagram for nsHostEntry:
Collaboration graph
[legend]

List of all members.

Public Types

enum  { ALLOW_MEMMOVE = PR_TRUE }
typedef const char * KeyType
typedef const char * KeyTypePointer

Public Member Functions

 nsHostEntry (const char *aHost)
 nsHostEntry (const nsHostEntry &toCopy)
 ~nsHostEntry ()
KeyType GetKey () const
KeyTypePointer GetKeyPointer () const
PRBool KeyEquals (KeyTypePointer aKey) const
const nsDependentCString GetHost () const
void SetPermission (PRInt32 aTypeIndex, PRUint32 aPermission)
PRUint32 GetPermission (PRInt32 aTypeIndex) const
PRBool PermissionsAreEmpty () const

Static Public Member Functions

static KeyTypePointer KeyToPointer (KeyType aKey)
static PLDHashNumber HashKey (KeyTypePointer aKey)

Public Attributes

PLDHashNumber keyHash

Private Attributes

const char * mHost
PRUint8 mPermissions [NUMBER_OF_TYPES]

Detailed Description

Definition at line 67 of file nsPermissionManager.h.


Member Typedef Documentation

typedef const char* nsHostEntry::KeyType

Definition at line 71 of file nsPermissionManager.h.

Definition at line 72 of file nsPermissionManager.h.


Member Enumeration Documentation

anonymous enum
Enumerator:
ALLOW_MEMMOVE 

Definition at line 108 of file nsPermissionManager.h.


Constructor & Destructor Documentation

nsHostEntry::nsHostEntry ( const char *  aHost)

Definition at line 72 of file nsPermissionManager.cpp.

Here is the call graph for this function:

Definition at line 78 of file nsPermissionManager.cpp.

{
  // nsTHashtable shouldn't allow us to end up here, since we
  // set ALLOW_MEMMOVE to true.
  NS_NOTREACHED("nsHostEntry copy constructor is forbidden!");
}

Definition at line 77 of file nsPermissionManager.h.

  {
  }

Member Function Documentation

Definition at line 111 of file nsPermissionManager.h.

  {
    return nsDependentCString(mHost);
  }

Here is the caller graph for this function:

KeyType nsHostEntry::GetKey ( ) const [inline]

Definition at line 81 of file nsPermissionManager.h.

  {
    return mHost;
  }

Here is the caller graph for this function:

Definition at line 86 of file nsPermissionManager.h.

  {
    return mHost;
  }
PRUint32 nsHostEntry::GetPermission ( PRInt32  aTypeIndex) const [inline]

Definition at line 122 of file nsPermissionManager.h.

  {
    return (PRUint32)mPermissions[aTypeIndex];
  }

Here is the caller graph for this function:

static PLDHashNumber nsHostEntry::HashKey ( KeyTypePointer  aKey) [inline, static]

Definition at line 101 of file nsPermissionManager.h.

  {
    // PL_DHashStringKey doesn't use the table parameter, so we can safely
    // pass nsnull
    return PL_DHashStringKey(nsnull, aKey);
  }

Here is the call graph for this function:

PRBool nsHostEntry::KeyEquals ( KeyTypePointer  aKey) const [inline]

Definition at line 91 of file nsPermissionManager.h.

  {
    return !strcmp(mHost, aKey);
  }
static KeyTypePointer nsHostEntry::KeyToPointer ( KeyType  aKey) [inline, static]

Definition at line 96 of file nsPermissionManager.h.

  {
    return aKey;
  }

Definition at line 127 of file nsPermissionManager.h.

  {
    // Cast to PRUint32, to make this faster. Only 2 checks instead of 8
    return (*NS_REINTERPRET_CAST(const PRUint32*, &mPermissions[0])==0 && 
            *NS_REINTERPRET_CAST(const PRUint32*, &mPermissions[4])==0 );
  }

Here is the caller graph for this function:

void nsHostEntry::SetPermission ( PRInt32  aTypeIndex,
PRUint32  aPermission 
) [inline]

Definition at line 117 of file nsPermissionManager.h.

  {
    mPermissions[aTypeIndex] = (PRUint8)aPermission;
  }

Here is the caller graph for this function:


Member Data Documentation

Definition at line 113 of file pldhash.h.

const char* nsHostEntry::mHost [private]

Definition at line 135 of file nsPermissionManager.h.

Definition at line 142 of file nsPermissionManager.h.


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