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"
14 * A simple class for writing .gz files.
16 class nsGZFileWriter final
: public nsIGZFileWriter
{
17 virtual ~nsGZFileWriter();
20 enum Operation
{ Append
, Create
};
22 explicit nsGZFileWriter(Operation aMode
= Create
);
25 NS_DECL_NSIGZFILEWRITER
28 * nsIGZFileWriter exposes two non-virtual overloads of Write(). We
29 * duplicate them here so that you can call these overloads on a pointer
30 * to the concrete nsGZFileWriter class.
32 [[nodiscard
]] nsresult
Write(const char* aStr
) {
33 return nsIGZFileWriter::Write(aStr
);
36 [[nodiscard
]] nsresult
Write(const char* aStr
, uint32_t aLen
) {
37 return nsIGZFileWriter::Write(aStr
, aLen
);