Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Protected Attributes
nsPasswordManagerEnumerator Class Reference
Inheritance diagram for nsPasswordManagerEnumerator:
Inheritance graph
[legend]
Collaboration diagram for nsPasswordManagerEnumerator:
Collaboration graph
[legend]

List of all members.

Public Member Functions

NS_DECL_ISUPPORTS nsPasswordManagerEnumerator (PRBool aDecrypt=PR_TRUE)
NS_IMETHOD HasMoreElements (PRBool *result)
NS_IMETHOD GetNext (nsISupports **result)
virtual ~nsPasswordManagerEnumerator ()
boolean hasMoreElements ()
 Called to determine whether or not the enumerator has any elements that can be returned via getNext().
nsISupports getNext ()
 Called to retrieve the next element in the enumerator.

Protected Attributes

PRInt32 mHostCount
PRInt32 mUserCount
PRBool mDecrypt

Detailed Description

Definition at line 47 of file nsPasswordManager.cpp.


Constructor & Destructor Documentation

Definition at line 53 of file nsPasswordManager.cpp.

                                                           : 
      mHostCount(0), mUserCount(0), mDecrypt(aDecrypt)
    {
    }

Definition at line 92 of file nsPasswordManager.cpp.

    {
    }

Member Function Documentation

NS_IMETHOD nsPasswordManagerEnumerator::GetNext ( nsISupports **  result) [inline]

Definition at line 64 of file nsPasswordManager.cpp.

    {
      char * host;
      PRUnichar * user;
      PRUnichar * pswd;
      nsresult rv = SINGSIGN_Enumerate(mHostCount, mUserCount++, mDecrypt, &host, &user, &pswd);
      if (NS_FAILED(rv)) {
        mUserCount = 0;
        mHostCount++;
        return rv;
      }
      if (mUserCount == SINGSIGN_UserCount(mHostCount)) {
        mUserCount = 0;
        mHostCount++;
      }
      nsIPassword *password = new nsPassword(host, user, pswd);
      // note that memory is handed off to "new nsPassword" in a non-xpcom fashion 
      if (password == nsnull) {
        nsMemory::Free(host);
        nsMemory::Free(user);
        nsMemory::Free(pswd);
        return NS_ERROR_OUT_OF_MEMORY;
      }
      *result = password;
      NS_ADDREF(*result);
      return NS_OK;
    }

Here is the call graph for this function:

nsISupports nsISimpleEnumerator::getNext ( ) [inherited]

Called to retrieve the next element in the enumerator.

The "next" element is the first element upon the first call. Must be pre-ceeded by a call to hasMoreElements() which returns PR_TRUE. This method is generally called within a loop to iterate over the elements in the enumerator.

See also:
hasMoreElements()
Returns:
NS_OK if the call succeeded in returning a non-null value through the out parameter. NS_ERROR_FAILURE if there are no more elements to enumerate.
the next element in the enumeration.

Here is the caller graph for this function:

Definition at line 58 of file nsPasswordManager.cpp.

Here is the call graph for this function:

Called to determine whether or not the enumerator has any elements that can be returned via getNext().

This method is generally used to determine whether or not to initiate or continue iteration over the enumerator, though it can be called without subsequent getNext() calls. Does not affect internal state of enumerator.

See also:
getNext()
Returns:
PR_TRUE if there are remaining elements in the enumerator. PR_FALSE if there are no more elements in the enumerator.

Here is the caller graph for this function:


Member Data Documentation

Definition at line 99 of file nsPasswordManager.cpp.

Definition at line 97 of file nsPasswordManager.cpp.

Definition at line 98 of file nsPasswordManager.cpp.


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