michael@0: /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* vim: set ts=8 sts=2 et sw=2 tw=80: */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #ifndef nsGZFileWriter_h michael@0: #define nsGZFileWriter_h michael@0: michael@0: #include "nsIGZFileWriter.h" michael@0: #include "zlib.h" michael@0: michael@0: /** michael@0: * A simple class for writing .gz files. michael@0: */ michael@0: class nsGZFileWriter : public nsIGZFileWriter michael@0: { michael@0: public: michael@0: nsGZFileWriter(); michael@0: virtual ~nsGZFileWriter(); michael@0: michael@0: NS_DECL_ISUPPORTS michael@0: NS_DECL_NSIGZFILEWRITER michael@0: michael@0: /** michael@0: * nsIGZFileWriter exposes two non-virtual overloads of Write(). We michael@0: * duplicate them here so that you can call these overloads on a pointer to michael@0: * the concrete nsGZFileWriter class. michael@0: */ michael@0: nsresult Write(const char* aStr) michael@0: { michael@0: return nsIGZFileWriter::Write(aStr); michael@0: } michael@0: michael@0: nsresult Write(const char* aStr, uint32_t aLen) michael@0: { michael@0: return nsIGZFileWriter::Write(aStr, aLen); michael@0: } michael@0: michael@0: private: michael@0: bool mInitialized; michael@0: bool mFinished; michael@0: gzFile mGZFile; michael@0: }; michael@0: michael@0: #endif