williamr@2: // Copyright (c) 1999-2009 Nokia Corporation and/or its subsidiary(-ies). williamr@2: // All rights reserved. williamr@2: // This component and the accompanying materials are made available williamr@4: // under the terms of "Eclipse Public License v1.0" williamr@2: // which accompanies this distribution, and is available williamr@4: // at the URL "http://www.eclipse.org/legal/epl-v10.html". williamr@2: // williamr@2: // Initial Contributors: williamr@2: // Nokia Corporation - initial contribution. williamr@2: // williamr@2: // Contributors: williamr@2: // williamr@2: // Description: williamr@2: // Declaration for FileBufferManager class which facilitates the aynchronous compression and williamr@2: // decompression of data streams. williamr@2: // williamr@2: // williamr@2: williamr@2: #ifndef __EZFILEBUFFERMANAGER_H__ williamr@2: #define __EZFILEBUFFERMANAGER_H__ williamr@2: williamr@2: #include williamr@2: #include williamr@2: williamr@2: #include williamr@2: williamr@2: /** williamr@2: Concrete class to manage the input and output buffers for compression and de-compression williamr@2: williamr@2: @publishedAll williamr@2: @released williamr@2: */ williamr@2: class CEZFileBufferManager : public CBase, public MEZBufferManager williamr@2: { williamr@2: public: williamr@2: williamr@2: enum { EBadInitialization = 1 }; williamr@2: williamr@2: public: williamr@2: ~CEZFileBufferManager(); williamr@2: IMPORT_C static CEZFileBufferManager* NewLC(RFile &aInput, RFile &aOutput, TInt aBufferSize = 0x8000); williamr@2: IMPORT_C static CEZFileBufferManager* NewL(RFile &aInput, RFile &aOutput, TInt aBufferSize = 0x8000); williamr@2: williamr@2: void InitializeL(CEZZStream &aZStream); williamr@2: void NeedInputL(CEZZStream &aZStream); williamr@2: void NeedOutputL(CEZZStream &aZStream); williamr@2: void FinalizeL(CEZZStream &aZStream); williamr@2: williamr@2: protected: williamr@2: void ConstructL(TInt aBufferSize); williamr@2: CEZFileBufferManager(RFile &aInput, RFile &aOutput); williamr@2: williamr@2: protected: williamr@2: RFile &iInputFile; williamr@2: RFile &iOutputFile; williamr@2: TInt iBufferSize; williamr@2: TUint8* iInputBuffer; williamr@2: TUint8* iOutputBuffer; williamr@2: TPtr8 iInputDescriptor; // always points to start of the input Buffer williamr@2: TPtr8 iOutputDescriptor; // always points to start of the output Buffer williamr@2: }; williamr@2: williamr@2: williamr@2: #endif