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