modules/libjar/zipwriter/src/nsZipDataStream.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/modules/libjar/zipwriter/src/nsZipDataStream.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,43 @@
     1.4 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.5 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.6 + * file, You can obtain one at http://mozilla.org/MPL/2.0/.
     1.7 + */
     1.8 +
     1.9 +#ifndef _nsZipDataStream_h_
    1.10 +#define _nsZipDataStream_h_
    1.11 +
    1.12 +#include "nsZipWriter.h"
    1.13 +#include "nsIOutputStream.h"
    1.14 +#include "nsIStreamListener.h"
    1.15 +#include "nsAutoPtr.h"
    1.16 +#include "mozilla/Attributes.h"
    1.17 +
    1.18 +class nsZipDataStream MOZ_FINAL : public nsIStreamListener
    1.19 +{
    1.20 +public:
    1.21 +    NS_DECL_THREADSAFE_ISUPPORTS
    1.22 +    NS_DECL_NSIREQUESTOBSERVER
    1.23 +    NS_DECL_NSISTREAMLISTENER
    1.24 +
    1.25 +    nsZipDataStream()
    1.26 +    {
    1.27 +    }
    1.28 +
    1.29 +    nsresult Init(nsZipWriter *aWriter, nsIOutputStream *aStream,
    1.30 +                  nsZipHeader *aHeader, int32_t aCompression);
    1.31 +
    1.32 +    nsresult ReadStream(nsIInputStream *aStream);
    1.33 +
    1.34 +private:
    1.35 +
    1.36 +    nsCOMPtr<nsIStreamListener> mOutput;
    1.37 +    nsCOMPtr<nsIOutputStream> mStream;
    1.38 +    nsRefPtr<nsZipWriter> mWriter;
    1.39 +    nsRefPtr<nsZipHeader> mHeader;
    1.40 +
    1.41 +    nsresult CompleteEntry();
    1.42 +    nsresult ProcessData(nsIRequest *aRequest, nsISupports *aContext,
    1.43 +                         char *aBuffer, uint64_t aOffset, uint32_t aCount);
    1.44 +};
    1.45 +
    1.46 +#endif

mercurial