sl@0: // Copyright (c) 1999-2009 Nokia Corporation and/or its subsidiary(-ies).
sl@0: // All rights reserved.
sl@0: // This component and the accompanying materials are made available
sl@0: // under the terms of "Eclipse Public License v1.0"
sl@0: // which accompanies this distribution, and is available
sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html".
sl@0: //
sl@0: // Initial Contributors:
sl@0: // Nokia Corporation - initial contribution.
sl@0: //
sl@0: // Contributors:
sl@0: //
sl@0: // Description:
sl@0: // Declaration for CEZStream class.  
sl@0: // 
sl@0: //
sl@0: 
sl@0: #ifndef __EZZSTREAM_H__
sl@0: #define __EZZSTREAM_H__
sl@0: 
sl@0: #include <e32base.h>
sl@0: #include <ezlib.h> 
sl@0: #include <ezliberrorcodes.h>
sl@0: 
sl@0: /**
sl@0: Represents a zip stream
sl@0: 
sl@0: @publishedAll
sl@0: @released
sl@0: */
sl@0: class CEZZStream : public CBase
sl@0: 	{
sl@0: public:
sl@0: /** stream panic values */
sl@0: 	enum 
sl@0: 		{
sl@0: 		EStreamError = -Z_STREAM_ERROR,
sl@0: 		EDataError = -Z_DATA_ERROR,
sl@0: 		EBufError = -Z_BUF_ERROR,
sl@0: 		EVersionError = -Z_VERSION_ERROR,
sl@0: 		EUnexpected
sl@0: 		};
sl@0: public:
sl@0: 	IMPORT_C void SetInput(const TDesC8& aInputData);
sl@0: 	IMPORT_C void SetOutput(TDes8& aOutputData);
sl@0: 
sl@0: 	IMPORT_C TPtrC8 OutputDescriptor() const;
sl@0: 	IMPORT_C TInt TotalOut() const;
sl@0: 	IMPORT_C TInt TotalIn() const;
sl@0: 	IMPORT_C TInt32 Adler32() const;
sl@0: 	IMPORT_C TInt AvailIn() const;
sl@0: 	IMPORT_C TInt AvailOut() const;
sl@0: 
sl@0: 	IMPORT_C TInt Progress(TInt aTotalLength) const;
sl@0: 	
sl@0: protected:
sl@0: 	CEZZStream();
sl@0: 
sl@0: 	
sl@0: protected:
sl@0: 	z_stream iStream;
sl@0: 
sl@0: 	// This pointer is reset every time SetOutput is called.  It maintains a pointer to the
sl@0: 	// start of the output buffer which is being written to.  We cannot use iStream.next_out,
sl@0: 	// because zlib will modifify this during its deflate and inflate.
sl@0: 	
sl@0: 	TUint8* iOutputPointer;
sl@0: 	TInt iOutputBufferLength;
sl@0: 	};
sl@0: 
sl@0: #endif