|
1 /* |
|
2 * Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: Locates files from a set of defined paths |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef CXNPATHREPOSITORY_H |
|
21 #define CXNPATHREPOSITORY_H |
|
22 |
|
23 // INCLUDES |
|
24 #include <e32base.h> |
|
25 |
|
26 // CONSTANTS |
|
27 //const ?type ?constant_var = ?constant; |
|
28 |
|
29 // MACROS |
|
30 //#define ?macro ?macro_def |
|
31 |
|
32 // DATA TYPES |
|
33 //enum ?declaration |
|
34 //typedef ?declaration |
|
35 //extern ?data_type; |
|
36 |
|
37 // FUNCTION PROTOTYPES |
|
38 //?type ?function_name(?arg_list); |
|
39 |
|
40 // FORWARD DECLARATIONS |
|
41 class RFs; |
|
42 // CLASS DECLARATION |
|
43 |
|
44 /** |
|
45 * Locates files from a set of defined paths |
|
46 * @lib ?library |
|
47 * @since Series 60 3.1 |
|
48 */ |
|
49 class CXnPathRepository : public CBase |
|
50 { |
|
51 public: // Constructors and destructor |
|
52 |
|
53 /** |
|
54 * Two-phased constructor. |
|
55 * @param aRFs File server session |
|
56 */ |
|
57 IMPORT_C static CXnPathRepository* NewL(RFs& aRFs); |
|
58 |
|
59 /** |
|
60 * Destructor. |
|
61 */ |
|
62 virtual ~CXnPathRepository(); |
|
63 |
|
64 public: // New functions |
|
65 /** |
|
66 * Add a search path |
|
67 * @since Series 60 3.1 |
|
68 * @param aPath Path to add |
|
69 * @exception KXnErrAddPathFailed Adding path to repository failed. |
|
70 */ |
|
71 IMPORT_C void AddPathL(const TDesC& aPath); |
|
72 /** |
|
73 * Locate a file and build a full path to the file. The path search order is last-in-first-out, the last added path is searched first. |
|
74 * @since Series 60 3.1 |
|
75 * @param aFileName Name of the file to locate |
|
76 * @return Full path of the file. Caller must delete the allocated pointer. |
|
77 */ |
|
78 IMPORT_C HBufC* FindFileL(const TDesC& aFileName); |
|
79 /** |
|
80 * Get paths stored in the repository. Ownership is not transferred. The paths are ordered first-in-first-out, the last added path is last in the array. |
|
81 * @since Series 60 3.1 |
|
82 * @return Paths in the repository |
|
83 */ |
|
84 IMPORT_C RPointerArray<HBufC>& Paths(); |
|
85 |
|
86 public: // Functions from base classes |
|
87 |
|
88 /** |
|
89 * From ?base_class ?member_description. |
|
90 * @since Series ?XX ?SeriesXX_version |
|
91 * @param ?arg1 ?description |
|
92 * @return ?description |
|
93 */ |
|
94 //?type ?member_function( ?type ?arg1 ); |
|
95 |
|
96 protected: // New functions |
|
97 |
|
98 /** |
|
99 * ?member_description. |
|
100 * @since Series ?XX ?SeriesXX_version |
|
101 * @param ?arg1 ?description |
|
102 * @return ?description |
|
103 */ |
|
104 //?type ?member_function( ?type ?arg1 ); |
|
105 |
|
106 |
|
107 protected: // Functions from base classes |
|
108 |
|
109 /** |
|
110 * From ?base_class ?member_description |
|
111 */ |
|
112 //?type ?member_function(); |
|
113 |
|
114 private: |
|
115 |
|
116 /** |
|
117 * C++ default constructor. |
|
118 */ |
|
119 CXnPathRepository(); |
|
120 |
|
121 /** |
|
122 * 2nd phase constructor. |
|
123 * @param aRFs File server session |
|
124 */ |
|
125 void ConstructL(RFs& aRFs); |
|
126 |
|
127 // Prohibit copy constructor if not deriving from CBase. |
|
128 // ?classname( const ?classname& ); |
|
129 // Prohibit assigment operator if not deriving from CBase. |
|
130 // ?classname& operator=( const ?classname& ); |
|
131 |
|
132 public: // Data |
|
133 // ?one_line_short_description_of_data |
|
134 //?data_declaration; |
|
135 |
|
136 protected: // Data |
|
137 // ?one_line_short_description_of_data |
|
138 //?data_declaration; |
|
139 |
|
140 private: // Data |
|
141 // search paths to use |
|
142 RPointerArray<HBufC> iPaths; |
|
143 // File server session |
|
144 RFs* iRFs; |
|
145 }; |
|
146 |
|
147 #endif // CXnPATHREPOSITORY_H |
|
148 |
|
149 // End of File |