Back to index

lightning-sunbird  0.9+nobinonly
Functions
nsRDFBaseDataSources.h File Reference
#include "nsError.h"
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

NS_IMETHODIMP NS_NewRDFInMemoryDataSource (nsISupports *aOuter, const nsIID &aIID, void **aResult)
nsresult NS_NewRDFXMLDataSource (nsIRDFDataSource **aResult)

Function Documentation

NS_IMETHODIMP NS_NewRDFInMemoryDataSource ( nsISupports *  aOuter,
const nsIID aIID,
void **  aResult 
)

Definition at line 861 of file nsInMemoryDataSource.cpp.

{
    NS_PRECONDITION(aResult != nsnull, "null ptr");
    if (! aResult)
        return NS_ERROR_NULL_POINTER;
    *aResult = nsnull;

    if (aOuter && !aIID.Equals(NS_GET_IID(nsISupports))) {
        NS_ERROR("aggregation requires nsISupports");
        return NS_ERROR_ILLEGAL_VALUE;
    }

    InMemoryDataSource* datasource = new InMemoryDataSource(aOuter);
    if (! datasource)
        return NS_ERROR_OUT_OF_MEMORY;
    NS_ADDREF(datasource);

    nsresult rv = datasource->Init();
    if (NS_SUCCEEDED(rv)) {
        datasource->fAggregated.AddRef();
        rv = datasource->AggregatedQueryInterface(aIID, aResult); // This'll AddRef()
        datasource->fAggregated.Release();
    }

    NS_RELEASE(datasource);
    return rv;
}

Here is the call graph for this function:

Definition at line 465 of file nsRDFXMLDataSource.cpp.

{
    NS_PRECONDITION(aResult != nsnull, "null ptr");
    if (! aResult)
        return NS_ERROR_NULL_POINTER;

    RDFXMLDataSourceImpl* datasource = new RDFXMLDataSourceImpl();
    if (! datasource)
        return NS_ERROR_OUT_OF_MEMORY;

    nsresult rv;
    rv = datasource->Init();

    if (NS_FAILED(rv)) {
        delete datasource;
        return rv;
    }

    NS_ADDREF(datasource);
    *aResult = datasource;
    return NS_OK;
}

Here is the call graph for this function: