Backed out changeset 2450366cf7ca (bug 1891629) for causing win msix mochitest failures
[gecko.git] / dom / quota / StreamUtils.h
blob6d755b6b0726d8e2b49dcd8b63ae402e182c250d
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef DOM_QUOTA_STREAMUTILS_H_
8 #define DOM_QUOTA_STREAMUTILS_H_
10 #include "nsStringFwd.h"
12 class nsIBinaryInputStream;
13 class nsIBinaryOutputStream;
14 template <class T>
15 class nsCOMPtr;
16 class nsIFile;
17 class nsIOutputStream;
18 enum class nsresult : uint32_t;
20 namespace mozilla {
22 template <typename V, typename E>
23 class Result;
25 namespace dom::quota {
27 enum FileFlag { Truncate, Update, Append };
29 Result<nsCOMPtr<nsIOutputStream>, nsresult> GetOutputStream(nsIFile& aFile,
30 FileFlag aFileFlag);
32 Result<nsCOMPtr<nsIBinaryOutputStream>, nsresult> GetBinaryOutputStream(
33 nsIFile& aFile, FileFlag aFileFlag);
35 Result<nsCOMPtr<nsIBinaryInputStream>, nsresult> GetBinaryInputStream(
36 nsIFile& aDirectory, const nsAString& aFilename);
38 } // namespace dom::quota
39 } // namespace mozilla
41 #endif // DOM_QUOTA_STREAMUTILS_H_