tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

StreamUtils.h (1209B)


      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/. */
      6 
      7 #ifndef DOM_QUOTA_STREAMUTILS_H_
      8 #define DOM_QUOTA_STREAMUTILS_H_
      9 
     10 #include "nsStringFwd.h"
     11 
     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;
     19 
     20 namespace mozilla {
     21 
     22 template <typename V, typename E>
     23 class Result;
     24 
     25 namespace dom::quota {
     26 
     27 enum FileFlag { Truncate, Update, Append };
     28 
     29 Result<nsCOMPtr<nsIOutputStream>, nsresult> GetOutputStream(nsIFile& aFile,
     30                                                            FileFlag aFileFlag);
     31 
     32 Result<nsCOMPtr<nsIBinaryOutputStream>, nsresult> GetBinaryOutputStream(
     33    nsIFile& aFile, FileFlag aFileFlag);
     34 
     35 Result<nsCOMPtr<nsIBinaryInputStream>, nsresult> GetBinaryInputStream(
     36    nsIFile& aDirectory, const nsAString& aFilename);
     37 
     38 }  // namespace dom::quota
     39 }  // namespace mozilla
     40 
     41 #endif  // DOM_QUOTA_STREAMUTILS_H_