williamr@2
|
1 |
// Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
|
williamr@2
|
2 |
// All rights reserved.
|
williamr@2
|
3 |
// This component and the accompanying materials are made available
|
williamr@4
|
4 |
// under the terms of "Eclipse Public License v1.0"
|
williamr@2
|
5 |
// which accompanies this distribution, and is available
|
williamr@4
|
6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
williamr@2
|
7 |
//
|
williamr@2
|
8 |
// Initial Contributors:
|
williamr@2
|
9 |
// Nokia Corporation - initial contribution.
|
williamr@2
|
10 |
//
|
williamr@2
|
11 |
// Contributors:
|
williamr@2
|
12 |
//
|
williamr@2
|
13 |
// Description:
|
williamr@2
|
14 |
// This file contains the API definition for the classes TUriC16 and
|
williamr@2
|
15 |
// CUri16. These classes provide non-modifying (TUriC16) and modifying
|
williamr@2
|
16 |
// (CUri16) functionality for the components of a Uri as described in
|
williamr@2
|
17 |
// RFC2396.
|
williamr@2
|
18 |
//
|
williamr@2
|
19 |
//
|
williamr@2
|
20 |
|
williamr@2
|
21 |
/**
|
williamr@2
|
22 |
@file Uri16.h
|
williamr@2
|
23 |
@publishedAll
|
williamr@2
|
24 |
@deprecated Deprecated in 9.1
|
williamr@2
|
25 |
*/
|
williamr@2
|
26 |
|
williamr@2
|
27 |
#ifndef __URI16_H__
|
williamr@2
|
28 |
#define __URI16_H__
|
williamr@2
|
29 |
|
williamr@2
|
30 |
// System includes
|
williamr@2
|
31 |
//
|
williamr@2
|
32 |
#include <e32base.h>
|
williamr@2
|
33 |
#include <f32file.h>
|
williamr@2
|
34 |
#include <uricommon.h>
|
williamr@2
|
35 |
|
williamr@2
|
36 |
|
williamr@2
|
37 |
class TUriC16
|
williamr@2
|
38 |
/**
|
williamr@2
|
39 |
Dependencies : TUriComponent.
|
williamr@2
|
40 |
Comments : Provides non-modifying functionality on the components of a uri object as
|
williamr@2
|
41 |
defined in RFC2396. There are 5 components; scheme, authority, path, query and fragment.
|
williamr@2
|
42 |
|
williamr@2
|
43 |
The object holds descriptor pointers to the parsed uri components and a descriptor pointer
|
williamr@2
|
44 |
to the uri. It is non-owning. It uses 16-bit descriptors.
|
williamr@2
|
45 |
|
williamr@2
|
46 |
The functionality provided by this API allows the uri components to be extracted from the
|
williamr@2
|
47 |
parsed uri, checked for their presence in the uri and be compared with those in another
|
williamr@2
|
48 |
TUriC16 object.
|
williamr@2
|
49 |
@publishedAll
|
williamr@2
|
50 |
@deprecated Deprecated in 9.1
|
williamr@2
|
51 |
@since 6.0
|
williamr@2
|
52 |
*/
|
williamr@2
|
53 |
{
|
williamr@2
|
54 |
public: // Methods
|
williamr@2
|
55 |
|
williamr@2
|
56 |
IMPORT_C HBufC* GetFileNameL() const;
|
williamr@2
|
57 |
IMPORT_C HBufC* GetFileNameL(TUriFileName aType) const;
|
williamr@2
|
58 |
IMPORT_C const TDesC16& Extract(TUriComponent aComponent) const;
|
williamr@2
|
59 |
IMPORT_C void UriWithoutFragment(TPtrC16& aUriNoFrag) const;
|
williamr@2
|
60 |
|
williamr@2
|
61 |
IMPORT_C TBool IsPresent(TUriComponent aComponent) const;
|
williamr@2
|
62 |
IMPORT_C TBool IsSchemeValid() const;
|
williamr@2
|
63 |
|
williamr@2
|
64 |
IMPORT_C TInt Compare(const TUriC16& aUri, TUriComponent aComponent) const;
|
williamr@2
|
65 |
|
williamr@2
|
66 |
IMPORT_C const TDesC16& UriDes() const;
|
williamr@2
|
67 |
|
williamr@2
|
68 |
IMPORT_C TInt Validate() const;
|
williamr@2
|
69 |
IMPORT_C TInt Equivalent(const TUriC16& aUri) const;
|
williamr@2
|
70 |
IMPORT_C HBufC* DisplayFormL(TUriComponent aComponent = EUriComplete) const;
|
williamr@2
|
71 |
|
williamr@2
|
72 |
protected: // Methods
|
williamr@2
|
73 |
|
williamr@2
|
74 |
IMPORT_C TUriC16();
|
williamr@2
|
75 |
|
williamr@2
|
76 |
void Reset();
|
williamr@2
|
77 |
|
williamr@2
|
78 |
private: // Methods
|
williamr@2
|
79 |
|
williamr@2
|
80 |
TInt ValidateL() const;
|
williamr@2
|
81 |
TInt EquivalentL(const TDesC16& aUri) const;
|
williamr@2
|
82 |
|
williamr@2
|
83 |
protected: // Attributes
|
williamr@2
|
84 |
|
williamr@2
|
85 |
/** The array of descriptor pointers to the uri components.
|
williamr@2
|
86 |
*/
|
williamr@2
|
87 |
TPtrC16 iComponent[EUriMaxComponents];
|
williamr@2
|
88 |
|
williamr@2
|
89 |
/** The descriptor pointer to the uri.
|
williamr@2
|
90 |
*/
|
williamr@2
|
91 |
TPtrC16 iUriDes;
|
williamr@2
|
92 |
|
williamr@2
|
93 |
/**
|
williamr@2
|
94 |
A friend class.
|
williamr@2
|
95 |
@see CUri16
|
williamr@2
|
96 |
@since 6.0
|
williamr@2
|
97 |
*/
|
williamr@2
|
98 |
friend class CUri16;
|
williamr@4
|
99 |
#ifdef SYMBIAN_ENABLE_SPLIT_HEADERS
|
williamr@4
|
100 |
/**
|
williamr@4
|
101 |
A friend class used for testing.
|
williamr@4
|
102 |
@see TUriC16StateAccessor
|
williamr@4
|
103 |
@since 6.0
|
williamr@4
|
104 |
*/
|
williamr@4
|
105 |
#else
|
williamr@2
|
106 |
/**
|
williamr@2
|
107 |
A friend class used for testing.
|
williamr@2
|
108 |
@see TUriC16StateAccessor
|
williamr@2
|
109 |
@since 6.0
|
williamr@2
|
110 |
@internalComponent
|
williamr@2
|
111 |
*/
|
williamr@4
|
112 |
#endif //SYMBIAN_ENABLE_SPLIT_HEADERS
|
williamr@2
|
113 |
friend class TUriC16StateAccessor;
|
williamr@2
|
114 |
|
williamr@2
|
115 |
};
|
williamr@2
|
116 |
|
williamr@2
|
117 |
/**
|
williamr@2
|
118 |
Dependencies : TUriC16
|
williamr@2
|
119 |
Comments : Provides functionality to parse a descriptor into the components of a uri as
|
williamr@2
|
120 |
defined in RFC2396. There are 5 components; scheme, authority, path, query and fragment.
|
williamr@2
|
121 |
|
williamr@2
|
122 |
It uses 16-bit descriptors.
|
williamr@2
|
123 |
|
williamr@2
|
124 |
Format of a uri is; scheme://authority path?query\#fragment
|
williamr@2
|
125 |
|
williamr@2
|
126 |
@warning The descriptor that is parsed by an object of this class will be referenced
|
williamr@2
|
127 |
by that object. If the original descriptor is no longer in scope there will be undefined
|
williamr@2
|
128 |
behaviour.
|
williamr@2
|
129 |
@publishedAll
|
williamr@2
|
130 |
@deprecated Deprecated in 9.1. Use UriUtils::CreateUriL() instead
|
williamr@2
|
131 |
@since 6.0
|
williamr@2
|
132 |
*/
|
williamr@2
|
133 |
class TUriParser16 : public TUriC16
|
williamr@2
|
134 |
{
|
williamr@2
|
135 |
public: // Methods
|
williamr@2
|
136 |
|
williamr@2
|
137 |
IMPORT_C TUriParser16();
|
williamr@2
|
138 |
IMPORT_C TInt Parse(const TDesC16& aUri);
|
williamr@2
|
139 |
};
|
williamr@2
|
140 |
|
williamr@2
|
141 |
/**
|
williamr@2
|
142 |
Dependencies : CBase, TUriC16.
|
williamr@2
|
143 |
Comments : Provides modifying functionality on the components of a uri object, as
|
williamr@2
|
144 |
defined in RFC2396. There are 5 components; scheme. authority, path, query and fragment.
|
williamr@2
|
145 |
|
williamr@2
|
146 |
The object holds parsed uri information. It is owning. It uses 16-bit descriptors.
|
williamr@2
|
147 |
|
williamr@2
|
148 |
The functionality provided by this API allows the uri components to be set or removed
|
williamr@2
|
149 |
from this parsed uri. Also, it provides a reference to TUriC16 object so that the non-modifying
|
williamr@2
|
150 |
functionality can be used.
|
williamr@2
|
151 |
@publishedAll
|
williamr@2
|
152 |
@deprecated Deprecated in 9.1
|
williamr@2
|
153 |
@since 6.0
|
williamr@2
|
154 |
*/
|
williamr@2
|
155 |
class CUri16 : public CBase
|
williamr@2
|
156 |
{
|
williamr@2
|
157 |
public: // Methods
|
williamr@2
|
158 |
IMPORT_C static CUri16* CreateFileUriL(const TDesC& aFullFileName, TUint aFlags = 0);
|
williamr@2
|
159 |
IMPORT_C static CUri16* CreatePrivateFileUriL(const TDesC& aRelativeFileName, TDriveNumber aDrive, TInt aFlags = 0);
|
williamr@2
|
160 |
|
williamr@2
|
161 |
IMPORT_C static CUri16* NewL(const TUriC16& aUri);
|
williamr@2
|
162 |
IMPORT_C static CUri16* NewLC(const TUriC16& aUri);
|
williamr@2
|
163 |
IMPORT_C static CUri16* NewL();
|
williamr@2
|
164 |
IMPORT_C static CUri16* NewLC();
|
williamr@2
|
165 |
|
williamr@2
|
166 |
IMPORT_C static CUri16* ResolveL(const TUriC16& aBaseUri, const TUriC16& aRefUri);
|
williamr@2
|
167 |
|
williamr@2
|
168 |
IMPORT_C ~CUri16();
|
williamr@2
|
169 |
IMPORT_C const TUriC16& Uri() const;
|
williamr@2
|
170 |
IMPORT_C void SetComponentL(const TDesC16& aData, TUriComponent aComponent);
|
williamr@2
|
171 |
IMPORT_C void RemoveComponentL(TUriComponent aComponent);
|
williamr@2
|
172 |
|
williamr@2
|
173 |
private: // Methods
|
williamr@2
|
174 |
|
williamr@2
|
175 |
CUri16(const TUriC16& aNewUri);
|
williamr@2
|
176 |
void ConstructL();
|
williamr@2
|
177 |
void FormUriL();
|
williamr@2
|
178 |
void InitializeFileUriComponentsL(const TDesC& aFileName, TDriveNumber aDrive, TUint aFlags);
|
williamr@2
|
179 |
|
williamr@2
|
180 |
private: // Attributes
|
williamr@2
|
181 |
|
williamr@2
|
182 |
/** The descriptor buffer that contains the uri.
|
williamr@2
|
183 |
*/
|
williamr@2
|
184 |
HBufC16* iUriBuf;
|
williamr@2
|
185 |
|
williamr@2
|
186 |
/** The parsed uri object.
|
williamr@2
|
187 |
*/
|
williamr@2
|
188 |
TUriC16 iUri;
|
williamr@4
|
189 |
#ifdef SYMBIAN_ENABLE_SPLIT_HEADERS
|
williamr@4
|
190 |
/**
|
williamr@4
|
191 |
A friend class used for testing.
|
williamr@4
|
192 |
@see TUri16StateAccessor
|
williamr@4
|
193 |
@since 6.0
|
williamr@4
|
194 |
*/
|
williamr@4
|
195 |
#else
|
williamr@2
|
196 |
/**
|
williamr@2
|
197 |
A friend class used for testing.
|
williamr@2
|
198 |
@see TUri16StateAccessor
|
williamr@2
|
199 |
@since 6.0
|
williamr@2
|
200 |
@internalComponent
|
williamr@2
|
201 |
*/
|
williamr@4
|
202 |
#endif //SYMBIAN_ENABLE_SPLIT_HEADERS
|
williamr@2
|
203 |
friend class TUri16StateAccessor;
|
williamr@2
|
204 |
|
williamr@2
|
205 |
};
|
williamr@2
|
206 |
|
williamr@2
|
207 |
/**
|
williamr@2
|
208 |
Do not use. Use TUriC8 instead
|
williamr@2
|
209 |
@publishedAll
|
williamr@2
|
210 |
@deprecated Deprecated in 9.1
|
williamr@2
|
211 |
*/
|
williamr@2
|
212 |
typedef TUriC16 TUriC;
|
williamr@2
|
213 |
|
williamr@2
|
214 |
/**
|
williamr@2
|
215 |
Do not use. Use TUriParser8 instead
|
williamr@2
|
216 |
@publishedAll
|
williamr@2
|
217 |
@deprecated Deprecated in 9.1
|
williamr@2
|
218 |
*/
|
williamr@2
|
219 |
typedef TUriParser16 TUriParser;
|
williamr@2
|
220 |
|
williamr@2
|
221 |
/**
|
williamr@2
|
222 |
Do not use. Use CUri8 instead
|
williamr@2
|
223 |
@publishedAll
|
williamr@2
|
224 |
@deprecated Deprecated in 9.1
|
williamr@2
|
225 |
*/
|
williamr@2
|
226 |
typedef CUri16 CUri;
|
williamr@2
|
227 |
|
williamr@2
|
228 |
#endif // __URI16_H__
|