148 __PRINT1(_L("#<<- CAutoMounterFileSystem::NewFormatL() [0x%x]"), this); |
148 __PRINT1(_L("#<<- CAutoMounterFileSystem::NewFormatL() [0x%x]"), this); |
149 Fault(EMustNotBeCalled); |
149 Fault(EMustNotBeCalled); |
150 return NULL; |
150 return NULL; |
151 } |
151 } |
152 |
152 |
153 //----------------------------------------------------------------------------- |
|
154 /** |
|
155 Return the drive info |
|
156 */ |
|
157 void CAutoMounterFileSystem::DriveInfo(TDriveInfo& anInfo,TInt aDriveNumber) const |
|
158 { |
|
159 //!!!!!!!!!!!! This method shall be made the same as FAT, exFAT etc. |
|
160 //!! General idea: make all this code common for all filesystems and put it into the file server |
|
161 //!! The problem: need to have another exported method. Actually, the generic code can be placed to CFileSystem::DriveInfo() |
|
162 //!! despite it a pure virtual. |
|
163 |
|
164 __PRINT1(_L("#<<- CAutoMounterFileSystem::DriveInfo() [0x%x]"), this); |
|
165 |
|
166 if(!IsValidLocalDriveMapping(aDriveNumber)) |
|
167 return; |
|
168 |
|
169 TLocalDriveCapsV2Buf localDriveCaps; |
|
170 |
|
171 TInt r = KErrNone; |
|
172 |
|
173 // is the drive local? |
|
174 if (!IsProxyDrive(aDriveNumber)) |
|
175 { |
|
176 // if not valid local drive, use default values in localDriveCaps |
|
177 // if valid local drive and not locked, use TBusLocalDrive::Caps() values |
|
178 // if valid drive and locked, hard-code attributes |
|
179 r = GetLocalDrive(aDriveNumber).Caps(localDriveCaps); |
|
180 } |
|
181 else // this need to be made a bit nicer |
|
182 { |
|
183 CExtProxyDrive* pD = GetProxyDrive(aDriveNumber); |
|
184 if(pD) |
|
185 r = pD->Caps(localDriveCaps); |
|
186 else |
|
187 r = KErrNotReady; // What should the behaviour really be here? |
|
188 } |
|
189 |
|
190 if (r != KErrLocked ) |
|
191 { |
|
192 anInfo.iMediaAtt=localDriveCaps().iMediaAtt; |
|
193 } |
|
194 else |
|
195 { |
|
196 anInfo.iMediaAtt = KMediaAttLocked | KMediaAttLockable | KMediaAttHasPassword; |
|
197 } |
|
198 |
|
199 anInfo.iType=localDriveCaps().iType; |
|
200 anInfo.iDriveAtt=localDriveCaps().iDriveAtt; |
|
201 } |
|
202 |
153 |
203 //----------------------------------------------------------------------------- |
154 //----------------------------------------------------------------------------- |
204 |
155 |
205 #ifdef _DEBUG |
156 #ifdef _DEBUG |
206 /** |
157 /** |
301 return CFileSystem::GetInterface(aInterfaceId, aInterface, aInput); |
252 return CFileSystem::GetInterface(aInterfaceId, aInterface, aInput); |
302 |
253 |
303 } |
254 } |
304 } |
255 } |
305 |
256 |
306 //----------------------------------------------------------------------------- |
|
307 /** |
|
308 @return Boolean exclusive OR between a1 and a2 |
|
309 */ |
|
310 TBool BoolXOR(TBool a1, TBool a2) |
|
311 { |
|
312 if(!a1 && !a2) |
|
313 return EFalse; |
|
314 else if(a1 && a2) |
|
315 return EFalse; |
|
316 else |
|
317 return ETrue; |
|
318 } |
|
319 |
257 |
320 //----------------------------------------------------------------------------- |
258 //----------------------------------------------------------------------------- |
321 |
259 |
322 /** |
260 /** |
323 Find out if _all_ child file systems support the proxy drive. All childs shall behave exactly the same way. |
261 Find out if _all_ child file systems support the proxy drive. All childs shall behave exactly the same way. |