xpcom/io/nsDirectoryService.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/xpcom/io/nsDirectoryService.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,64 @@
     1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.8 +
     1.9 +#ifndef nsDirectoryService_h___
    1.10 +#define nsDirectoryService_h___
    1.11 +
    1.12 +#include "nsIDirectoryService.h"
    1.13 +#include "nsInterfaceHashtable.h"
    1.14 +#include "nsIFile.h"
    1.15 +#include "nsIAtom.h"
    1.16 +#include "nsTArray.h"
    1.17 +#include "mozilla/Attributes.h"
    1.18 +
    1.19 +#define NS_XPCOM_INIT_CURRENT_PROCESS_DIR       "MozBinD"   // Can be used to set NS_XPCOM_CURRENT_PROCESS_DIR
    1.20 +                                                            // CANNOT be used to GET a location
    1.21 +#define NS_DIRECTORY_SERVICE_CID  {0xf00152d0,0xb40b,0x11d3,{0x8c, 0x9c, 0x00, 0x00, 0x64, 0x65, 0x73, 0x74}}
    1.22 +
    1.23 +class nsDirectoryService MOZ_FINAL : public nsIDirectoryService,
    1.24 +                                     public nsIProperties,
    1.25 +                                     public nsIDirectoryServiceProvider2
    1.26 +{
    1.27 +  public:
    1.28 +
    1.29 +  // nsISupports interface
    1.30 +  NS_DECL_THREADSAFE_ISUPPORTS
    1.31 +
    1.32 +  NS_DECL_NSIPROPERTIES  
    1.33 +
    1.34 +  NS_DECL_NSIDIRECTORYSERVICE
    1.35 +
    1.36 +  NS_DECL_NSIDIRECTORYSERVICEPROVIDER
    1.37 +  
    1.38 +  NS_DECL_NSIDIRECTORYSERVICEPROVIDER2
    1.39 +
    1.40 +  nsDirectoryService();
    1.41 +   ~nsDirectoryService();
    1.42 +
    1.43 +  static void RealInit();
    1.44 +  void RegisterCategoryProviders();
    1.45 +
    1.46 +  static nsresult
    1.47 +  Create(nsISupports *aOuter, REFNSIID aIID, void **aResult);
    1.48 +
    1.49 +  static nsDirectoryService* gService;
    1.50 +
    1.51 +private:
    1.52 +    nsresult GetCurrentProcessDirectory(nsIFile** aFile);
    1.53 +    
    1.54 +    nsInterfaceHashtable<nsCStringHashKey, nsIFile> mHashtable;
    1.55 +    nsTArray<nsCOMPtr<nsIDirectoryServiceProvider> > mProviders;
    1.56 +
    1.57 +public:
    1.58 +
    1.59 +#define DIR_ATOM(name_, value_) static nsIAtom* name_;
    1.60 +#include "nsDirectoryServiceAtomList.h"
    1.61 +#undef DIR_ATOM
    1.62 +
    1.63 +};
    1.64 +
    1.65 +
    1.66 +#endif
    1.67 +

mercurial