1. Added Get/SetPersistentDescriptor. Use this instead of GetPath/InitWithPath.
2. It is now possible to pass nsnull for the path param to NS_NewLocalFile(). This allows one to create an unspecified file. r = dougt git-svn-id: svn://10.0.0.236/trunk@74318 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -1328,6 +1328,20 @@ nsLocalFile::Load(PRLibrary **_retval)
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsLocalFile::GetPersistentDescriptor(char * *aPersistentDescriptor)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aPersistentDescriptor);
|
||||
return GetPath(aPersistentDescriptor);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsLocalFile::SetPersistentDescriptor(const char * aPersistentDescriptor)
|
||||
{
|
||||
NS_ENSURE_ARG(aPersistentDescriptor);
|
||||
return InitWithPath(aPersistentDescriptor);
|
||||
}
|
||||
|
||||
nsresult
|
||||
NS_NewLocalFile(const char* path, PRBool followSymlinks, nsILocalFile* *result)
|
||||
{
|
||||
@@ -1336,10 +1350,12 @@ NS_NewLocalFile(const char* path, PRBool followSymlinks, nsILocalFile* *result)
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
NS_ADDREF(file);
|
||||
|
||||
nsresult rv = file->InitWithPath(path);
|
||||
if (NS_FAILED(rv)) {
|
||||
NS_RELEASE(file);
|
||||
return rv;
|
||||
if (path) {
|
||||
nsresult rv = file->InitWithPath(path);
|
||||
if (NS_FAILED(rv)) {
|
||||
NS_RELEASE(file);
|
||||
return rv;
|
||||
}
|
||||
}
|
||||
*result = file;
|
||||
return NS_OK;
|
||||
|
||||
Reference in New Issue
Block a user