1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef nsDirectoryService_h___
8 #define nsDirectoryService_h___
10 #include "nsIDirectoryService.h"
11 #include "nsInterfaceHashtable.h"
15 #include "mozilla/Attributes.h"
17 #define NS_XPCOM_INIT_CURRENT_PROCESS_DIR "MozBinD" // Can be used to set NS_XPCOM_CURRENT_PROCESS_DIR
18 // CANNOT be used to GET a location
19 #define NS_DIRECTORY_SERVICE_CID {0xf00152d0,0xb40b,0x11d3,{0x8c, 0x9c, 0x00, 0x00, 0x64, 0x65, 0x73, 0x74}}
21 class nsDirectoryService MOZ_FINAL
22 : public nsIDirectoryService
23 , public nsIProperties
24 , public nsIDirectoryServiceProvider2
27 NS_DECL_THREADSAFE_ISUPPORTS
31 NS_DECL_NSIDIRECTORYSERVICE
33 NS_DECL_NSIDIRECTORYSERVICEPROVIDER
35 NS_DECL_NSIDIRECTORYSERVICEPROVIDER2
39 static void RealInit();
40 void RegisterCategoryProviders();
43 Create(nsISupports
* aOuter
, REFNSIID aIID
, void** aResult
);
45 static nsDirectoryService
* gService
;
48 ~nsDirectoryService();
50 nsresult
GetCurrentProcessDirectory(nsIFile
** aFile
);
52 nsInterfaceHashtable
<nsCStringHashKey
, nsIFile
> mHashtable
;
53 nsTArray
<nsCOMPtr
<nsIDirectoryServiceProvider
>> mProviders
;
57 #define DIR_ATOM(name_, value_) static nsIAtom* name_;
58 #include "nsDirectoryServiceAtomList.h"