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
|
|
|
|
NS_GetSpecialDirectory(const char* specialDirName, nsIFile* *result)
|
|
|
|
{
|
2014-05-05 21:30:43 +04:00
|
|
|
nsresult rv;
|
|
|
|
nsCOMPtr<nsIProperties> serv(do_GetService(NS_DIRECTORY_SERVICE_CONTRACTID, &rv));
|
|
|
|
if (NS_FAILED(rv))
|
|
|
|
return rv;
|
2002-03-20 03:34:17 +03:00
|
|
|
|
2014-05-05 21:30:43 +04:00
|
|
|
return serv->Get(specialDirName, NS_GET_IID(nsIFile),
|
|
|
|
reinterpret_cast<void**>(result));
|
2002-03-20 03:34:17 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|