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/. */
|
2002-03-20 00:34:17 +00:00
|
|
|
|
|
|
|
#ifndef nsDirectoryServiceUtils_h___
|
|
|
|
#define nsDirectoryServiceUtils_h___
|
|
|
|
|
|
|
|
#include "nsIServiceManager.h"
|
|
|
|
#include "nsIProperties.h"
|
2005-04-06 03:35:24 +00:00
|
|
|
#include "nsServiceManagerUtils.h"
|
2002-03-20 00:34:17 +00:00
|
|
|
#include "nsCOMPtr.h"
|
2005-04-06 03:35:24 +00:00
|
|
|
#include "nsXPCOMCID.h"
|
2005-11-30 18:02:27 +00:00
|
|
|
#include "nsIFile.h"
|
2002-03-20 00:34:17 +00:00
|
|
|
|
|
|
|
inline nsresult
|
2014-05-14 20:15:46 +00:00
|
|
|
NS_GetSpecialDirectory(const char* aSpecialDirName, nsIFile** aResult)
|
2002-03-20 00:34:17 +00:00
|
|
|
{
|
2014-05-05 17:30:43 +00:00
|
|
|
nsresult rv;
|
2014-08-25 19:17:24 +00:00
|
|
|
nsCOMPtr<nsIProperties> serv(do_GetService(NS_DIRECTORY_SERVICE_CONTRACTID,
|
|
|
|
&rv));
|
2014-05-14 20:15:46 +00:00
|
|
|
if (NS_FAILED(rv)) {
|
2014-05-05 17:30:43 +00:00
|
|
|
return rv;
|
2014-05-14 20:15:46 +00:00
|
|
|
}
|
2002-03-20 00:34:17 +00:00
|
|
|
|
2014-05-14 20:15:46 +00:00
|
|
|
return serv->Get(aSpecialDirName, NS_GET_IID(nsIFile),
|
|
|
|
reinterpret_cast<void**>(aResult));
|
2002-03-20 00:34:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|