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
;
17 class nsIOutputStream
;
18 enum class nsresult
: uint32_t;
22 template <typename V
, typename E
>
25 namespace dom::quota
{
27 enum FileFlag
{ Truncate
, Update
, Append
};
29 Result
<nsCOMPtr
<nsIOutputStream
>, nsresult
> GetOutputStream(nsIFile
& aFile
,
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_