1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/ossrv/compressionlibs/ziplib/inc/ezstream.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,71 @@
1.4 +// Copyright (c) 1999-2009 Nokia Corporation and/or its subsidiary(-ies).
1.5 +// All rights reserved.
1.6 +// This component and the accompanying materials are made available
1.7 +// under the terms of "Eclipse Public License v1.0"
1.8 +// which accompanies this distribution, and is available
1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.10 +//
1.11 +// Initial Contributors:
1.12 +// Nokia Corporation - initial contribution.
1.13 +//
1.14 +// Contributors:
1.15 +//
1.16 +// Description:
1.17 +// Declaration for CEZStream class.
1.18 +//
1.19 +//
1.20 +
1.21 +#ifndef __EZZSTREAM_H__
1.22 +#define __EZZSTREAM_H__
1.23 +
1.24 +#include <e32base.h>
1.25 +#include <ezlib.h>
1.26 +#include <ezliberrorcodes.h>
1.27 +
1.28 +/**
1.29 +Represents a zip stream
1.30 +
1.31 +@publishedAll
1.32 +@released
1.33 +*/
1.34 +class CEZZStream : public CBase
1.35 + {
1.36 +public:
1.37 +/** stream panic values */
1.38 + enum
1.39 + {
1.40 + EStreamError = -Z_STREAM_ERROR,
1.41 + EDataError = -Z_DATA_ERROR,
1.42 + EBufError = -Z_BUF_ERROR,
1.43 + EVersionError = -Z_VERSION_ERROR,
1.44 + EUnexpected
1.45 + };
1.46 +public:
1.47 + IMPORT_C void SetInput(const TDesC8& aInputData);
1.48 + IMPORT_C void SetOutput(TDes8& aOutputData);
1.49 +
1.50 + IMPORT_C TPtrC8 OutputDescriptor() const;
1.51 + IMPORT_C TInt TotalOut() const;
1.52 + IMPORT_C TInt TotalIn() const;
1.53 + IMPORT_C TInt32 Adler32() const;
1.54 + IMPORT_C TInt AvailIn() const;
1.55 + IMPORT_C TInt AvailOut() const;
1.56 +
1.57 + IMPORT_C TInt Progress(TInt aTotalLength) const;
1.58 +
1.59 +protected:
1.60 + CEZZStream();
1.61 +
1.62 +
1.63 +protected:
1.64 + z_stream iStream;
1.65 +
1.66 + // This pointer is reset every time SetOutput is called. It maintains a pointer to the
1.67 + // start of the output buffer which is being written to. We cannot use iStream.next_out,
1.68 + // because zlib will modifify this during its deflate and inflate.
1.69 +
1.70 + TUint8* iOutputPointer;
1.71 + TInt iOutputBufferLength;
1.72 + };
1.73 +
1.74 +#endif