Back to index

lightning-sunbird  0.9+nobinonly
Classes | Functions | Variables
nsArray.cpp File Reference
#include "nsArray.h"
#include "nsArrayEnumerator.h"
#include "nsWeakReference.h"

Go to the source code of this file.


struct  findIndexOfClosure


 PR_STATIC_CALLBACK (PRBool) FindElementCallback(void *aElement
PRBool FindElementCallback (void *aElement, void *aClosure)
nsresult NS_NewArray (nsIMutableArray **aResult)
nsresult NS_NewArray (nsIMutableArray **aResult, const nsCOMArray_base &aBaseArray)



Class Documentation

struct findIndexOfClosure

Definition at line 44 of file nsArray.cpp.

Collaboration diagram for findIndexOfClosure:
Class Members
PRUint32 resultIndex
PRUint32 startIndex
nsISupports * targetElement

Function Documentation

PRBool FindElementCallback ( void aElement,
void aClosure 

Definition at line 185 of file nsArray.cpp.

    findIndexOfClosure* closure =
        NS_STATIC_CAST(findIndexOfClosure*, aClosure);

    nsISupports* element =
        NS_STATIC_CAST(nsISupports*, aElement);
    // don't start searching until we're past the startIndex
    if (closure->resultIndex >= closure->startIndex &&
        element == closure->targetElement) {
        return PR_FALSE;    // stop! We found it

    return PR_TRUE;

Definition at line 223 of file nsArray.cpp.

    nsArray* arr = new nsArray;
    if (!arr) return NS_ERROR_OUT_OF_MEMORY;

    *aResult = NS_STATIC_CAST(nsIMutableArray*,arr);
    return NS_OK;

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult NS_NewArray ( nsIMutableArray **  aResult,
const nsCOMArray_base aBaseArray 

Definition at line 235 of file nsArray.cpp.

    nsArray* arr = new nsArray(aBaseArray);
    if (!arr) return NS_ERROR_OUT_OF_MEMORY;
    *aResult = NS_STATIC_CAST(nsIMutableArray*, arr);

    return NS_OK;

Here is the call graph for this function:

Variable Documentation

Definition at line 51 of file nsArray.cpp.