2014-05-05 17:30:43 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
2012-05-21 11:12:37 +00: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/. */
|
1999-12-22 01:56:45 +00:00
|
|
|
|
|
|
|
#ifndef nsDirectoryService_h___
|
|
|
|
#define nsDirectoryService_h___
|
|
|
|
|
2000-02-21 21:51:47 +00:00
|
|
|
#include "nsIDirectoryService.h"
|
2013-07-24 07:40:40 +00:00
|
|
|
#include "nsInterfaceHashtable.h"
|
2012-06-06 02:08:30 +00:00
|
|
|
#include "nsIFile.h"
|
2002-07-25 18:31:10 +00:00
|
|
|
#include "nsIAtom.h"
|
2013-03-17 07:55:16 +00:00
|
|
|
#include "nsTArray.h"
|
2012-06-05 23:51:58 +00:00
|
|
|
#include "mozilla/Attributes.h"
|
2000-08-16 22:40:27 +00:00
|
|
|
|
2002-09-27 13:07:01 +00: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
|
2005-04-06 03:35:24 +00:00
|
|
|
#define NS_DIRECTORY_SERVICE_CID {0xf00152d0,0xb40b,0x11d3,{0x8c, 0x9c, 0x00, 0x00, 0x64, 0x65, 0x73, 0x74}}
|
2002-09-27 13:07:01 +00:00
|
|
|
|
2015-03-21 16:28:04 +00:00
|
|
|
class nsDirectoryService final
|
2014-05-14 20:15:46 +00:00
|
|
|
: public nsIDirectoryService
|
|
|
|
, public nsIProperties
|
|
|
|
, public nsIDirectoryServiceProvider2
|
2000-02-21 21:51:47 +00:00
|
|
|
{
|
2014-05-05 17:30:43 +00:00
|
|
|
public:
|
2013-07-19 02:31:26 +00:00
|
|
|
NS_DECL_THREADSAFE_ISUPPORTS
|
1999-12-22 01:56:45 +00:00
|
|
|
|
2014-05-05 17:30:43 +00:00
|
|
|
NS_DECL_NSIPROPERTIES
|
1999-12-22 01:56:45 +00:00
|
|
|
|
2000-02-21 21:51:47 +00:00
|
|
|
NS_DECL_NSIDIRECTORYSERVICE
|
1999-12-22 01:56:45 +00:00
|
|
|
|
2000-02-21 21:51:47 +00:00
|
|
|
NS_DECL_NSIDIRECTORYSERVICEPROVIDER
|
2014-05-05 17:30:43 +00:00
|
|
|
|
2001-11-02 15:29:57 +00:00
|
|
|
NS_DECL_NSIDIRECTORYSERVICEPROVIDER2
|
1999-12-22 01:56:45 +00:00
|
|
|
|
2000-02-21 21:51:47 +00:00
|
|
|
nsDirectoryService();
|
2005-06-07 19:35:20 +00:00
|
|
|
|
2012-08-21 12:02:37 +00:00
|
|
|
static void RealInit();
|
2005-06-07 19:35:20 +00:00
|
|
|
void RegisterCategoryProviders();
|
1999-12-22 01:56:45 +00:00
|
|
|
|
2010-06-10 18:11:11 +00:00
|
|
|
static nsresult
|
2014-05-14 20:15:46 +00:00
|
|
|
Create(nsISupports* aOuter, REFNSIID aIID, void** aResult);
|
1999-12-22 01:56:45 +00:00
|
|
|
|
2016-07-20 22:40:33 +00:00
|
|
|
static nsDirectoryService* gService;
|
2004-01-15 06:14:18 +00:00
|
|
|
|
2005-06-07 19:35:20 +00:00
|
|
|
private:
|
2014-06-30 22:11:53 +00:00
|
|
|
~nsDirectoryService();
|
|
|
|
|
2014-05-05 17:30:43 +00:00
|
|
|
nsresult GetCurrentProcessDirectory(nsIFile** aFile);
|
|
|
|
|
|
|
|
nsInterfaceHashtable<nsCStringHashKey, nsIFile> mHashtable;
|
2014-05-14 20:15:46 +00:00
|
|
|
nsTArray<nsCOMPtr<nsIDirectoryServiceProvider>> mProviders;
|
2000-04-25 01:48:02 +00:00
|
|
|
|
2003-04-03 20:02:03 +00:00
|
|
|
public:
|
2000-04-25 01:48:02 +00:00
|
|
|
|
2010-03-08 15:44:59 +00:00
|
|
|
#define DIR_ATOM(name_, value_) static nsIAtom* name_;
|
|
|
|
#include "nsDirectoryServiceAtomList.h"
|
|
|
|
#undef DIR_ATOM
|
2000-04-25 01:48:02 +00:00
|
|
|
|
1999-12-22 01:56:45 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2000-01-24 21:28:28 +00:00
|
|
|
#endif
|
|
|
|
|