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