michael@0: /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #ifndef nsDirectoryServiceUtils_h___ michael@0: #define nsDirectoryServiceUtils_h___ michael@0: michael@0: #include "nsIServiceManager.h" michael@0: #include "nsIProperties.h" michael@0: #include "nsServiceManagerUtils.h" michael@0: #include "nsCOMPtr.h" michael@0: #include "nsXPCOMCID.h" michael@0: #include "nsIFile.h" michael@0: michael@0: inline nsresult michael@0: NS_GetSpecialDirectory(const char* specialDirName, nsIFile* *result) michael@0: { michael@0: nsresult rv; michael@0: nsCOMPtr serv(do_GetService(NS_DIRECTORY_SERVICE_CONTRACTID, &rv)); michael@0: if (NS_FAILED(rv)) michael@0: return rv; michael@0: michael@0: return serv->Get(specialDirName, NS_GET_IID(nsIFile), michael@0: reinterpret_cast(result)); michael@0: } michael@0: michael@0: #endif