xml/xmldomandxpath/src/xmlengineserializer/xmlenggzipfiledeserializer.h
changeset 0 e35f40988205
equal deleted inserted replaced
-1:000000000000 0:e35f40988205
       
     1 // Copyright (c) 2006-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 "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 // Interface class describing class that may be used as output stream for dom tree
       
    15 //
       
    16 
       
    17 
       
    18 
       
    19 /**
       
    20  @file
       
    21  @internalComponent
       
    22  @released
       
    23 */
       
    24 #ifndef XMLENGCGZIPFILEDESERIALIZER_H
       
    25 #define XMLENGCGZIPFILEDESERIALIZER_H
       
    26 
       
    27 #include <xml/dom/xmlengoutputstream.h>
       
    28 #include <ezbufman.h>
       
    29 #include <xml/parser.h>
       
    30 #include <f32file.h>
       
    31 
       
    32 #include <ezgzip.h>
       
    33 class CEZDecompressor;
       
    34 
       
    35 class CXmlEngGZipFileDeserializer : public CBase, public MEZBufferManager
       
    36 	{
       
    37 	public:
       
    38         static CXmlEngGZipFileDeserializer* NewLC( Xml::CParser* aParser, RFs& aRfs, const TDesC& aGzFileName, TInt aOutBufSize = 0x8000 );
       
    39 
       
    40         static CXmlEngGZipFileDeserializer* NewL( Xml::CParser* aParser, RFs& aRfs, const TDesC& aGzFileName, TInt aOutBufSize = 0x8000 );
       
    41 
       
    42 	    ~CXmlEngGZipFileDeserializer();
       
    43 	    
       
    44 	    TBool InflateL();
       
    45 	    
       
    46         /**
       
    47          * Implementation of MEZBufferManager interface.
       
    48          */
       
    49 	    void InitializeL(CEZZStream& aZStream);
       
    50 	    void NeedInputL(CEZZStream& aZStream);
       
    51 	    void NeedOutputL(CEZZStream& aZStream);
       
    52 	    void FinalizeL(CEZZStream& aZStream);
       
    53 
       
    54 
       
    55     protected:
       
    56 	    CXmlEngGZipFileDeserializer( Xml::CParser* aParser );
       
    57 	    void ConstructL( RFs& aRfs, const TDesC& aGzFileName, TInt aBufSize );
       
    58 			
       
    59 	private:
       
    60 	    
       
    61 	    /** XML Framework Parser Interface **/
       
    62 	    Xml::CParser* iParser;
       
    63 
       
    64         RFile iInputFile;
       
    65 
       
    66         CEZDecompressor *iDecompressor;
       
    67 
       
    68 	    TInt32 iCrc;
       
    69         TEZGZipHeader iHeader;
       
    70         TEZGZipTrailer iTrailer;
       
    71 
       
    72 	    /** Buffers **/
       
    73 	    TUint8* iInputBuffer;
       
    74 	    TUint8* iOutputBuffer;
       
    75 	    TPtr8 iInputDescriptor;  // always points to start of the input Buffer
       
    76 	    TPtr8 iOutputDescriptor; // always points to start of the output Buffer
       
    77 	
       
    78 	    	    
       
    79 	}; 
       
    80 	
       
    81 
       
    82 #endif /* XMLENGCGZIPFILEDESERIALIZER_H */