Back to index

lightning-sunbird  0.9+nobinonly
Classes | Defines | Functions | Variables
nsDirectoryService.cpp File Reference
#include "nsCOMPtr.h"
#include "nsAutoPtr.h"
#include "nsDirectoryService.h"
#include "nsDirectoryServiceDefs.h"
#include "nsLocalFile.h"
#include "nsDebug.h"
#include "nsStaticAtom.h"
#include "nsEnumeratorUtils.h"
#include "nsICategoryManager.h"
#include "nsISimpleEnumerator.h"
#include "nsIStringEnumerator.h"
#include "SpecialSystemDirectory.h"
#include "nsAppFileLocationProvider.h"

Go to the source code of this file.


struct  FileData




static PRBool FindProviderFile (nsISupports *aElement, void *aData)


static const nsStaticAtom directory_atoms []

Define Documentation

Definition at line 101 of file nsDirectoryService.cpp.

Definition at line 100 of file nsDirectoryService.cpp.

Definition at line 104 of file nsDirectoryService.cpp.

Function Documentation

static PRBool FindProviderFile ( nsISupports *  aElement,
void aData 
) [static]

Definition at line 600 of file nsDirectoryService.cpp.

  nsresult rv;
  FileData* fileData = (FileData*)aData;
  if (fileData->uuid.Equals(NS_GET_IID(nsISimpleEnumerator)))
      // Not all providers implement this iface
      nsCOMPtr<nsIDirectoryServiceProvider2> prov2 = do_QueryInterface(aElement);
      if (prov2)
          nsCOMPtr<nsISimpleEnumerator> newFiles;
          rv = prov2->GetFiles(fileData->property, getter_AddRefs(newFiles));
          if (NS_SUCCEEDED(rv) && newFiles) {
              if (fileData->data) {
                  nsCOMPtr<nsISimpleEnumerator> unionFiles;

                                        (nsISimpleEnumerator*) fileData->data, newFiles);

                  if (unionFiles)
                      unionFiles.swap(* (nsISimpleEnumerator**) &fileData->data);
                  NS_ADDREF(fileData->data = newFiles);
              fileData->persistent = PR_FALSE; // Enumerators can never be persistent
              return rv == NS_SUCCESS_AGGREGATE_RESULT;
      nsCOMPtr<nsIDirectoryServiceProvider> prov = do_QueryInterface(aElement);
      if (prov)
          rv = prov->GetFile(fileData->property, &fileData->persistent, (nsIFile **)&fileData->data);
          if (NS_SUCCEEDED(rv) && fileData->data)
              return PR_FALSE;

  return PR_TRUE;

Here is the call graph for this function:

Variable Documentation

Definition at line 431 of file nsDirectoryService.cpp.