|
1 /* |
|
2 * Copyright (c) 2003 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of the License "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: ?Description |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef __GZIPBUFMGR_H_ |
|
20 #define __GZIPBUFMGR_H_ |
|
21 |
|
22 //----------------------------------------------------------------------------- |
|
23 #include <e32base.h> |
|
24 #include <EZBufMan.h> |
|
25 #include <EZGZip.h> |
|
26 #include <s32mem.h> |
|
27 |
|
28 //----------------------------------------------------------------------------- |
|
29 class CGzipStream; |
|
30 class RMemReadStream; |
|
31 |
|
32 //----------------------------------------------------------------------------- |
|
33 class GZipBufMgr : public MEZBufferManager |
|
34 { |
|
35 public: |
|
36 // Constructor and Destructor |
|
37 static GZipBufMgr* NewL(TPtrC8 in); |
|
38 virtual ~GZipBufMgr(); |
|
39 |
|
40 // Overridden virtual methods from MEZBufferManager |
|
41 void InitializeL(CEZZStream &aZStream); |
|
42 void NeedInputL(CEZZStream &aZStream); |
|
43 void NeedOutputL(CEZZStream &aZStream); |
|
44 void FinalizeL(CEZZStream &aZStream); |
|
45 |
|
46 // Public methods |
|
47 void ReadGZipHeaderL(TEZGZipHeader& aHeader); |
|
48 void ReadStringIntoDescriptorL(RMemReadStream& aMem, HBufC8 **aDes) const; |
|
49 void SetGZipBuffer(TPtrC8 data); |
|
50 |
|
51 private: |
|
52 void ConstructL(); |
|
53 GZipBufMgr(TPtrC8 in); |
|
54 |
|
55 /// Always points to start of the input Buffer |
|
56 TPtrC8 iInput; |
|
57 |
|
58 // Always points to start of the output Buffer |
|
59 TPtr8 iOutputDes; |
|
60 HBufC8* iOutput; |
|
61 |
|
62 // Used by the virtual methods from MEZBufferManager |
|
63 TBool iNeedInput; |
|
64 TBool iNeedOutput; |
|
65 TBool iFinalized; |
|
66 |
|
67 // Marks the start of the data, after the header |
|
68 TUint iOffset; |
|
69 |
|
70 // Magic GZip numbers |
|
71 TUint8 iID1; |
|
72 TUint8 iID2; |
|
73 }; |
|
74 |
|
75 #endif // !__GZIPBUFMGR_H_ |