epoc32/include/ezfilebuffer.h
branchSymbian2
changeset 2 2fe1408b6811
parent 0 061f57f2323e
child 4 837f303aceeb
equal deleted inserted replaced
1:666f914201fb 2:2fe1408b6811
     1 ezfilebuffer.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: FILEBUFFER.H
       
    15 // Declaration for FileBufferManager class which facilitates the aynchronous compression and 
       
    16 // decompression of data streams.
       
    17 // 
       
    18 //
       
    19 
       
    20 #ifndef __EZFILEBUFFERMANAGER_H__
       
    21 #define __EZFILEBUFFERMANAGER_H__
       
    22 
       
    23 #include <e32base.h>
       
    24 #include <f32file.h>
       
    25 
       
    26 #include <ezbufman.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 class CEZFileBufferManager : public CBase, public MEZBufferManager
       
    35 	{
       
    36 public:
       
    37 
       
    38 	enum { EBadInitialization = 1 };
       
    39 
       
    40 public:
       
    41 	~CEZFileBufferManager();
       
    42 	IMPORT_C static CEZFileBufferManager* NewLC(RFile &aInput, RFile &aOutput, TInt aBufferSize = 0x8000);
       
    43 	IMPORT_C static CEZFileBufferManager* NewL(RFile &aInput, RFile &aOutput, TInt aBufferSize = 0x8000);
       
    44 
       
    45 	void InitializeL(CEZZStream &aZStream);
       
    46 	void NeedInputL(CEZZStream &aZStream);
       
    47 	void NeedOutputL(CEZZStream &aZStream);
       
    48 	void FinalizeL(CEZZStream &aZStream);
       
    49 
       
    50 protected:
       
    51 	void ConstructL(TInt aBufferSize);
       
    52 	CEZFileBufferManager(RFile &aInput, RFile &aOutput);
       
    53 
       
    54 protected:
       
    55 	RFile &iInputFile;
       
    56 	RFile &iOutputFile;
       
    57 	TInt iBufferSize;
       
    58 	TUint8* iInputBuffer;
       
    59 	TUint8* iOutputBuffer;
       
    60 	TPtr8 iInputDescriptor;  // always points to start of the input Buffer
       
    61 	TPtr8 iOutputDescriptor; // always points to start of the output Buffer
       
    62 	};
       
    63 
       
    64 
       
    65 #endif