Back to index

lightning-sunbird  0.9+nobinonly
Classes | Defines | Functions
nsIFileSpec.idl File Reference
import "nsISupports.idl";
#include "nsFileSpec.h"
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  nsSimpleCharString
struct  nsSimpleCharString::Data
protocol  NS_COM_OBSOLETE
protocol  NS_COM_OBSOLETE
protocol  NS_COM_OBSOLETE
class  nsPersistentFileDescriptor
protocol  NS_COM_OBSOLETE
protocol  NS_COM_OBSOLETE
interface  nsIFileSpec
interface  nsIDirectoryIterator

Defines

#define NS_FILESPEC_CID   { 0xa5740fa2, 0x146e, 0x11d3, { 0xb0, 0xd, 0x0, 0xc0, 0x4f, 0xc2, 0xe7, 0x9b } }
#define NS_FILESPEC_CONTRACTID   "@mozilla.org/filespec;1"
#define NS_FILESPEC_CLASSNAME   "File Spec"
#define NS_DIRECTORYITERATOR_CID   { 0xa3020981, 0x2018, 0x11d3, { 0x91, 0x5f, 0xa9, 0x57, 0x79, 0x5b, 0x7e, 0xbc } }
#define NS_DIRECTORYITERATOR_CONTRACTID   "@mozilla.org/directoryiterator;1"
#define NS_DIRECTORYITERATOR_CLASSNAME   "nsIDirectoryIterator"
#define NS_BOOL_ACCESSOR(_method)   { PRBool yes; return NS_SUCCEEDED(f->_method(&yes)) && yes; }

Functions

nsresult ns_file_convert_result (PRInt32 nativeErr)
NS_COM_OBSOLETE nsresult NS_FileSpecToIFile (nsFileSpec *fileSpec, nsILocalFile **result)
native nsFileSpec (nsFileSpec)
native nsFileSpecRef (nsFileSpec)
native nsFileSpecPtr (nsFileSpec)
NS_COM_OBSOLETE nsresult NS_NewFileSpecWithSpec (const nsFileSpec &aSrcFileSpec, nsIFileSpec **result)
NS_COM_OBSOLETE nsresult NS_NewFileSpec (nsIFileSpec **result)
NS_COM_OBSOLETE nsresult NS_NewDirectoryIterator (nsIDirectoryIterator **result)
NS_COM_OBSOLETE nsresult NS_NewFileSpecFromIFile (nsIFile *aFile, nsIFileSpec **result)

Class Documentation

struct nsSimpleCharString::Data

Definition at line 305 of file nsFileSpec.h.

Collaboration diagram for nsSimpleCharString::Data:
Class Members
PRUint32 mLength
int mRefCount
char mString

Define Documentation

#define NS_BOOL_ACCESSOR (   _method)    { PRBool yes; return NS_SUCCEEDED(f->_method(&yes)) && yes; }

Definition at line 202 of file nsIFileSpec.idl.

#define NS_DIRECTORYITERATOR_CID   { 0xa3020981, 0x2018, 0x11d3, { 0x91, 0x5f, 0xa9, 0x57, 0x79, 0x5b, 0x7e, 0xbc } }

Definition at line 167 of file nsIFileSpec.idl.

#define NS_DIRECTORYITERATOR_CLASSNAME   "nsIDirectoryIterator"

Definition at line 171 of file nsIFileSpec.idl.

#define NS_DIRECTORYITERATOR_CONTRACTID   "@mozilla.org/directoryiterator;1"

Definition at line 170 of file nsIFileSpec.idl.

#define NS_FILESPEC_CID   { 0xa5740fa2, 0x146e, 0x11d3, { 0xb0, 0xd, 0x0, 0xc0, 0x4f, 0xc2, 0xe7, 0x9b } }

Definition at line 66 of file nsIFileSpec.idl.

#define NS_FILESPEC_CLASSNAME   "File Spec"

Definition at line 70 of file nsIFileSpec.idl.

#define NS_FILESPEC_CONTRACTID   "@mozilla.org/filespec;1"

Definition at line 69 of file nsIFileSpec.idl.


Function Documentation

Definition at line 328 of file nsFileSpec.cpp.

{
    return nativeErr ?
        NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_FILES,((nativeErr)&0xFFFF))
        : NS_OK;
}

Definition at line 1330 of file nsFileSpec.cpp.

{
    nsresult rv;

    nsCOMPtr<nsILocalFile> file(do_CreateInstance(NS_LOCAL_FILE_CONTRACTID));

    if (!file) return NS_ERROR_FAILURE;

#if defined(XP_MAC)
    {
        FSSpec spec  = fileSpec->GetFSSpec();
        nsCOMPtr<nsILocalFileMac> psmAppMacFile = do_QueryInterface(file, &rv);
        if (NS_FAILED(rv)) return rv;
        rv = psmAppMacFile->InitWithFSSpec(&spec);
        if (NS_FAILED(rv)) return rv;
        file = do_QueryInterface(psmAppMacFile, &rv);
    }
#else
    // XP_MACOSX: do this for OS X to preserve long filenames
    rv = file->InitWithNativePath(nsDependentCString(fileSpec->GetNativePathCString()));
#endif
    if (NS_FAILED(rv)) return rv;

    *result = file;
    NS_ADDREF(*result);
    return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 891 of file nsFileSpecImpl.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 867 of file nsFileSpecImpl.cpp.

{
       return nsFileSpecImpl::Create(nsnull, NS_GET_IID(nsIFileSpec), (void**)result);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 874 of file nsFileSpecImpl.cpp.

{
        nsresult rv = nsFileSpecImpl::Create(nsnull, NS_GET_IID(nsIFileSpec), (void**)result);
     if (NS_FAILED(rv)) return rv;

     nsCAutoString path;
     rv = aFile->GetNativePath(path);
     if (NS_FAILED(rv)) return rv;

     rv = (*result)->SetNativePath(path.get());
     if (NS_FAILED(rv))
         NS_RELEASE(*result);
     return rv;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 857 of file nsFileSpecImpl.cpp.

{
       if (!result)
              return NS_ERROR_NULL_POINTER;

       return nsFileSpecImpl::MakeInterface(aSrcFileSpec, result);
}

Here is the caller graph for this function:

native nsFileSpec ( nsFileSpec  )
native nsFileSpecPtr ( nsFileSpec  )
native nsFileSpecRef ( nsFileSpec  )