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:
mark%moxienet.com 2006-03-07 01:26:13 +00:00
Родитель d2eead6f57
Коммит fe9b9274fd
3 изменённых файлов: 22 добавлений и 3554 удалений

Просмотреть файл

@ -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
//*****************************************************************************