Back to index

lightning-sunbird  0.9+nobinonly
Functions
nsRDFDataSourceFactory.cpp File Reference
#include "nsIGenericFactory.h"
#include "nsRDFDataSourceDS.h"
#include "nsIComponentManager.h"
#include "nsIServiceManager.h"
#include "rdf.h"

Go to the source code of this file.

Functions

static NS_DEFINE_CID (kRDFDataSourceCID, NS_RDFDATASOURCEDATASOURCE_CID)
static NS_DEFINE_CID (kComponentManagerCID, NS_COMPONENTMANAGER_CID)
nsresult NSGetFactory (nsISupports *aServMgr, const nsCID &aClass, const char *aClassName, const char *aContractID, nsIFactory **aFactory)
nsresult NSRegisterSelf (nsISupports *aServMgr, const char *aPath)
nsresult NSUnregisterSelf (nsISupports *aServMgr, const char *aPath)

Function Documentation

static NS_DEFINE_CID ( kRDFDataSourceCID  ,
NS_RDFDATASOURCEDATASOURCE_CID   
) [static]
static NS_DEFINE_CID ( kComponentManagerCID  ,
NS_COMPONENTMANAGER_CID   
) [static]
nsresult NSGetFactory ( nsISupports *  aServMgr,
const nsCID aClass,
const char *  aClassName,
const char *  aContractID,
nsIFactory **  aFactory 
)

Definition at line 52 of file nsRDFDataSourceFactory.cpp.

{
  nsresult rv=NS_OK;
  nsIGenericFactory* fact;
  if (aClass.Equals(kRDFDataSourceCID))
    rv = NS_NewGenericFactory(&fact, NS_NewRDFDataSourceDataSource);
  else
    rv = NS_ERROR_FAILURE;

  if (NS_SUCCEEDED(rv))
    *aFactory = fact;

#ifdef DEBUG_alecf
  printf("nsRDFDataSource's NSGetFactory!\n");
#endif
  return rv;
}

Here is the call graph for this function:

nsresult NSRegisterSelf ( nsISupports *  aServMgr,
const char *  aPath 
)

Definition at line 75 of file nsRDFDataSourceFactory.cpp.

{
  nsresult rv;
  nsCOMPtr<nsIComponentManager> compMgr =
           do_GetService(kComponentManagerCID, aServMgr, &rv);
  if (NS_FAILED(rv)) return rv;

  rv = compMgr->RegisterComponent(kRDFDataSourceCID,
                                  "Generic DataSource DataSource",
                                  NS_RDF_DATASOURCE_CONTRACTID_PREFIX "datasource",
                                  aPath, PR_TRUE, PR_TRUE);

  return rv;

}

Here is the call graph for this function:

nsresult NSUnregisterSelf ( nsISupports *  aServMgr,
const char *  aPath 
)

Definition at line 92 of file nsRDFDataSourceFactory.cpp.

{
  nsresult rv;
  nsCOMPtr<nsIComponentManager> compMgr =
         do_GetService(kComponentManagerCID, aServMgr, &rv);
  if (NS_FAILED(rv)) return rv;

  rv = compMgr->UnregisterComponent(kRDFDataSourceCID, aPath);

  return rv;
}

Here is the call graph for this function: