2014-05-05 10:30:43 -07: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 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}}
|
|
|
|
|
2014-05-14 13:15:46 -07:00
|
|
|
class nsDirectoryService MOZ_FINAL
|
|
|
|
: public nsIDirectoryService
|
|
|
|
, public nsIProperties
|
|
|
|
, public nsIDirectoryServiceProvider2
|
2007-03-22 10:30:00 -07:00
|
|
|
{
|
2014-05-05 10:30:43 -07:00
|
|
|
public:
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
// nsISupports interface
|
2013-07-18 19:31:26 -07:00
|
|
|
NS_DECL_THREADSAFE_ISUPPORTS
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2014-05-05 10:30:43 -07:00
|
|
|
NS_DECL_NSIPROPERTIES
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
NS_DECL_NSIDIRECTORYSERVICE
|
|
|
|
|
|
|
|
NS_DECL_NSIDIRECTORYSERVICEPROVIDER
|
2014-05-05 10:30:43 -07:00
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
NS_DECL_NSIDIRECTORYSERVICEPROVIDER2
|
|
|
|
|
|
|
|
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
|
2014-05-14 13:15:46 -07:00
|
|
|
Create(nsISupports* aOuter, REFNSIID aIID, void** aResult);
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
static nsDirectoryService* gService;
|
|
|
|
|
|
|
|
private:
|
2014-06-30 15:11:53 -07:00
|
|
|
~nsDirectoryService();
|
|
|
|
|
2014-05-05 10:30:43 -07:00
|
|
|
nsresult GetCurrentProcessDirectory(nsIFile** aFile);
|
|
|
|
|
|
|
|
nsInterfaceHashtable<nsCStringHashKey, nsIFile> mHashtable;
|
2014-05-14 13:15:46 -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
|
|
|
|
|