author | William Roberts <williamr@symbian.org> |
Wed, 31 Mar 2010 12:33:34 +0100 | |
branch | Symbian3 |
changeset 4 | 837f303aceeb |
parent 2 | 2fe1408b6811 |
permissions | -rw-r--r-- |
williamr@2 | 1 |
// Copyright (c) 1999-2009 Nokia Corporation and/or its subsidiary(-ies). |
williamr@2 | 2 |
// All rights reserved. |
williamr@2 | 3 |
// This component and the accompanying materials are made available |
williamr@4 | 4 |
// under the terms of "Eclipse Public License v1.0" |
williamr@2 | 5 |
// which accompanies this distribution, and is available |
williamr@4 | 6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html". |
williamr@2 | 7 |
// |
williamr@2 | 8 |
// Initial Contributors: |
williamr@2 | 9 |
// Nokia Corporation - initial contribution. |
williamr@2 | 10 |
// |
williamr@2 | 11 |
// Contributors: |
williamr@2 | 12 |
// |
williamr@2 | 13 |
// Description: |
williamr@2 | 14 |
// Declaration for CEZStream class. |
williamr@2 | 15 |
// |
williamr@2 | 16 |
// |
williamr@2 | 17 |
|
williamr@2 | 18 |
#ifndef __EZZSTREAM_H__ |
williamr@2 | 19 |
#define __EZZSTREAM_H__ |
williamr@2 | 20 |
|
williamr@2 | 21 |
#include <e32base.h> |
williamr@4 | 22 |
#include <ezlib.h> |
williamr@2 | 23 |
#include <ezliberrorcodes.h> |
williamr@2 | 24 |
|
williamr@2 | 25 |
/** |
williamr@2 | 26 |
Represents a zip stream |
williamr@2 | 27 |
|
williamr@2 | 28 |
@publishedAll |
williamr@2 | 29 |
@released |
williamr@2 | 30 |
*/ |
williamr@2 | 31 |
class CEZZStream : public CBase |
williamr@2 | 32 |
{ |
williamr@2 | 33 |
public: |
williamr@2 | 34 |
/** stream panic values */ |
williamr@2 | 35 |
enum |
williamr@2 | 36 |
{ |
williamr@2 | 37 |
EStreamError = -Z_STREAM_ERROR, |
williamr@2 | 38 |
EDataError = -Z_DATA_ERROR, |
williamr@2 | 39 |
EBufError = -Z_BUF_ERROR, |
williamr@2 | 40 |
EVersionError = -Z_VERSION_ERROR, |
williamr@2 | 41 |
EUnexpected |
williamr@2 | 42 |
}; |
williamr@2 | 43 |
public: |
williamr@2 | 44 |
IMPORT_C void SetInput(const TDesC8& aInputData); |
williamr@2 | 45 |
IMPORT_C void SetOutput(TDes8& aOutputData); |
williamr@2 | 46 |
|
williamr@2 | 47 |
IMPORT_C TPtrC8 OutputDescriptor() const; |
williamr@2 | 48 |
IMPORT_C TInt TotalOut() const; |
williamr@2 | 49 |
IMPORT_C TInt TotalIn() const; |
williamr@2 | 50 |
IMPORT_C TInt32 Adler32() const; |
williamr@2 | 51 |
IMPORT_C TInt AvailIn() const; |
williamr@2 | 52 |
IMPORT_C TInt AvailOut() const; |
williamr@2 | 53 |
|
williamr@2 | 54 |
IMPORT_C TInt Progress(TInt aTotalLength) const; |
williamr@2 | 55 |
|
williamr@2 | 56 |
protected: |
williamr@2 | 57 |
CEZZStream(); |
williamr@2 | 58 |
|
williamr@2 | 59 |
|
williamr@2 | 60 |
protected: |
williamr@2 | 61 |
z_stream iStream; |
williamr@2 | 62 |
|
williamr@2 | 63 |
// This pointer is reset every time SetOutput is called. It maintains a pointer to the |
williamr@2 | 64 |
// start of the output buffer which is being written to. We cannot use iStream.next_out, |
williamr@2 | 65 |
// because zlib will modifify this during its deflate and inflate. |
williamr@2 | 66 |
|
williamr@2 | 67 |
TUint8* iOutputPointer; |
williamr@2 | 68 |
TInt iOutputBufferLength; |
williamr@2 | 69 |
}; |
williamr@2 | 70 |
|
williamr@2 | 71 |
#endif |