Bug 1466812 [wpt PR 11352] - [css-contain] Fix references to paint instead of layout...
[gecko.git] / xpcom / base / nsGZFileWriter.h
blob4bb91173c3c14d76a88d43cf190a6105ca5891b3
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.
16 class nsGZFileWriter final : public nsIGZFileWriter
18 virtual ~nsGZFileWriter();
20 public:
22 enum Operation {
23 Append,
24 Create
28 explicit nsGZFileWriter(Operation aMode = Create);
30 NS_DECL_ISUPPORTS
31 NS_DECL_NSIGZFILEWRITER
33 /**
34 * nsIGZFileWriter exposes two non-virtual overloads of Write(). We
35 * duplicate them here so that you can call these overloads on a pointer to
36 * the concrete nsGZFileWriter class.
38 MOZ_MUST_USE nsresult Write(const char* aStr)
40 return nsIGZFileWriter::Write(aStr);
43 MOZ_MUST_USE nsresult Write(const char* aStr, uint32_t aLen)
45 return nsIGZFileWriter::Write(aStr, aLen);
48 private:
49 Operation mMode;
50 bool mInitialized;
51 bool mFinished;
52 gzFile mGZFile;
55 #endif