gecko-dev/xpcom/io/nsFileUtils.cpp
1999-10-25 22:44:42 +00:00

31 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;
}