зеркало из https://github.com/mozilla/pjs.git
326668 Add NS_NewLocalFileWithFSRef function to create nsLocalFiles from FSRefs on Mac prior to xpcom startup. r=josh sr=dougt
This commit is contained in:
Родитель
d2eead6f57
Коммит
fe9b9274fd
|
@ -21,6 +21,7 @@
|
|||
*
|
||||
* Contributor(s):
|
||||
* Conrad Carlen <ccarlen@netscape.com>
|
||||
* Mark Mentovai <mark@moxienet.com>
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
|
@ -239,5 +240,8 @@ NS_EXPORT const char* NS_TruncNodeName(const char *aNode, char *outBuf);
|
|||
#endif
|
||||
|
||||
NS_EXPORT nsresult NS_NewLocalFileWithFSSpec(const FSSpec* inSpec, PRBool followSymlinks, nsILocalFileMac* *result);
|
||||
|
||||
// NS_NewLocalFileWithFSRef is available since Mozilla 1.8.1.
|
||||
NS_EXPORT nsresult NS_NewLocalFileWithFSRef(const FSRef* aFSRef, PRBool aFollowSymlinks, nsILocalFileMac** result);
|
||||
}
|
||||
%}
|
||||
|
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -2123,6 +2123,24 @@ nsresult NS_NewLocalFileWithFSSpec(const FSSpec* inSpec, PRBool followLinks, nsI
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
nsresult NS_NewLocalFileWithFSRef(const FSRef* aFSRef, PRBool aFollowLinks, nsILocalFileMac** result)
|
||||
{
|
||||
nsLocalFile* file = new nsLocalFile();
|
||||
if (file == nsnull)
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
NS_ADDREF(file);
|
||||
|
||||
file->SetFollowLinks(aFollowLinks);
|
||||
|
||||
nsresult rv = file->InitWithFSRef(aFSRef);
|
||||
if (NS_FAILED(rv)) {
|
||||
NS_RELEASE(file);
|
||||
return rv;
|
||||
}
|
||||
*result = file;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//*****************************************************************************
|
||||
// Static Functions
|
||||
//*****************************************************************************
|
||||
|
|
Загрузка…
Ссылка в новой задаче