os/ossrv/lowlevellibsandfws/apputils/multipartparser/src/gzipbufmgr.h
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     1 // Copyright (c) 2003-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 // @internalComponent
    15 // @prototype
    16 //
    17 
    18 #ifndef GZIPBUFMGR_H
    19 #define GZIPBUFMGR_H
    20 
    21 //-----------------------------------------------------------------------------
    22 #include <e32base.h>
    23 #include <ezbufman.h>
    24 #include <ezgzip.h>
    25 #include <s32mem.h>
    26 
    27 //-----------------------------------------------------------------------------
    28 class CGzipStream;
    29 class RMemReadStream;
    30 
    31 //-----------------------------------------------------------------------------
    32 class GZipBufMgr : public MEZBufferManager
    33     {
    34     public:
    35         // Constructor and Destructor
    36         static GZipBufMgr* NewL(TPtrC8 in);
    37         virtual ~GZipBufMgr();
    38 
    39         // Overridden virtual methods from MEZBufferManager
    40         void InitializeL(CEZZStream &aZStream);
    41         void NeedInputL(CEZZStream &aZStream);
    42         void NeedOutputL(CEZZStream &aZStream);
    43         void FinalizeL(CEZZStream &aZStream);
    44         
    45         // Public methods
    46         void ReadGZipHeaderL(TEZGZipHeader& aHeader);
    47         void ReadStringIntoDescriptorL(RMemReadStream& aMem, HBufC8 **aDes) const;
    48         void SetGZipBuffer(TPtrC8 data);
    49 
    50     private:
    51         void ConstructL();
    52         GZipBufMgr(TPtrC8 in);
    53 
    54         // Always points to start of the input Buffer
    55         TPtrC8	iInput;
    56 
    57         // Always points to start of the output Buffer
    58         TPtr8	iOutputDes;
    59         HBufC8*	iOutput;
    60         
    61         // Used by the virtual methods from MEZBufferManager
    62         TBool	iNeedInput;
    63         TBool	iNeedOutput;
    64         TBool	iFinalized;
    65 
    66         // Marks the start of the data, after the header
    67         TUint   iOffset;
    68 
    69         // Magic GZip numbers
    70         TUint8  iID1;
    71         TUint8  iID2;
    72     };
    73 
    74 #endif // GZIPBUFMGR_H