epoc32/include/ezstream.h
branchSymbian2
changeset 2 2fe1408b6811
parent 0 061f57f2323e
child 4 837f303aceeb
equal deleted inserted replaced
1:666f914201fb 2:2fe1408b6811
     1 ezstream.h
     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 the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.symbianfoundation.org/legal/licencesv10.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 __EZZSTREAM_H__
       
    20 #define __EZZSTREAM_H__
       
    21 
       
    22 #include <e32base.h>
       
    23 #include <ezlib.h>
       
    24 #include <ezliberrorcodes.h>
       
    25 
       
    26 /**
       
    27 Represents a zip stream
       
    28 
       
    29 @publishedAll
       
    30 @released
       
    31 */
       
    32 class CEZZStream : public CBase
       
    33 	{
       
    34 public:
       
    35 /** stream panic values */
       
    36 	enum 
       
    37 		{
       
    38 		EStreamError = -Z_STREAM_ERROR,
       
    39 		EDataError = -Z_DATA_ERROR,
       
    40 		EBufError = -Z_BUF_ERROR,
       
    41 		EVersionError = -Z_VERSION_ERROR,
       
    42 		EUnexpected
       
    43 		};
       
    44 public:
       
    45 	IMPORT_C void SetInput(const TDesC8& aInputData);
       
    46 	IMPORT_C void SetOutput(TDes8& aOutputData);
       
    47 
       
    48 	IMPORT_C TPtrC8 OutputDescriptor() const;
       
    49 	IMPORT_C TInt TotalOut() const;
       
    50 	IMPORT_C TInt TotalIn() const;
       
    51 	IMPORT_C TInt32 Adler32() const;
       
    52 	IMPORT_C TInt AvailIn() const;
       
    53 	IMPORT_C TInt AvailOut() const;
       
    54 
       
    55 	IMPORT_C TInt Progress(TInt aTotalLength) const;
       
    56 	
       
    57 protected:
       
    58 	CEZZStream();
       
    59 
       
    60 	
       
    61 protected:
       
    62 	z_stream iStream;
       
    63 
       
    64 	// This pointer is reset every time SetOutput is called.  It maintains a pointer to the
       
    65 	// start of the output buffer which is being written to.  We cannot use iStream.next_out,
       
    66 	// because zlib will modifify this during its deflate and inflate.
       
    67 	
       
    68 	TUint8* iOutputPointer;
       
    69 	TInt iOutputBufferLength;
       
    70 	};
       
    71 
       
    72 #endif