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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // This file contains the API definition for the classes TUriC16 and
15 // CUri16. These classes provide non-modifying (TUriC16) and modifying
16 // (CUri16) functionality for the components of a Uri as described in
26 @deprecated Deprecated in 9.1
36 #include <uricommon.h>
41 Dependencies : TUriComponent.
42 Comments : Provides non-modifying functionality on the components of a uri object as
43 defined in RFC2396. There are 5 components; scheme, authority, path, query and fragment.
45 The object holds descriptor pointers to the parsed uri components and a descriptor pointer
46 to the uri. It is non-owning. It uses 16-bit descriptors.
48 The functionality provided by this API allows the uri components to be extracted from the
49 parsed uri, checked for their presence in the uri and be compared with those in another
52 @deprecated Deprecated in 9.1
58 IMPORT_C HBufC* GetFileNameL() const;
59 IMPORT_C HBufC* GetFileNameL(TUriFileName aType) const;
60 IMPORT_C const TDesC16& Extract(TUriComponent aComponent) const;
61 IMPORT_C void UriWithoutFragment(TPtrC16& aUriNoFrag) const;
63 IMPORT_C TBool IsPresent(TUriComponent aComponent) const;
64 IMPORT_C TBool IsSchemeValid() const;
66 IMPORT_C TInt Compare(const TUriC16& aUri, TUriComponent aComponent) const;
68 IMPORT_C const TDesC16& UriDes() const;
70 IMPORT_C TInt Validate() const;
71 IMPORT_C TInt Equivalent(const TUriC16& aUri) const;
72 IMPORT_C HBufC* DisplayFormL(TUriComponent aComponent = EUriComplete) const;
82 TInt ValidateL() const;
83 TInt EquivalentL(const TDesC16& aUri) const;
85 protected: // Attributes
87 /** The array of descriptor pointers to the uri components.
89 TPtrC16 iComponent[EUriMaxComponents];
91 /** The descriptor pointer to the uri.
103 A friend class used for testing.
104 @see TUriC16StateAccessor
108 friend class TUriC16StateAccessor;
113 Dependencies : TUriC16
114 Comments : Provides functionality to parse a descriptor into the components of a uri as
115 defined in RFC2396. There are 5 components; scheme, authority, path, query and fragment.
117 It uses 16-bit descriptors.
119 Format of a uri is; scheme://authority path?query\#fragment
121 @warning The descriptor that is parsed by an object of this class will be referenced
122 by that object. If the original descriptor is no longer in scope there will be undefined
125 @deprecated Deprecated in 9.1. Use UriUtils::CreateUriL() instead
128 class TUriParser16 : public TUriC16
132 IMPORT_C TUriParser16();
133 IMPORT_C TInt Parse(const TDesC16& aUri);
137 Dependencies : CBase, TUriC16.
138 Comments : Provides modifying functionality on the components of a uri object, as
139 defined in RFC2396. There are 5 components; scheme. authority, path, query and fragment.
141 The object holds parsed uri information. It is owning. It uses 16-bit descriptors.
143 The functionality provided by this API allows the uri components to be set or removed
144 from this parsed uri. Also, it provides a reference to TUriC16 object so that the non-modifying
145 functionality can be used.
147 @deprecated Deprecated in 9.1
150 class CUri16 : public CBase
153 IMPORT_C static CUri16* CreateFileUriL(const TDesC& aFullFileName, TUint aFlags = 0);
154 IMPORT_C static CUri16* CreatePrivateFileUriL(const TDesC& aRelativeFileName, TDriveNumber aDrive, TInt aFlags = 0);
156 IMPORT_C static CUri16* NewL(const TUriC16& aUri);
157 IMPORT_C static CUri16* NewLC(const TUriC16& aUri);
158 IMPORT_C static CUri16* NewL();
159 IMPORT_C static CUri16* NewLC();
161 IMPORT_C static CUri16* ResolveL(const TUriC16& aBaseUri, const TUriC16& aRefUri);
164 IMPORT_C const TUriC16& Uri() const;
165 IMPORT_C void SetComponentL(const TDesC16& aData, TUriComponent aComponent);
166 IMPORT_C void RemoveComponentL(TUriComponent aComponent);
170 CUri16(const TUriC16& aNewUri);
173 void InitializeFileUriComponentsL(const TDesC& aFileName, TDriveNumber aDrive, TUint aFlags);
175 private: // Attributes
177 /** The descriptor buffer that contains the uri.
181 /** The parsed uri object.
186 A friend class used for testing.
187 @see TUri16StateAccessor
191 friend class TUri16StateAccessor;
196 Do not use. Use TUriC8 instead
198 @deprecated Deprecated in 9.1
200 typedef TUriC16 TUriC;
203 Do not use. Use TUriParser8 instead
205 @deprecated Deprecated in 9.1
207 typedef TUriParser16 TUriParser;
210 Do not use. Use CUri8 instead
212 @deprecated Deprecated in 9.1
216 #endif // __URI16_H__