mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-03 10:33:33 +00:00
0f1164855f
Not hooked up to build, yet.
31 lines
1.0 KiB
C++
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;
|
|
} |