e32tools/elf2e32/source/inflate.h
changeset 0 044383f39525
equal deleted inserted replaced
-1:000000000000 0:044383f39525
       
     1 // Copyright (c) 2004-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 // Class for inflater
       
    15 // @internalComponent
       
    16 // @released
       
    17 // 
       
    18 //
       
    19 
       
    20 #ifndef __INFLATE_H__
       
    21 #define __INFLATE_H__
       
    22 
       
    23 #include "e32defwrap.h"
       
    24 #include "huffman.h"
       
    25 
       
    26 
       
    27 const TInt KDeflateMinLength=3;
       
    28 const TInt KDeflateMaxDistance=(1<<KDeflateDistanceMag);
       
    29 const TInt KDeflateDistCodeBase=0x200;
       
    30 
       
    31 /**
       
    32 Class for inflater
       
    33 @internalComponent
       
    34 @released
       
    35 */
       
    36 class CInflater
       
    37 {
       
    38 	public:
       
    39 		enum {EBufSize = 0x800, ESafetyZone=8};
       
    40 	public:
       
    41 		static CInflater* NewLC(TBitInput& aInput);
       
    42 		~CInflater();
       
    43 		TInt ReadL(TUint8* aBuffer,TInt aLength);
       
    44 		TInt SkipL(TInt aLength);
       
    45 	private:
       
    46 		CInflater(TBitInput& aInput);
       
    47 		void ConstructL();
       
    48 		void InitL();
       
    49 		TInt InflateL();
       
    50 	private:
       
    51 		TBitInput* iBits;
       
    52 		const TUint8* iRptr;			// partial segment
       
    53 		TInt iLen;
       
    54 		const TUint8* iAvail;			// available data
       
    55 		const TUint8* iLimit;
       
    56 		TEncoding* iEncoding;
       
    57 		TUint8* iOut;					// circular buffer for distance matches
       
    58 		TUint8 iHuff[EBufSize+ESafetyZone];	// huffman data
       
    59 };
       
    60 
       
    61 
       
    62 #endif
       
    63