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