- Various missing-newline-at-end-of-file fixes from Andrew Taylor <Andrew.Taylor@cal.montage.ca>. - Fixed case in nsIDirectoryEnumerator.idl - Added |normalize()|, |truncate()| and |target|, |isSpecial()| to nsIFile.idl - Changed |isExists()| to |exists()|, |fileName| to |leafName|, |isEqual()| to |equals| and added |in boolean recur| to |isContainedIn()|. - Corrected widespread misspelling of |NS_ERROR_FILE_UNRECOGNIZED_PATH|. - Partially updated Windows code to track changes. Partially addresses 17948, r=dougt git-svn-id: svn://10.0.0.236/trunk@54563 18797224-902f-48f8-a5cc-f745e15eee43
32 lines
1.0 KiB
C++
32 lines
1.0 KiB
C++
#include "nscore.h"
|
|
#include "nsIComponentManager.h"
|
|
#include "nsIFile.h"
|
|
#include "nsIDirectoryEnumerator.h"
|
|
#include "nsIDirEnumeratorImpl.h"
|
|
#include "nsFileUtils.h"
|
|
|
|
|
|
nsresult NS_COM
|
|
NS_NewFile(nsIFile** file)
|
|
{
|
|
return nsComponentManager::CreateInstance(NS_FILE_PROGID,
|
|
nsnull,
|
|
nsCOMTypeInfo<nsIFile>::GetIID(),
|
|
(void**)file);
|
|
}
|
|
|
|
nsresult NS_COM
|
|
NS_NewDirectoryEnumerator(nsIFile* parent, PRBool resolveSymlinks, nsIDirectoryEnumerator** enumerator)
|
|
{
|
|
nsresult rv = nsComponentManager::CreateInstance(NS_DIRECTORY_ENUMERATOR_PROGID,
|
|
nsnull,
|
|
nsCOMTypeInfo<nsIDirectoryEnumerator>::GetIID(),
|
|
(void**)enumerator);
|
|
|
|
if (NS_SUCCEEDED(rv) && *enumerator)
|
|
{
|
|
(*enumerator)->Init(parent, resolveSymlinks);
|
|
}
|
|
return rv;
|
|
}
|