diff -r 000000000000 -r e35f40988205 xml/xmldomandxpath/src/xmlengineserializer/xmlenggzipbufferoutputstream.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/xml/xmldomandxpath/src/xmlengineserializer/xmlenggzipbufferoutputstream.h Thu Dec 17 09:29:21 2009 +0200 @@ -0,0 +1,112 @@ +// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies). +// All rights reserved. +// This component and the accompanying materials are made available +// under the terms of "Eclipse Public License v1.0" +// which accompanies this distribution, and is available +// at the URL "http://www.eclipse.org/legal/epl-v10.html". +// +// Initial Contributors: +// Nokia Corporation - initial contribution. +// +// Contributors: +// +// Description: +// Interface class describing class that may be used as +// output stream for dom tree +// + + + +/** + @file + @internalComponent + @released +*/ +#ifndef XMLENGCGZIPBUFFEROUTPUTSTREAM_H +#define XMLENGCGZIPBUFFEROUTPUTSTREAM_H + +#include +#include //MEZBufferManager +#include //TEZGZipHeader + +class CEZCompressor; + + + +class CXmlEngGZIPBufferOutputStream : public CBase, public MXmlEngOutputStream, public MEZBufferManager + { + public: + static CXmlEngGZIPBufferOutputStream* NewLC(RBuf8& aOutputBuffer); + + static CXmlEngGZIPBufferOutputStream* NewL(RBuf8& aOutputBuffer); + + ~CXmlEngGZIPBufferOutputStream(); + + /** + * Get last error + */ + TInt CheckError(); + + /** + * Implementation of MXmlEngOutputStream interface. + */ + TInt Write( const TDesC8& aBuffer ); + TInt Close(); + + /** + * Implementation of MEZBufferManager interface. + */ + void InitializeL(CEZZStream& aZStream); + void NeedInputL(CEZZStream& aZStream); + void NeedOutputL(CEZZStream& aZStream); + void FinalizeL(CEZZStream& aZStream); + + + protected: + CXmlEngGZIPBufferOutputStream(RBuf8& aOutputBuffer); + void ConstructL(); + + private: + void WriteL(const TDesC8& aBuffer); + void CloseL(); + + private: + /** + * Last error + */ + TInt iError; + + /** + * Default input buffers size. + */ + static const TInt KDefaultInputBufferSize = 4096; + + /** + * Output buffer size. It determines, how often output data will be written + * to disk. (it's written to disk, when buffer is full. + * + */ + static const TInt KOutputBufferSize = 0x8000; + + RBuf8 iOutputDescriptor; + RBuf8 iInputDescriptor; + RBuf8 iOldInputDescriptor; + + /** + * Engine of GZiping + */ + CEZCompressor* iCompressor; + + RBuf8& iOutputString; + /** + * State of the object. + */ + TBool iNoInputNeeded; + TBool iKeepGoing; + TBool iCloseInvoked; + + }; + + + +#endif /* XMLENGCGZIPBUFFEROUTPUTSTREAM_H */