|
1 /* |
|
2 * Copyright (c) 1997-1999 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 "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: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #if !defined(__RESENTRY_H__) |
|
21 #define __RESENTRY_H__ |
|
22 |
|
23 #include <e32base.h> |
|
24 |
|
25 class CDictArray; |
|
26 class CResComp; |
|
27 class TBitWriter; |
|
28 |
|
29 enum TResType |
|
30 { |
|
31 EResTypePlain = 0, |
|
32 EResTypeToken = 1, |
|
33 EResTypeZeroSpaced = 2 |
|
34 }; |
|
35 |
|
36 class TResComponent |
|
37 { |
|
38 public: |
|
39 TInt Size(TInt aDictionaryBits); |
|
40 void WriteBitStreamL(TBitWriter& aWriter,TInt aDictionaryBits); |
|
41 public: |
|
42 TResType iType; |
|
43 TUint8* iData; |
|
44 TInt iLength; |
|
45 TInt iToken; |
|
46 }; |
|
47 |
|
48 class CResEntry : public CBase |
|
49 { |
|
50 public: |
|
51 CResEntry(CDictArray* aDict); |
|
52 ~CResEntry(); |
|
53 void AddPlainDataL(TUint8* aData, TInt aLength); |
|
54 TInt Size(TInt aDictionaryBits); |
|
55 void MatchDictL(TInt aDictIndex = -1); |
|
56 void MatchSelfL(TInt aRes,CResComp* aResComp); |
|
57 // void MatchZeroSpacedL(); |
|
58 void WriteBitStreamL(TBitWriter& aWriter,TInt aDictionaryBits); |
|
59 void CheckForLongDataStringsL(); |
|
60 private: |
|
61 TBool DoMatchDictL(TResComponent& aComp, TInt aOffset, TInt aDictIndex); |
|
62 TBool DoMatchSelfL(TResComponent& aComp, TInt aOffset, TInt aRes,CResComp* aResComp); |
|
63 // TBool DoMatchZeroSpacedL(TResComponent& aComp, TInt aOffset); |
|
64 void SplitPlainDataWithTokenL(TInt aComponent, TInt aToken, TInt aPosition); |
|
65 void InsertTokenL(TInt aPosition, TInt aToken); |
|
66 TBool MatchPreviousComponent(TInt aCompIndex, TDesC8& aMatch); |
|
67 void SplitPlainDataWithZeroSpacedL(TInt aComponent, TInt aZeroSpacedStart, TInt aLength); |
|
68 public: |
|
69 CArrayFixFlat<TResComponent>* iComponent; |
|
70 CDictArray* iDict; |
|
71 }; |
|
72 |
|
73 |
|
74 |
|
75 #endif |