epoc32/include/ezstream.h
author William Roberts <williamr@symbian.org>
Wed, 31 Mar 2010 12:27:01 +0100
branchSymbian2
changeset 3 e1b950c65cb4
parent 0 061f57f2323e
child 4 837f303aceeb
permissions -rw-r--r--
Attempt to represent the S^2->S^3 header reorganisation as a series of "hg rename" operations
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@2
     4
// 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
williamr@2
     5
// which accompanies this distribution, and is available
williamr@2
     6
// at the URL "http://www.symbianfoundation.org/legal/licencesv10.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
// EZLib: ZSTREAM.H
williamr@2
    15
// Declaration for CEZStream class.  
williamr@2
    16
// 
williamr@2
    17
//
williamr@2
    18
williamr@2
    19
#ifndef __EZZSTREAM_H__
williamr@2
    20
#define __EZZSTREAM_H__
williamr@2
    21
williamr@2
    22
#include <e32base.h>
williamr@2
    23
#include <ezlib.h>
williamr@2
    24
#include <ezliberrorcodes.h>
williamr@2
    25
williamr@2
    26
/**
williamr@2
    27
Represents a zip stream
williamr@2
    28
williamr@2
    29
@publishedAll
williamr@2
    30
@released
williamr@2
    31
*/
williamr@2
    32
class CEZZStream : public CBase
williamr@2
    33
	{
williamr@2
    34
public:
williamr@2
    35
/** stream panic values */
williamr@2
    36
	enum 
williamr@2
    37
		{
williamr@2
    38
		EStreamError = -Z_STREAM_ERROR,
williamr@2
    39
		EDataError = -Z_DATA_ERROR,
williamr@2
    40
		EBufError = -Z_BUF_ERROR,
williamr@2
    41
		EVersionError = -Z_VERSION_ERROR,
williamr@2
    42
		EUnexpected
williamr@2
    43
		};
williamr@2
    44
public:
williamr@2
    45
	IMPORT_C void SetInput(const TDesC8& aInputData);
williamr@2
    46
	IMPORT_C void SetOutput(TDes8& aOutputData);
williamr@2
    47
williamr@2
    48
	IMPORT_C TPtrC8 OutputDescriptor() const;
williamr@2
    49
	IMPORT_C TInt TotalOut() const;
williamr@2
    50
	IMPORT_C TInt TotalIn() const;
williamr@2
    51
	IMPORT_C TInt32 Adler32() const;
williamr@2
    52
	IMPORT_C TInt AvailIn() const;
williamr@2
    53
	IMPORT_C TInt AvailOut() const;
williamr@2
    54
williamr@2
    55
	IMPORT_C TInt Progress(TInt aTotalLength) const;
williamr@2
    56
	
williamr@2
    57
protected:
williamr@2
    58
	CEZZStream();
williamr@2
    59
williamr@2
    60
	
williamr@2
    61
protected:
williamr@2
    62
	z_stream iStream;
williamr@2
    63
williamr@2
    64
	// This pointer is reset every time SetOutput is called.  It maintains a pointer to the
williamr@2
    65
	// start of the output buffer which is being written to.  We cannot use iStream.next_out,
williamr@2
    66
	// because zlib will modifify this during its deflate and inflate.
williamr@2
    67
	
williamr@2
    68
	TUint8* iOutputPointer;
williamr@2
    69
	TInt iOutputBufferLength;
williamr@2
    70
	};
williamr@2
    71
williamr@2
    72
#endif