|
1 // Copyright (c) 2004-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 // The Domain Name Decoder header file |
|
15 // |
|
16 // |
|
17 |
|
18 /** |
|
19 @file DomainNameDecoder.h |
|
20 */ |
|
21 |
|
22 #ifndef DOMAINNAMEDECODER_H |
|
23 #define DOMAINNAMEDECODER_H |
|
24 |
|
25 #include <e32base.h> |
|
26 |
|
27 typedef TBuf8<0xFF> TDomainName; |
|
28 typedef RArray<TDomainName> TDomainNameArray; |
|
29 |
|
30 const TUint8 KMaxDnsLabelLength = 63; |
|
31 const TUint8 KMaxDomainNameLength = 255; |
|
32 |
|
33 class CDomainNameCodec : public CBase |
|
34 { |
|
35 public: |
|
36 virtual ~CDomainNameCodec(); |
|
37 |
|
38 TUint NumDomainNames() const; |
|
39 TDomainName& operator[](TUint aIndex); |
|
40 |
|
41 void DecodeL(TPtr8& aInDes); |
|
42 void EncodeL(TDomainNameArray& aNames, RBuf8& aOutDes); |
|
43 |
|
44 protected: |
|
45 TDomainNameArray iDomainList; |
|
46 }; |
|
47 |
|
48 inline TDomainName& CDomainNameCodec::operator[](TUint aIndex) |
|
49 { |
|
50 return iDomainList[aIndex]; |
|
51 } |
|
52 |
|
53 inline TUint CDomainNameCodec::NumDomainNames() const |
|
54 { |
|
55 return iDomainList.Count(); |
|
56 } |
|
57 |
|
58 #endif |