xpcom/base/nsGZFileWriter.h

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     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 nsGZFileWriter_h
     8 #define nsGZFileWriter_h
    10 #include "nsIGZFileWriter.h"
    11 #include "zlib.h"
    13 /**
    14  * A simple class for writing .gz files.
    15  */
    16 class nsGZFileWriter : public nsIGZFileWriter
    17 {
    18 public:
    19   nsGZFileWriter();
    20   virtual ~nsGZFileWriter();
    22   NS_DECL_ISUPPORTS
    23   NS_DECL_NSIGZFILEWRITER
    25   /**
    26    * nsIGZFileWriter exposes two non-virtual overloads of Write().  We
    27    * duplicate them here so that you can call these overloads on a pointer to
    28    * the concrete nsGZFileWriter class.
    29    */
    30   nsresult Write(const char* aStr)
    31   {
    32     return nsIGZFileWriter::Write(aStr);
    33   }
    35   nsresult Write(const char* aStr, uint32_t aLen)
    36   {
    37     return nsIGZFileWriter::Write(aStr, aLen);
    38   }
    40 private:
    41   bool mInitialized;
    42   bool mFinished;
    43   gzFile mGZFile;
    44 };
    46 #endif

mercurial