Back to index

lightning-sunbird  0.9+nobinonly
Functions
nsEnumeratorUtils.cpp File Reference
#include "nsEnumeratorUtils.h"

Go to the source code of this file.

Functions

NS_COM nsresult NS_NewArrayEnumerator (nsISimpleEnumerator **result, nsISupportsArray *array)
NS_COM nsresult NS_NewSingletonEnumerator (nsISimpleEnumerator **result, nsISupports *singleton)
NS_COM nsresult NS_NewUnionEnumerator (nsISimpleEnumerator **result, nsISimpleEnumerator *firstEnumerator, nsISimpleEnumerator *secondEnumerator)

Function Documentation

Definition at line 97 of file nsEnumeratorUtils.cpp.

{
    nsArrayEnumerator* enumer = new nsArrayEnumerator(array);
    if (enumer == nsnull)
        return NS_ERROR_OUT_OF_MEMORY;
    *result = enumer; 
    NS_ADDREF(*result);
    return NS_OK;
}

Here is the call graph for this function:

NS_COM nsresult NS_NewSingletonEnumerator ( nsISimpleEnumerator **  result,
nsISupports *  singleton 
)

Definition at line 154 of file nsEnumeratorUtils.cpp.

{
    nsSingletonEnumerator* enumer = new nsSingletonEnumerator(singleton);
    if (enumer == nsnull)
        return NS_ERROR_OUT_OF_MEMORY;
    *result = enumer; 
    NS_ADDREF(*result);
    return NS_OK;
}

Here is the call graph for this function:

NS_COM nsresult NS_NewUnionEnumerator ( nsISimpleEnumerator **  result,
nsISimpleEnumerator firstEnumerator,
nsISimpleEnumerator secondEnumerator 
)

Definition at line 233 of file nsEnumeratorUtils.cpp.

{
    *result = nsnull;
    if (! firstEnumerator) {
        *result = secondEnumerator;
    } else if (! secondEnumerator) {
        *result = firstEnumerator;
    } else {
        nsUnionEnumerator* enumer = new nsUnionEnumerator(firstEnumerator, secondEnumerator);
        if (enumer == nsnull)
            return NS_ERROR_OUT_OF_MEMORY;
        *result = enumer; 
    }
    NS_ADDREF(*result);
    return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function: