sl@0: // Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // @internalComponent sl@0: // @prototype sl@0: // sl@0: sl@0: #ifndef GZIPBUFMGR_H sl@0: #define GZIPBUFMGR_H sl@0: sl@0: //----------------------------------------------------------------------------- sl@0: #include sl@0: #include sl@0: #include sl@0: #include sl@0: sl@0: //----------------------------------------------------------------------------- sl@0: class CGzipStream; sl@0: class RMemReadStream; sl@0: sl@0: //----------------------------------------------------------------------------- sl@0: class GZipBufMgr : public MEZBufferManager sl@0: { sl@0: public: sl@0: // Constructor and Destructor sl@0: static GZipBufMgr* NewL(TPtrC8 in); sl@0: virtual ~GZipBufMgr(); sl@0: sl@0: // Overridden virtual methods from MEZBufferManager sl@0: void InitializeL(CEZZStream &aZStream); sl@0: void NeedInputL(CEZZStream &aZStream); sl@0: void NeedOutputL(CEZZStream &aZStream); sl@0: void FinalizeL(CEZZStream &aZStream); sl@0: sl@0: // Public methods sl@0: void ReadGZipHeaderL(TEZGZipHeader& aHeader); sl@0: void ReadStringIntoDescriptorL(RMemReadStream& aMem, HBufC8 **aDes) const; sl@0: void SetGZipBuffer(TPtrC8 data); sl@0: sl@0: private: sl@0: void ConstructL(); sl@0: GZipBufMgr(TPtrC8 in); sl@0: sl@0: // Always points to start of the input Buffer sl@0: TPtrC8 iInput; sl@0: sl@0: // Always points to start of the output Buffer sl@0: TPtr8 iOutputDes; sl@0: HBufC8* iOutput; sl@0: sl@0: // Used by the virtual methods from MEZBufferManager sl@0: TBool iNeedInput; sl@0: TBool iNeedOutput; sl@0: TBool iFinalized; sl@0: sl@0: // Marks the start of the data, after the header sl@0: TUint iOffset; sl@0: sl@0: // Magic GZip numbers sl@0: TUint8 iID1; sl@0: TUint8 iID2; sl@0: }; sl@0: sl@0: #endif // GZIPBUFMGR_H