williamr@2
|
1 |
/*
|
williamr@2
|
2 |
* Copyright (c) 2002-2007 Nokia Corporation and/or its subsidiary(-ies).
|
williamr@2
|
3 |
* All rights reserved.
|
williamr@2
|
4 |
* This component and the accompanying materials are made available
|
williamr@4
|
5 |
* under the terms of "Eclipse Public License v1.0"
|
williamr@2
|
6 |
* which accompanies this distribution, and is available
|
williamr@4
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
williamr@2
|
8 |
*
|
williamr@2
|
9 |
* Initial Contributors:
|
williamr@2
|
10 |
* Nokia Corporation - initial contribution.
|
williamr@2
|
11 |
*
|
williamr@2
|
12 |
* Contributors:
|
williamr@2
|
13 |
*
|
williamr@2
|
14 |
* Description: Interface for quering system paths.
|
williamr@2
|
15 |
*
|
williamr@2
|
16 |
*/
|
williamr@2
|
17 |
|
williamr@2
|
18 |
|
williamr@2
|
19 |
|
williamr@2
|
20 |
#ifndef PATH_INFO_H
|
williamr@2
|
21 |
#define PATH_INFO_H
|
williamr@2
|
22 |
|
williamr@2
|
23 |
// INCLUDES
|
williamr@2
|
24 |
#include <e32std.h>
|
williamr@2
|
25 |
#include <badesca.h>
|
williamr@2
|
26 |
|
williamr@2
|
27 |
// CLASS DECLARATION
|
williamr@2
|
28 |
/**
|
williamr@2
|
29 |
* Class holds information of system paths. Platform Environment API provides
|
williamr@2
|
30 |
* interface for quering system paths. Methods provided by the API should be
|
williamr@2
|
31 |
* used instead of hard coded path names. All paths have the trailing backslash
|
williamr@2
|
32 |
* included. The API consist of the PathInfo class, DriveInfo class and system paths are defined
|
williamr@2
|
33 |
* in PathConfiguration.hrh. The DriveInfo class is defined in DriveInfo.h.
|
williamr@2
|
34 |
*
|
williamr@2
|
35 |
* Usage:
|
williamr@2
|
36 |
*
|
williamr@2
|
37 |
* @code
|
williamr@2
|
38 |
* #include <PathInfo.h>
|
williamr@2
|
39 |
*
|
williamr@2
|
40 |
* // Get the root path of Phone Memory.
|
williamr@2
|
41 |
* TFileName path = PathInfo::PhoneMemoryRootPath();
|
williamr@2
|
42 |
*
|
williamr@2
|
43 |
* // Get the games path and append the path to the root path of Phone Memory.
|
williamr@2
|
44 |
* path.Append( PathInfo::GamesPath() );
|
williamr@2
|
45 |
*
|
williamr@2
|
46 |
* // 'path' contains now the games path in Phone Memory.
|
williamr@2
|
47 |
* @endcode
|
williamr@2
|
48 |
*
|
williamr@2
|
49 |
* Error handling:
|
williamr@2
|
50 |
*
|
williamr@2
|
51 |
* The panic mechanism is used to handle programming errors.
|
williamr@2
|
52 |
* GetPath(TInt aPath) method will panic if invalid parameter is given as input.
|
williamr@2
|
53 |
* The panic category is named PATHINFO and panic code is:
|
williamr@2
|
54 |
*
|
williamr@2
|
55 |
* - EInvalidParameter = 0 (Invalid parameter.)
|
williamr@2
|
56 |
*
|
williamr@2
|
57 |
* @lib PlatformEnv.dll
|
williamr@2
|
58 |
* @since 2.0
|
williamr@2
|
59 |
*/
|
williamr@2
|
60 |
|
williamr@2
|
61 |
class PathInfo
|
williamr@2
|
62 |
{
|
williamr@2
|
63 |
public:
|
williamr@2
|
64 |
|
williamr@2
|
65 |
/**
|
williamr@2
|
66 |
* Enumeration System Paths defines values to be used for the aPath parameter
|
williamr@2
|
67 |
* in GetPath and GetFullPath methods.
|
williamr@2
|
68 |
* @since 3.2
|
williamr@2
|
69 |
*/
|
williamr@2
|
70 |
enum TSystemPaths
|
williamr@2
|
71 |
{
|
williamr@2
|
72 |
/** This value is used only as a return value of PathType() to indicate that
|
williamr@2
|
73 |
* the path is not a system path. It is not a valid system path to be given
|
williamr@2
|
74 |
* as a parameter for GetPath() or GetFullPath()
|
williamr@2
|
75 |
*/
|
williamr@2
|
76 |
ENotSystemPath = -1,
|
williamr@2
|
77 |
/** To get the root path in ROM.
|
williamr@2
|
78 |
*/
|
williamr@2
|
79 |
ERomRootPath = 0,
|
williamr@2
|
80 |
/** To get the root path in Phone Memory..
|
williamr@2
|
81 |
*/
|
williamr@2
|
82 |
EPhoneMemoryRootPath,
|
williamr@2
|
83 |
/** To get the root path in Memory Card.
|
williamr@2
|
84 |
*/
|
williamr@2
|
85 |
EMemoryCardRootPath,
|
williamr@2
|
86 |
/** To get the games path to be appended to a root path.
|
williamr@2
|
87 |
*/
|
williamr@2
|
88 |
EGamesPath,
|
williamr@2
|
89 |
/** To get the installs path to be appended to a root path.
|
williamr@2
|
90 |
*/
|
williamr@2
|
91 |
EInstallsPath,
|
williamr@2
|
92 |
/** To get the others path to be appended to a root path.
|
williamr@2
|
93 |
*/
|
williamr@2
|
94 |
EOthersPath,
|
williamr@2
|
95 |
/** To get the videos path to be appended to a root path.
|
williamr@2
|
96 |
*/
|
williamr@2
|
97 |
EVideosPath,
|
williamr@2
|
98 |
/** To get the images path to be appended to a root path.
|
williamr@2
|
99 |
*/
|
williamr@2
|
100 |
EImagesPath,
|
williamr@2
|
101 |
/** To get the GSM pictures path to be appended to a root path.
|
williamr@2
|
102 |
*/
|
williamr@2
|
103 |
EGsmPicturesPath,
|
williamr@2
|
104 |
/** To get the MMS pictures path to be appended to a root path.
|
williamr@2
|
105 |
*/
|
williamr@2
|
106 |
EMmsBackgroundImagesPath,
|
williamr@2
|
107 |
/** To get the presence logos path to be appended to a root path.
|
williamr@2
|
108 |
*/
|
williamr@2
|
109 |
EPresenceLogosPath,
|
williamr@2
|
110 |
/** To get the sounds path to be appended to a root path.
|
williamr@2
|
111 |
*/
|
williamr@2
|
112 |
ESoundsPath,
|
williamr@2
|
113 |
/** To get the digital sounds path to be appended to a root path.
|
williamr@2
|
114 |
*/
|
williamr@2
|
115 |
EDigitalSoundsPath,
|
williamr@2
|
116 |
/** To get the simple sounds path to be appended to a root path.
|
williamr@2
|
117 |
*/
|
williamr@2
|
118 |
ESimpleSoundsPath,
|
williamr@2
|
119 |
/** To get the images thumbnail path.
|
williamr@2
|
120 |
* The thumbnail images directory exists under the same directory
|
williamr@2
|
121 |
* where the corresponding image is.
|
williamr@2
|
122 |
* Do not try to append this to a root directory.
|
williamr@2
|
123 |
*/
|
williamr@2
|
124 |
EImagesThumbnailPath,
|
williamr@2
|
125 |
/** To get the full path of the contacts folder in the memory card.
|
williamr@2
|
126 |
* The path also contains the drive letter. Do not try to append
|
williamr@2
|
127 |
* this to any root directory.
|
williamr@2
|
128 |
*/
|
williamr@2
|
129 |
EMemoryCardContactsPath
|
williamr@2
|
130 |
|
williamr@2
|
131 |
};
|
williamr@2
|
132 |
|
williamr@2
|
133 |
/**
|
williamr@2
|
134 |
* This method returns the root path in ROM.
|
williamr@2
|
135 |
* Corresponding TSystemPaths value of the returned path is ERomRootPath.
|
williamr@2
|
136 |
*
|
williamr@2
|
137 |
* @return The root path in ROM.
|
williamr@2
|
138 |
*
|
williamr@2
|
139 |
* @see TSystemPaths
|
williamr@2
|
140 |
*/
|
williamr@2
|
141 |
IMPORT_C static const TDesC& RomRootPath();
|
williamr@2
|
142 |
/**
|
williamr@2
|
143 |
* This method returns the root path in Phone Memory.
|
williamr@2
|
144 |
* Corresponding TSystemPaths value of the returned path is EPhoneMemoryRootPath.
|
williamr@2
|
145 |
*
|
williamr@2
|
146 |
* @return The root path in Phone Memory.
|
williamr@2
|
147 |
*
|
williamr@2
|
148 |
* @see TSystemPaths
|
williamr@2
|
149 |
*/
|
williamr@2
|
150 |
IMPORT_C static const TDesC& PhoneMemoryRootPath();
|
williamr@2
|
151 |
/**
|
williamr@2
|
152 |
* This method returns the root path in Memory Card.
|
williamr@2
|
153 |
* Corresponding TSystemPaths value of the returned path is EMemoryCardRootPath.
|
williamr@2
|
154 |
*
|
williamr@2
|
155 |
* @return The root path in Memory Card.
|
williamr@2
|
156 |
*
|
williamr@2
|
157 |
* @see TSystemPaths
|
williamr@2
|
158 |
*/
|
williamr@2
|
159 |
IMPORT_C static const TDesC& MemoryCardRootPath();
|
williamr@2
|
160 |
|
williamr@2
|
161 |
|
williamr@2
|
162 |
/**
|
williamr@2
|
163 |
* This method returns the games path to be appended to a root path.
|
williamr@2
|
164 |
* Corresponding TSystemPaths value of the returned path is EGamesPath.
|
williamr@2
|
165 |
*
|
williamr@2
|
166 |
* @return The games path.
|
williamr@2
|
167 |
*
|
williamr@2
|
168 |
* @see TSystemPaths
|
williamr@2
|
169 |
*/
|
williamr@2
|
170 |
IMPORT_C static const TDesC& GamesPath();
|
williamr@2
|
171 |
/**
|
williamr@2
|
172 |
* This method returns the installs path to be appended to a root path.
|
williamr@2
|
173 |
* Corresponding TSystemPaths value of the returned path is EInstallsPath.
|
williamr@2
|
174 |
*
|
williamr@2
|
175 |
* @return The installs path.
|
williamr@2
|
176 |
*
|
williamr@2
|
177 |
* @see TSystemPaths
|
williamr@2
|
178 |
*/
|
williamr@2
|
179 |
IMPORT_C static const TDesC& InstallsPath();
|
williamr@2
|
180 |
/**
|
williamr@2
|
181 |
* This method returns the others path to be appended to a root path.
|
williamr@2
|
182 |
* Corresponding TSystemPaths value of the returned path is EOthersPath.
|
williamr@2
|
183 |
*
|
williamr@2
|
184 |
* @return The installs path.
|
williamr@2
|
185 |
*
|
williamr@2
|
186 |
* @see TSystemPaths
|
williamr@2
|
187 |
*/
|
williamr@2
|
188 |
IMPORT_C static const TDesC& OthersPath();
|
williamr@2
|
189 |
/**
|
williamr@2
|
190 |
* This method returns the videos path to be appended to a root path.
|
williamr@2
|
191 |
* Corresponding TSystemPaths value of the returned path is EVideosPath.
|
williamr@2
|
192 |
*
|
williamr@2
|
193 |
* @return The videos path.
|
williamr@2
|
194 |
*
|
williamr@2
|
195 |
* @see TSystemPaths
|
williamr@2
|
196 |
*/
|
williamr@2
|
197 |
IMPORT_C static const TDesC& VideosPath();
|
williamr@2
|
198 |
/**
|
williamr@2
|
199 |
* This method returns the images path to be appended to a root path.
|
williamr@2
|
200 |
* Corresponding TSystemPaths value of the returned path is EImagesPath.
|
williamr@2
|
201 |
*
|
williamr@2
|
202 |
* @return The images path.
|
williamr@2
|
203 |
*
|
williamr@2
|
204 |
* @see TSystemPaths
|
williamr@2
|
205 |
*/
|
williamr@2
|
206 |
IMPORT_C static const TDesC& ImagesPath();
|
williamr@2
|
207 |
/**
|
williamr@2
|
208 |
* This method returns the pictures path to be appended to a root path.
|
williamr@2
|
209 |
* Corresponding TSystemPaths value of the returned path is EGsmPicturesPath.
|
williamr@2
|
210 |
*
|
williamr@2
|
211 |
* @return The pictures path.
|
williamr@2
|
212 |
*
|
williamr@2
|
213 |
* @deprecated Use GmsPicturesPath() instead.
|
williamr@2
|
214 |
*
|
williamr@2
|
215 |
* @see TSystemPaths
|
williamr@2
|
216 |
*/
|
williamr@2
|
217 |
IMPORT_C static const TDesC& PicturesPath();
|
williamr@2
|
218 |
/**
|
williamr@2
|
219 |
* This method returns the GMS pictures path to be appended to
|
williamr@2
|
220 |
* a root path.
|
williamr@2
|
221 |
* Corresponding TSystemPaths value of the returned path is EGsmPicturesPath.
|
williamr@2
|
222 |
*
|
williamr@2
|
223 |
* @return The GSM pictures path.
|
williamr@2
|
224 |
*
|
williamr@2
|
225 |
* @see TSystemPaths
|
williamr@2
|
226 |
*/
|
williamr@2
|
227 |
IMPORT_C static const TDesC& GmsPicturesPath();
|
williamr@2
|
228 |
/**
|
williamr@2
|
229 |
* This method returns the MMS background images path to be appended to
|
williamr@2
|
230 |
* a root path.
|
williamr@2
|
231 |
* Corresponding TSystemPaths value of the returned path is EMmsBackgroundImagesPath.
|
williamr@2
|
232 |
*
|
williamr@2
|
233 |
* @return The MMS background images path.
|
williamr@2
|
234 |
*
|
williamr@2
|
235 |
* @see TSystemPaths
|
williamr@2
|
236 |
*/
|
williamr@2
|
237 |
IMPORT_C static const TDesC& MmsBackgroundImagesPath();
|
williamr@2
|
238 |
/**
|
williamr@2
|
239 |
* This method returns the presence logos path to be appended to
|
williamr@2
|
240 |
* a root path.
|
williamr@2
|
241 |
* Corresponding TSystemPaths value of the returned path is EPresenceLogosPath.
|
williamr@2
|
242 |
*
|
williamr@2
|
243 |
* @return The presence logos path.
|
williamr@2
|
244 |
*
|
williamr@2
|
245 |
* @see TSystemPaths
|
williamr@2
|
246 |
*/
|
williamr@2
|
247 |
IMPORT_C static const TDesC& PresenceLogosPath();
|
williamr@2
|
248 |
/**
|
williamr@2
|
249 |
* This method returns the sounds path to be appended to a root path.
|
williamr@2
|
250 |
* Corresponding TSystemPaths value of the returned path is ESoundsPath.
|
williamr@2
|
251 |
*
|
williamr@2
|
252 |
* @return The sounds path.
|
williamr@2
|
253 |
*
|
williamr@2
|
254 |
* @see TSystemPaths
|
williamr@2
|
255 |
*/
|
williamr@2
|
256 |
IMPORT_C static const TDesC& SoundsPath();
|
williamr@2
|
257 |
/**
|
williamr@2
|
258 |
* This method returns the digital sounds path to be appended to
|
williamr@2
|
259 |
* a root path.
|
williamr@2
|
260 |
* Corresponding TSystemPaths value of the returned path is EDigitalSoundsPath.
|
williamr@2
|
261 |
*
|
williamr@2
|
262 |
* @return The digital sounds path.
|
williamr@2
|
263 |
*
|
williamr@2
|
264 |
* @see TSystemPaths
|
williamr@2
|
265 |
*/
|
williamr@2
|
266 |
IMPORT_C static const TDesC& DigitalSoundsPath();
|
williamr@2
|
267 |
/**
|
williamr@2
|
268 |
* This method returns the simple sounds path to be appended to
|
williamr@2
|
269 |
* a root path.
|
williamr@2
|
270 |
* Corresponding TSystemPaths value of the returned path is ESimpleSoundsPath.
|
williamr@2
|
271 |
*
|
williamr@2
|
272 |
* @return The simple sound path.
|
williamr@2
|
273 |
*
|
williamr@2
|
274 |
* @see TSystemPaths
|
williamr@2
|
275 |
*/
|
williamr@2
|
276 |
IMPORT_C static const TDesC& SimpleSoundsPath();
|
williamr@2
|
277 |
|
williamr@2
|
278 |
// ---------------------------------------------------------------------
|
williamr@2
|
279 |
// Paths that are not necessarily under root directories
|
williamr@2
|
280 |
// ---------------------------------------------------------------------
|
williamr@2
|
281 |
|
williamr@2
|
282 |
/**
|
williamr@2
|
283 |
* This method returns a thumbnail images path. The thumbnail images
|
williamr@2
|
284 |
* directory exists under the same directory where the corresponding
|
williamr@2
|
285 |
* image is. Do not try to append this to a root directory.
|
williamr@2
|
286 |
* Corresponding TSystemPaths value of the returned path is EImagesThumbnailPath.
|
williamr@2
|
287 |
*
|
williamr@2
|
288 |
* @return The thumbnail images path.
|
williamr@2
|
289 |
*
|
williamr@2
|
290 |
* @see TSystemPaths
|
williamr@2
|
291 |
*/
|
williamr@2
|
292 |
IMPORT_C static const TDesC& ImagesThumbnailPath();
|
williamr@2
|
293 |
|
williamr@2
|
294 |
/**
|
williamr@2
|
295 |
* This method returns the full path of the contacts folder in
|
williamr@2
|
296 |
* the memory card. The path also contains the drive letter.
|
williamr@2
|
297 |
* Do not try to append this to any root directory.
|
williamr@2
|
298 |
* Corresponding TSystemPaths value of the returned path is EMemoryCardContactsPath.
|
williamr@2
|
299 |
*
|
williamr@2
|
300 |
* @return The full path of the contacts folder in the memory card.
|
williamr@2
|
301 |
*
|
williamr@2
|
302 |
* @see TSystemPaths
|
williamr@2
|
303 |
*/
|
williamr@2
|
304 |
IMPORT_C static const TDesC& MemoryCardContactsPath();
|
williamr@2
|
305 |
|
williamr@2
|
306 |
/**
|
williamr@2
|
307 |
* This method returns the requested system path.
|
williamr@2
|
308 |
*
|
williamr@2
|
309 |
* @since 3.2
|
williamr@2
|
310 |
* @param aPath Defines the requested system path.
|
williamr@2
|
311 |
* @return The requested system path.
|
williamr@2
|
312 |
*
|
williamr@2
|
313 |
* @panic EInvalidParameter Parameter aPath is invalid.
|
williamr@2
|
314 |
*
|
williamr@2
|
315 |
* One small sample describing the usage of the method.
|
williamr@2
|
316 |
* @code
|
williamr@2
|
317 |
* #include <PathInfo.h>
|
williamr@2
|
318 |
*
|
williamr@2
|
319 |
* // Get the the full path of the contacts folder in the memory card.
|
williamr@2
|
320 |
* TFileName path = PathInfo::GetPath( PathInfo::EMemoryCardContactsPath );
|
williamr@2
|
321 |
*
|
williamr@2
|
322 |
* // 'path' contains now the full path of the contacts folder in the memory card..
|
williamr@2
|
323 |
* @endcode
|
williamr@2
|
324 |
*
|
williamr@2
|
325 |
* @see TSystemPaths
|
williamr@2
|
326 |
*/
|
williamr@2
|
327 |
IMPORT_C static const TDesC& GetPath( TInt aPath );
|
williamr@2
|
328 |
|
williamr@2
|
329 |
/**
|
williamr@2
|
330 |
* This method gets the root path of the requested drive.
|
williamr@2
|
331 |
* The root path is the path where the system paths are located.
|
williamr@2
|
332 |
*
|
williamr@2
|
333 |
* @since 3.2
|
williamr@2
|
334 |
* @param aRootPath Stores the path, the maximum path length is KMaxPath.
|
williamr@2
|
335 |
* @param aDrive A drive identifier specified by TDriveNumber.
|
williamr@2
|
336 |
* @return A system wide error code.
|
williamr@2
|
337 |
*
|
williamr@2
|
338 |
* One small sample describing the usage of the method.
|
williamr@2
|
339 |
* @code
|
williamr@2
|
340 |
* #include <PathInfo.h>
|
williamr@2
|
341 |
* #include <DriveInfo.h>
|
williamr@2
|
342 |
*
|
williamr@2
|
343 |
* // Get the root path of the default phone memory.
|
williamr@2
|
344 |
* TInt drive;
|
williamr@2
|
345 |
* User::LeaveIfError( DriveInfo::GetDefaultDrive(
|
williamr@2
|
346 |
* DriveInfo::EDefaultPhoneMemory, drive ) );
|
williamr@2
|
347 |
* TFileName path;
|
williamr@2
|
348 |
* User::LeaveIfError( PathInfo::GetRootPath( path, drive ) );
|
williamr@2
|
349 |
*
|
williamr@2
|
350 |
* // 'path' contains now the default folder root path of the default phone memory.
|
williamr@2
|
351 |
* @endcode
|
williamr@2
|
352 |
*
|
williamr@2
|
353 |
* @see TDriveNumber
|
williamr@2
|
354 |
* @see KMaxPath
|
williamr@2
|
355 |
* @see DriveInfo
|
williamr@2
|
356 |
*/
|
williamr@2
|
357 |
IMPORT_C static TInt GetRootPath( TDes& aRootPath, TInt aDrive );
|
williamr@2
|
358 |
|
williamr@2
|
359 |
/**
|
williamr@2
|
360 |
* This method gets the full path of the requested system path in the requested drive.
|
williamr@2
|
361 |
* KErrNotFound is returned when the drive has no requested system path or
|
williamr@2
|
362 |
* the requested path cannot be added to the root path.
|
williamr@2
|
363 |
*
|
williamr@2
|
364 |
* @since 3.2
|
williamr@2
|
365 |
* @param aFullPath Stores the requested path, the maximum path length is KMaxPath.
|
williamr@2
|
366 |
* @param aDrive A drive identifier specified by TDriveNumber.
|
williamr@2
|
367 |
* @param aPath Defines the requested system path.
|
williamr@2
|
368 |
* @return A system wide error codes.
|
williamr@2
|
369 |
*
|
williamr@2
|
370 |
* One small sample describing the usage of the method.
|
williamr@2
|
371 |
* @code
|
williamr@2
|
372 |
* #include <PathInfo.h>
|
williamr@2
|
373 |
* #include <DriveInfo.h>
|
williamr@2
|
374 |
*
|
williamr@2
|
375 |
* // Get the full path of the images folder in the default
|
williamr@2
|
376 |
* // phone memory drive.
|
williamr@2
|
377 |
* TFileName path;
|
williamr@2
|
378 |
* TInt drive;
|
williamr@2
|
379 |
* User::LeaveIfError( DriveInfo::GetDefaultDrive(
|
williamr@2
|
380 |
* DriveInfo::EDefaultPhoneMemory, drive ) );
|
williamr@2
|
381 |
* User::LeaveIfError( PathInfo::GetFullPath( path, drive, PathInfo::EImages ) );
|
williamr@2
|
382 |
*
|
williamr@2
|
383 |
* // 'path' contains now the full path of the images folder in the default
|
williamr@2
|
384 |
* // phone memory drive.
|
williamr@2
|
385 |
* @endcode
|
williamr@2
|
386 |
*
|
williamr@2
|
387 |
* @see TDriveNumber
|
williamr@2
|
388 |
* @see KMaxPath
|
williamr@2
|
389 |
* @see TSystemPaths
|
williamr@2
|
390 |
* @see DriveInfo
|
williamr@2
|
391 |
*/
|
williamr@2
|
392 |
IMPORT_C static TInt GetFullPath( TDes& aFullPath, TInt aDrive, TInt aPath );
|
williamr@2
|
393 |
|
williamr@2
|
394 |
/**
|
williamr@2
|
395 |
* This method returns the system path type of the given path.
|
williamr@2
|
396 |
* Thumbnail system path can exist in any folder.
|
williamr@2
|
397 |
* Other paths must be exact system paths, not subfolders of a system path
|
williamr@2
|
398 |
* ENotSystemPath is returned, if the path is not a system path.
|
williamr@2
|
399 |
* The given path must have backslash ending.
|
williamr@2
|
400 |
*
|
williamr@2
|
401 |
* @since 3.2
|
williamr@2
|
402 |
* @param aFullPath A path to be type checked
|
williamr@2
|
403 |
* @return A value specified by TSystemPaths
|
williamr@2
|
404 |
*
|
williamr@2
|
405 |
* One small sample describing the usage of the method.
|
williamr@2
|
406 |
* @code
|
williamr@2
|
407 |
* #include <PathInfo.h>
|
williamr@2
|
408 |
*
|
williamr@2
|
409 |
* // Check the type of the system path.
|
williamr@2
|
410 |
* _LIT( KImagesPath, "E:\\Images\\" );
|
williamr@2
|
411 |
* TInt type( PathInfo::PathType( KImagesPath ) );
|
williamr@2
|
412 |
*
|
williamr@2
|
413 |
* // 'type' contains now the EImagesPath value.
|
williamr@2
|
414 |
* @endcode
|
williamr@2
|
415 |
*
|
williamr@2
|
416 |
* @see TSystemPaths
|
williamr@2
|
417 |
*/
|
williamr@2
|
418 |
IMPORT_C static TInt PathType( const TDesC& aFullPath );
|
williamr@2
|
419 |
|
williamr@2
|
420 |
/**
|
williamr@2
|
421 |
* This method gets the list of full system paths in the requested drive
|
williamr@2
|
422 |
* and leaves the returned pointer in cleanup stack.
|
williamr@2
|
423 |
*
|
williamr@2
|
424 |
* @since 3.2
|
williamr@2
|
425 |
* @param aDrive A drive identifier specified by TDriveNumber.
|
williamr@2
|
426 |
* @return A list of the system paths. Ownership is transferred.
|
williamr@2
|
427 |
*
|
williamr@2
|
428 |
* One small sample describing the usage of the method.
|
williamr@2
|
429 |
* @code
|
williamr@2
|
430 |
* #include <PathInfo.h>
|
williamr@2
|
431 |
* #include <DriveInfo.h>
|
williamr@2
|
432 |
*
|
williamr@2
|
433 |
* // Create the default path structure for default mass storage drive
|
williamr@2
|
434 |
* TInt drive;
|
williamr@2
|
435 |
* User::LeaveIfError( DriveInfo::GetDefaultDrive(
|
williamr@2
|
436 |
* DriveInfo::EDefaultMassStorage, drive ) );
|
williamr@2
|
437 |
* CDesCArray* paths = PathInfo::GetListOfPathsLC( drive );
|
williamr@2
|
438 |
* TInt count( paths->MdcaCount() );
|
williamr@2
|
439 |
* for ( TInt i( 0 ); i < count; ++i )
|
williamr@2
|
440 |
* {
|
williamr@2
|
441 |
* User::LeaveIfError( iFs.MkDirAll( paths->MdcaPoint( i ) );
|
williamr@2
|
442 |
* }
|
williamr@2
|
443 |
* CleanupStack::PopAndDestroy( paths );
|
williamr@2
|
444 |
* // The default mass storage drive contains now the default path structure
|
williamr@2
|
445 |
* @endcode
|
williamr@2
|
446 |
*
|
williamr@2
|
447 |
* @see TDriveNumber
|
williamr@2
|
448 |
* @see DriveInfo
|
williamr@2
|
449 |
*/
|
williamr@2
|
450 |
IMPORT_C static CDesCArray* GetListOfPathsLC( TInt aDrive );
|
williamr@2
|
451 |
|
williamr@2
|
452 |
/**
|
williamr@2
|
453 |
* This method gets the list of full system paths in the requested drive.
|
williamr@2
|
454 |
*
|
williamr@2
|
455 |
* @since 3.2
|
williamr@2
|
456 |
* @param aDrive A drive identifier specified by TDriveNumber.
|
williamr@2
|
457 |
* @return A list of the system paths. Ownership is transferred.
|
williamr@2
|
458 |
*
|
williamr@2
|
459 |
* @see TDriveNumber
|
williamr@2
|
460 |
*/
|
williamr@2
|
461 |
IMPORT_C static CDesCArray* GetListOfPathsL( TInt aDrive );
|
williamr@2
|
462 |
|
williamr@2
|
463 |
private:
|
williamr@2
|
464 |
|
williamr@2
|
465 |
/**
|
williamr@2
|
466 |
* C++ default constructor.
|
williamr@2
|
467 |
*/
|
williamr@2
|
468 |
PathInfo();
|
williamr@2
|
469 |
};
|
williamr@2
|
470 |
|
williamr@2
|
471 |
#endif // PATH_INFO_H
|
williamr@2
|
472 |
|
williamr@2
|
473 |
// End of File
|