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