2007-03-22 10:30:00 -07:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 04:12:37 -07:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
#ifndef nsDirectoryService_h___
|
|
|
|
#define nsDirectoryService_h___
|
|
|
|
|
|
|
|
#include "nsIDirectoryService.h"
|
2013-07-24 00:40:40 -07:00
|
|
|
#include "nsInterfaceHashtable.h"
|
2012-06-05 19:08:30 -07:00
|
|
|
#include "nsIFile.h"
|
2007-03-22 10:30:00 -07:00
|
|
|
#include "nsIAtom.h"
|
2013-03-17 00:55:16 -07:00
|
|
|
#include "nsTArray.h"
|
2012-06-05 16:51:58 -07:00
|
|
|
#include "mozilla/Attributes.h"
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
#define NS_XPCOM_INIT_CURRENT_PROCESS_DIR "MozBinD" // Can be used to set NS_XPCOM_CURRENT_PROCESS_DIR
|
|
|
|
// CANNOT be used to GET a location
|
|
|
|
#define NS_DIRECTORY_SERVICE_CID {0xf00152d0,0xb40b,0x11d3,{0x8c, 0x9c, 0x00, 0x00, 0x64, 0x65, 0x73, 0x74}}
|
|
|
|
|
2012-06-05 16:51:58 -07:00
|
|
|
class nsDirectoryService MOZ_FINAL : public nsIDirectoryService,
|
|
|
|
public nsIProperties,
|
|
|
|
public nsIDirectoryServiceProvider2
|
2007-03-22 10:30:00 -07:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
// nsISupports interface
|
2013-07-18 19:31:26 -07:00
|
|
|
NS_DECL_THREADSAFE_ISUPPORTS
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
NS_DECL_NSIPROPERTIES
|
|
|
|
|
|
|
|
NS_DECL_NSIDIRECTORYSERVICE
|
|
|
|
|
|
|
|
NS_DECL_NSIDIRECTORYSERVICEPROVIDER
|
|
|
|
|
|
|
|
NS_DECL_NSIDIRECTORYSERVICEPROVIDER2
|
|
|
|
|
|
|
|
nsDirectoryService();
|
|
|
|
~nsDirectoryService();
|
|
|
|
|
2012-08-21 05:02:37 -07:00
|
|
|
static void RealInit();
|
2007-03-22 10:30:00 -07:00
|
|
|
void RegisterCategoryProviders();
|
|
|
|
|
2010-06-10 11:11:11 -07:00
|
|
|
static nsresult
|
2007-03-22 10:30:00 -07:00
|
|
|
Create(nsISupports *aOuter, REFNSIID aIID, void **aResult);
|
|
|
|
|
|
|
|
static nsDirectoryService* gService;
|
|
|
|
|
|
|
|
private:
|
2012-06-05 19:08:30 -07:00
|
|
|
nsresult GetCurrentProcessDirectory(nsIFile** aFile);
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2013-07-24 00:40:40 -07:00
|
|
|
nsInterfaceHashtable<nsCStringHashKey, nsIFile> mHashtable;
|
2012-08-21 05:02:37 -07:00
|
|
|
nsTArray<nsCOMPtr<nsIDirectoryServiceProvider> > mProviders;
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
public:
|
|
|
|
|
2010-03-08 07:44:59 -08:00
|
|
|
#define DIR_ATOM(name_, value_) static nsIAtom* name_;
|
|
|
|
#include "nsDirectoryServiceAtomList.h"
|
|
|
|
#undef DIR_ATOM
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|