Back to index

lightning-sunbird  0.9+nobinonly
Classes | Functions
nsEnumeratorUtils.h File Reference
#include "nsIEnumerator.h"
#include "nsISupportsArray.h"

Go to the source code of this file.

Classes

protocol  NS_COM
 A string set that takes up minimal size when there are 0 or 1 strings in the set. More...
protocol  NS_COM
 A string set that takes up minimal size when there are 0 or 1 strings in the set. More...
protocol  NS_COM
 A string set that takes up minimal size when there are 0 or 1 strings in the set. More...

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: