|
1 // Copyright (c) 2000-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 // |
|
15 |
|
16 /** |
|
17 @file |
|
18 @internalTechnology |
|
19 @released |
|
20 */ |
|
21 |
|
22 #ifndef __WAPDECODER_H__ |
|
23 #define __WAPDECODER_H__ |
|
24 |
|
25 #include <e32base.h> |
|
26 |
|
27 //##ModelId=3B659EDE01E1 |
|
28 class TWapBinCodex |
|
29 /** WAP binary codex utility. |
|
30 |
|
31 This class contains static functions for decoding WAP binary data. |
|
32 @internalTechnology |
|
33 @released |
|
34 */ |
|
35 { |
|
36 public: |
|
37 |
|
38 class TUintvar |
|
39 /** Represents the WAP variable length integer type. |
|
40 |
|
41 This is used for decoding and indexing through WAP Binary data. |
|
42 |
|
43 The format is defined in WAP WSP Section 8.1.2. It can be up to 5 (8-bit) |
|
44 bytes long, with the first bit indicating a carryover. */ |
|
45 { |
|
46 public: |
|
47 /** Constructor. |
|
48 |
|
49 Data members are initialised to zero. */ |
|
50 TUintvar() : iValue(0), iOctetSize(0) {}; |
|
51 /** Integer value. */ |
|
52 TInt iValue; |
|
53 /** Value size in number of bytes. */ |
|
54 TInt iOctetSize; |
|
55 }; |
|
56 |
|
57 //##ModelId=3B659EDE01F7 |
|
58 IMPORT_C static void ExtractUIntvarL(const TDesC8& aSource, TInt aStartIndex, TWapBinCodex::TUintvar& aMultiByte); |
|
59 //##ModelId=3B659EDE01EB |
|
60 IMPORT_C static void ExtractMultiOctetInteger(const TDesC8& aSource, TInt& aInt); |
|
61 IMPORT_C static TInt ParseMultiOctetInteger(const TDesC8& aSource, TInt& aInt); |
|
62 }; |
|
63 |
|
64 #endif |