Back to index

lightning-sunbird  0.9+nobinonly
Classes | Defines | Typedefs | Functions
nsFileSpec.h File Reference
#include "xpcomobsolete.h"
#include "nsError.h"
#include "nsString.h"
#include "nsReadableUtils.h"
#include "nsCRT.h"
#include "prtypes.h"
#include "nsILocalFile.h"
#include "nsCOMPtr.h"

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

Defines

#define NS_NAMESPACE_PROTOTYPE   static
#define NS_NAMESPACE   struct
#define NS_NAMESPACE_END   ;
#define NS_EXPLICIT
#define kFileURLPrefix   "file://"
#define kFileURLPrefixLength   (7)
#define NS_FILE_RESULT(x)   ns_file_convert_result((PRInt32)x)
#define NS_FILE_FAILURE   NS_FILE_RESULT(-1)
#define NS_NAMESPACE_PROTOTYPE   static
#define NS_NAMESPACE   struct
#define NS_NAMESPACE_END   ;
#define NS_EXPLICIT
#define kFileURLPrefix   "file://"
#define kFileURLPrefixLength   (7)
#define NS_FILE_RESULT(x)   ns_file_convert_result((PRInt32)x)
#define NS_FILE_FAILURE   NS_FILE_RESULT(-1)

Typedefs

typedef nsFileSpec nsNativeFileSpec

Functions

nsresult ns_file_convert_result (PRInt32 nativeErr)
NS_COM_OBSOLETE nsresult NS_FileSpecToIFile (nsFileSpec *fileSpec, nsILocalFile **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 kFileURLPrefix   "file://"

Definition at line 215 of file nsIFileSpec.idl.

#define kFileURLPrefix   "file://"

Definition at line 216 of file nsIFileSpec.idl.

Definition at line 171 of file nsIFileSpec.idl.

Definition at line 238 of file nsIFileSpec.idl.

Definition at line 236 of file nsIFileSpec.idl.

#define NS_NAMESPACE   struct
#define NS_NAMESPACE   struct

Definition at line 169 of file nsIFileSpec.idl.

Definition at line 170 of file nsIFileSpec.idl.

Definition at line 168 of file nsIFileSpec.idl.


Typedef Documentation

Definition at line 524 of file nsFileSpec.h.


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: