tor-browser

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

nsConverterOutputStream.h (954B)


      1 /* vim:set expandtab ts=4 sw=2 sts=2 cin: */
      2 /* This Source Code Form is subject to the terms of the Mozilla Public
      3 * License, v. 2.0. If a copy of the MPL was not distributed with this
      4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
      5 
      6 #ifndef NSCONVERTEROUTPUTSTREAM_H_
      7 #define NSCONVERTEROUTPUTSTREAM_H_
      8 
      9 #include "nsIConverterOutputStream.h"
     10 #include "nsCOMPtr.h"
     11 #include "mozilla/Encoding.h"
     12 
     13 class nsIOutputStream;
     14 
     15 /* ff8780a5-bbb1-4bc5-8ee7-057e7bc5c925 */
     16 #define NS_CONVERTEROUTPUTSTREAM_CID \
     17  {0xff8780a5, 0xbbb1, 0x4bc5, {0x8e, 0xe7, 0x05, 0x7e, 0x7b, 0xc5, 0xc9, 0x25}}
     18 
     19 class nsConverterOutputStream final : public nsIConverterOutputStream {
     20 public:
     21  nsConverterOutputStream() = default;
     22 
     23  NS_DECL_ISUPPORTS
     24  NS_DECL_NSIUNICHAROUTPUTSTREAM
     25  NS_DECL_NSICONVERTEROUTPUTSTREAM
     26 
     27 private:
     28  ~nsConverterOutputStream();
     29 
     30  mozilla::UniquePtr<mozilla::Encoder> mConverter;
     31  nsCOMPtr<nsIOutputStream> mOutStream;
     32 };
     33 
     34 #endif