1 authority16.h |
1 // Copyright (c) 2001-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 the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // This file contains the API definition for the classes TAuthorityC16 and |
|
15 // CAuthority16. These classes provide non-modifying (TAuthorityC16) and |
|
16 // modifying (CAuthority16) functionality for the components of an |
|
17 // Authority as described in RFC2396. |
|
18 // |
|
19 // |
|
20 |
|
21 |
|
22 |
|
23 /** |
|
24 @file Authority16.h |
|
25 @publishedAll |
|
26 @deprecated Deprecated in 9.1 |
|
27 */ |
|
28 |
|
29 #ifndef __AUTHORITY16_H__ |
|
30 #define __AUTHORITY16_H__ |
|
31 |
|
32 // System includes |
|
33 // |
|
34 #include <e32base.h> |
|
35 #include <authoritycommon.h> |
|
36 |
|
37 |
|
38 /** |
|
39 Dependencies : TAuthorityComponent. |
|
40 Comments : Provides non-modifying functionality on the components of an authority |
|
41 object as defined in RFC2396. There are 3 components; userinfo, host and port. |
|
42 |
|
43 The object holds descriptor pointers to the parsed authority components and a descriptor |
|
44 pointer to the authority. It is non-owning. It uses 16-bit descriptors. |
|
45 |
|
46 The functionality provided by this API allows the authority components to be extracted |
|
47 from the parsed authority, checked for their presence in the authority and be compared |
|
48 with those in another TAuthorityC16 object. |
|
49 @publishedAll |
|
50 @deprecated Deprecated in 9.1 |
|
51 @since 6.0 |
|
52 */ |
|
53 class TAuthorityC16 |
|
54 { |
|
55 public: // Methods |
|
56 |
|
57 IMPORT_C const TDesC16& Extract(TAuthorityComponent aComponent) const; |
|
58 IMPORT_C TBool IsPresent(TAuthorityComponent aComponent) const; |
|
59 IMPORT_C TInt Compare(const TAuthorityC16& aAuthority, TAuthorityComponent aComponent) const; |
|
60 IMPORT_C const TDesC16& AuthorityDes() const; |
|
61 IMPORT_C HBufC* DisplayFormL(TAuthorityComponent aComponent = EAuthorityComplete ) const; |
|
62 |
|
63 protected: // Methods |
|
64 |
|
65 |
|
66 IMPORT_C TAuthorityC16(); |
|
67 |
|
68 void Reset(); |
|
69 |
|
70 protected: // Attributes |
|
71 |
|
72 /** |
|
73 The array of descriptor pointers to the authority components. |
|
74 */ |
|
75 TPtrC16 iComponent[EAuthorityMaxComponents]; |
|
76 |
|
77 /** |
|
78 The descriptor pointer to the authority. |
|
79 */ |
|
80 TPtrC16 iAuthorityDes; |
|
81 |
|
82 /** |
|
83 A friend class. |
|
84 @see CAuthority16 |
|
85 @since 6.0 |
|
86 */ |
|
87 friend class CAuthority16; |
|
88 |
|
89 /** |
|
90 A friend class used for testing. |
|
91 @see TAuthorityC16StateAccessor |
|
92 @since 6.0 |
|
93 */ |
|
94 friend class TAuthorityC16StateAccessor; |
|
95 |
|
96 }; |
|
97 |
|
98 /** |
|
99 Dependencies : TAuthorityC16 |
|
100 Comments : Provides functionality to parse a descriptor into the components of an |
|
101 authority as defined in RFC2396. There are 3 components; userinfo, host and port. |
|
102 |
|
103 This uses 16-bit descriptors. |
|
104 |
|
105 Format of an authority is; [userinfo@]host[:port] |
|
106 |
|
107 @warning The descriptor that is parsed by an object of this class will be referenced |
|
108 by that object. If the original descriptor is no longer in scope there will be undefined |
|
109 behaviour. |
|
110 @publishedAll |
|
111 @deprecated Deprecated in 9.1. Use UriUtils::CreateAuthorityL() instead |
|
112 @since 6.0 |
|
113 */ |
|
114 class TAuthorityParser16 : public TAuthorityC16 |
|
115 { |
|
116 public: // Methods |
|
117 |
|
118 IMPORT_C TAuthorityParser16(); |
|
119 IMPORT_C TInt Parse(const TDesC16& aAuthority); |
|
120 |
|
121 }; |
|
122 |
|
123 /** |
|
124 Dependencies : CBase, TAuthorityC16. |
|
125 Comments : Provides modifying functionality on the components of an authority object, as |
|
126 defined in RFC2396. There are 3 components; userinfo, host and port. |
|
127 |
|
128 The object holds parsed authority information. It is owning. It uses 16-bit descriptors. |
|
129 |
|
130 The functionality provided by this API allows the authority components to be set or removed |
|
131 from this parsed authority. Also, it provides a reference to TAuthorityC16 object so that |
|
132 the non-modifying functionality can be used. |
|
133 @publishedAll |
|
134 @deprecated Deprecated in 9.1 |
|
135 @since 6.0 |
|
136 */ |
|
137 class CAuthority16 : public CBase |
|
138 { |
|
139 public: // Methods |
|
140 |
|
141 IMPORT_C static CAuthority16* NewL(const TAuthorityC16& aAuthority); |
|
142 IMPORT_C static CAuthority16* NewLC(const TAuthorityC16& aAuthority); |
|
143 IMPORT_C static CAuthority16* NewL(); |
|
144 IMPORT_C static CAuthority16* NewLC(); |
|
145 IMPORT_C ~CAuthority16(); |
|
146 |
|
147 IMPORT_C const TAuthorityC16& Authority() const; |
|
148 IMPORT_C void SetComponentL(const TDesC16& aData, TAuthorityComponent aComponent); |
|
149 IMPORT_C void SetAndEscapeComponentL(const TDesC16& aData, TAuthorityComponent aComponent); |
|
150 IMPORT_C void RemoveComponentL(TAuthorityComponent aComponent); |
|
151 |
|
152 private: // Methods |
|
153 |
|
154 CAuthority16(const TAuthorityC16& aAuthority); |
|
155 |
|
156 void ConstructL(); |
|
157 |
|
158 void FormAuthorityL(); |
|
159 |
|
160 private: // Attributes |
|
161 |
|
162 /** |
|
163 The descriptor buffer that contains the authority. |
|
164 */ |
|
165 HBufC16* iAuthorityBuf; |
|
166 |
|
167 /** |
|
168 The parsed authority object. |
|
169 */ |
|
170 TAuthorityC16 iAuthority; |
|
171 |
|
172 /** |
|
173 A friend class used for testing. |
|
174 @see TAuthority16StateAccessor |
|
175 @since 6.0 |
|
176 */ |
|
177 friend class TAuthority16StateAccessor; |
|
178 |
|
179 }; |
|
180 /** |
|
181 Do not use. Use TAuthorityC8 instead |
|
182 @publishedAll |
|
183 @deprecated Deprecated in 9.1 |
|
184 */ |
|
185 typedef TAuthorityC16 TAuthorityC; |
|
186 |
|
187 /** |
|
188 Do not use. Use TAuthorityParser8 instead |
|
189 @publishedAll |
|
190 @deprecated Deprecated in 9.1 |
|
191 */ |
|
192 typedef TAuthorityParser16 TAuthorityParser; |
|
193 |
|
194 /** |
|
195 Do not use. Use CAuthority8 instead |
|
196 @publishedAll |
|
197 @deprecated Deprecated in 9.1 |
|
198 */ |
|
199 typedef CAuthority16 CAuthority; |
|
200 |
|
201 #endif // __AUTHORITY16_H__ |