1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/ossrv/lowlevellibsandfws/apputils/multipartparser/src/gzipbufmgr.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,74 @@
1.4 +// Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
1.5 +// All rights reserved.
1.6 +// This component and the accompanying materials are made available
1.7 +// under the terms of "Eclipse Public License v1.0"
1.8 +// which accompanies this distribution, and is available
1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.10 +//
1.11 +// Initial Contributors:
1.12 +// Nokia Corporation - initial contribution.
1.13 +//
1.14 +// Contributors:
1.15 +//
1.16 +// Description:
1.17 +// @internalComponent
1.18 +// @prototype
1.19 +//
1.20 +
1.21 +#ifndef GZIPBUFMGR_H
1.22 +#define GZIPBUFMGR_H
1.23 +
1.24 +//-----------------------------------------------------------------------------
1.25 +#include <e32base.h>
1.26 +#include <ezbufman.h>
1.27 +#include <ezgzip.h>
1.28 +#include <s32mem.h>
1.29 +
1.30 +//-----------------------------------------------------------------------------
1.31 +class CGzipStream;
1.32 +class RMemReadStream;
1.33 +
1.34 +//-----------------------------------------------------------------------------
1.35 +class GZipBufMgr : public MEZBufferManager
1.36 + {
1.37 + public:
1.38 + // Constructor and Destructor
1.39 + static GZipBufMgr* NewL(TPtrC8 in);
1.40 + virtual ~GZipBufMgr();
1.41 +
1.42 + // Overridden virtual methods from MEZBufferManager
1.43 + void InitializeL(CEZZStream &aZStream);
1.44 + void NeedInputL(CEZZStream &aZStream);
1.45 + void NeedOutputL(CEZZStream &aZStream);
1.46 + void FinalizeL(CEZZStream &aZStream);
1.47 +
1.48 + // Public methods
1.49 + void ReadGZipHeaderL(TEZGZipHeader& aHeader);
1.50 + void ReadStringIntoDescriptorL(RMemReadStream& aMem, HBufC8 **aDes) const;
1.51 + void SetGZipBuffer(TPtrC8 data);
1.52 +
1.53 + private:
1.54 + void ConstructL();
1.55 + GZipBufMgr(TPtrC8 in);
1.56 +
1.57 + // Always points to start of the input Buffer
1.58 + TPtrC8 iInput;
1.59 +
1.60 + // Always points to start of the output Buffer
1.61 + TPtr8 iOutputDes;
1.62 + HBufC8* iOutput;
1.63 +
1.64 + // Used by the virtual methods from MEZBufferManager
1.65 + TBool iNeedInput;
1.66 + TBool iNeedOutput;
1.67 + TBool iFinalized;
1.68 +
1.69 + // Marks the start of the data, after the header
1.70 + TUint iOffset;
1.71 +
1.72 + // Magic GZip numbers
1.73 + TUint8 iID1;
1.74 + TUint8 iID2;
1.75 + };
1.76 +
1.77 +#endif // GZIPBUFMGR_H