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 "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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
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.
24 @deprecated Deprecated in 9.1
27 #ifndef __AUTHORITY16_H__
28 #define __AUTHORITY16_H__
33 #include <authoritycommon.h>
37 Dependencies : TAuthorityComponent.
38 Comments : Provides non-modifying functionality on the components of an authority
39 object as defined in RFC2396. There are 3 components; userinfo, host and port.
41 The object holds descriptor pointers to the parsed authority components and a descriptor
42 pointer to the authority. It is non-owning. It uses 16-bit descriptors.
44 The functionality provided by this API allows the authority components to be extracted
45 from the parsed authority, checked for their presence in the authority and be compared
46 with those in another TAuthorityC16 object.
48 @deprecated Deprecated in 9.1
55 IMPORT_C const TDesC16& Extract(TAuthorityComponent aComponent) const;
56 IMPORT_C TBool IsPresent(TAuthorityComponent aComponent) const;
57 IMPORT_C TInt Compare(const TAuthorityC16& aAuthority, TAuthorityComponent aComponent) const;
58 IMPORT_C const TDesC16& AuthorityDes() const;
59 IMPORT_C HBufC* DisplayFormL(TAuthorityComponent aComponent = EAuthorityComplete ) const;
64 IMPORT_C TAuthorityC16();
68 protected: // Attributes
71 The array of descriptor pointers to the authority components.
73 TPtrC16 iComponent[EAuthorityMaxComponents];
76 The descriptor pointer to the authority.
78 TPtrC16 iAuthorityDes;
85 friend class CAuthority16;
88 A friend class used for testing.
89 @see TAuthorityC16StateAccessor
92 friend class TAuthorityC16StateAccessor;
97 Dependencies : TAuthorityC16
98 Comments : Provides functionality to parse a descriptor into the components of an
99 authority as defined in RFC2396. There are 3 components; userinfo, host and port.
101 This uses 16-bit descriptors.
103 Format of an authority is; [userinfo@]host[:port]
105 @warning The descriptor that is parsed by an object of this class will be referenced
106 by that object. If the original descriptor is no longer in scope there will be undefined
109 @deprecated Deprecated in 9.1. Use UriUtils::CreateAuthorityL() instead
112 class TAuthorityParser16 : public TAuthorityC16
116 IMPORT_C TAuthorityParser16();
117 IMPORT_C TInt Parse(const TDesC16& aAuthority);
122 Dependencies : CBase, TAuthorityC16.
123 Comments : Provides modifying functionality on the components of an authority object, as
124 defined in RFC2396. There are 3 components; userinfo, host and port.
126 The object holds parsed authority information. It is owning. It uses 16-bit descriptors.
128 The functionality provided by this API allows the authority components to be set or removed
129 from this parsed authority. Also, it provides a reference to TAuthorityC16 object so that
130 the non-modifying functionality can be used.
132 @deprecated Deprecated in 9.1
135 class CAuthority16 : public CBase
139 IMPORT_C static CAuthority16* NewL(const TAuthorityC16& aAuthority);
140 IMPORT_C static CAuthority16* NewLC(const TAuthorityC16& aAuthority);
141 IMPORT_C static CAuthority16* NewL();
142 IMPORT_C static CAuthority16* NewLC();
143 IMPORT_C ~CAuthority16();
145 IMPORT_C const TAuthorityC16& Authority() const;
146 IMPORT_C void SetComponentL(const TDesC16& aData, TAuthorityComponent aComponent);
147 IMPORT_C void SetAndEscapeComponentL(const TDesC16& aData, TAuthorityComponent aComponent);
148 IMPORT_C void RemoveComponentL(TAuthorityComponent aComponent);
152 CAuthority16(const TAuthorityC16& aAuthority);
156 void FormAuthorityL();
158 private: // Attributes
161 The descriptor buffer that contains the authority.
163 HBufC16* iAuthorityBuf;
166 The parsed authority object.
168 TAuthorityC16 iAuthority;
171 A friend class used for testing.
172 @see TAuthority16StateAccessor
175 friend class TAuthority16StateAccessor;
179 Do not use. Use TAuthorityC8 instead
181 @deprecated Deprecated in 9.1
183 typedef TAuthorityC16 TAuthorityC;
186 Do not use. Use TAuthorityParser8 instead
188 @deprecated Deprecated in 9.1
190 typedef TAuthorityParser16 TAuthorityParser;
193 Do not use. Use CAuthority8 instead
195 @deprecated Deprecated in 9.1
197 typedef CAuthority16 CAuthority;
199 #endif // __AUTHORITY16_H__