compressionlibs/ziplib/test/oldezlib/inc/OldEZFilebuffer.h
changeset 31 ce057bb09d0b
parent 0 e4d67989cc36
equal deleted inserted replaced
30:e20de85af2ee 31:ce057bb09d0b
       
     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: FILEBUFFER.H
       
    15 // Declaration for FileBufferManager class which facilitates the aynchronous compression and 
       
    16 // decompression of data streams.
       
    17 // 
       
    18 //
       
    19 
       
    20 #ifndef __EZLIB_EZFILEBUFFERMANAGER_H__
       
    21 #define __EZLIB_EZFILEBUFFERMANAGER_H__
       
    22 
       
    23 #include <e32base.h>
       
    24 #include <f32file.h>
       
    25 
       
    26 #include "OldEZBufman.h"
       
    27 
       
    28 /**
       
    29 Concrete class to manage the input and output buffers for compression and de-compression
       
    30 
       
    31 @publishedAll
       
    32 @released
       
    33 */
       
    34 namespace TOLDEZLIB
       
    35 {
       
    36 	
       
    37 class CEZFileBufferManager : public CBase, public MEZBufferManager
       
    38 	{
       
    39 public:
       
    40 
       
    41 	enum { EBadInitialization = 1 };
       
    42 
       
    43 public:
       
    44 	~CEZFileBufferManager();
       
    45 	IMPORT_C static CEZFileBufferManager* NewLC(RFile &aInput, RFile &aOutput, TInt aBufferSize = 0x8000);
       
    46 	IMPORT_C static CEZFileBufferManager* NewL(RFile &aInput, RFile &aOutput, TInt aBufferSize = 0x8000);
       
    47 
       
    48 	void InitializeL(CEZZStream &aZStream);
       
    49 	void NeedInputL(CEZZStream &aZStream);
       
    50 	void NeedOutputL(CEZZStream &aZStream);
       
    51 	void FinalizeL(CEZZStream &aZStream);
       
    52 
       
    53 protected:
       
    54 	void ConstructL(TInt aBufferSize);
       
    55 	CEZFileBufferManager(RFile &aInput, RFile &aOutput);
       
    56 
       
    57 protected:
       
    58 	RFile &iInputFile;
       
    59 	RFile &iOutputFile;
       
    60 	TInt iBufferSize;
       
    61 	TUint8* iInputBuffer;
       
    62 	TUint8* iOutputBuffer;
       
    63 	TPtr8 iInputDescriptor;  // always points to start of the input Buffer
       
    64 	TPtr8 iOutputDescriptor; // always points to start of the output Buffer
       
    65 	};
       
    66 
       
    67 } // namespace TOLDEZLIB
       
    68 #endif