338 /** |
338 /** |
339 * To block a diskspace so that it can gurantee for a write back from RAM disk |
339 * To block a diskspace so that it can gurantee for a write back from RAM disk |
340 * |
340 * |
341 * @return ETrue if the dummy file is created successfully, EFalse otherwise |
341 * @return ETrue if the dummy file is created successfully, EFalse otherwise |
342 */ |
342 */ |
343 TBool BlockDiskSpace( TDriveUnit aDrive, TInt aOrigDbSize, TBool aIsMTPInUse = EFalse ); |
343 TBool BlockDiskSpace( TInt aIndex, TBool aIsMTPInUse = EFalse ); |
344 |
344 |
345 /** |
345 /** |
346 * To copy db from regular drive to RAM |
346 * To copy db from regular drive to RAM |
347 * |
347 * |
348 * @return ETrue if succeed |
348 * @return ETrue if succeed |
349 * @leave KErrDiskFull if there is any difficulty copying files |
349 * |
350 */ |
350 * No-operation if fails |
351 TBool DoCopyDBToRamL( TDriveUnit aDrive, TBool aIsMTPInUse ); |
351 */ |
|
352 TBool DoCopyDBToRam( TInt aIndex, TBool aIsMTPInUse ); |
352 |
353 |
353 /** |
354 /** |
354 * To copy db back regular drive from RAM |
355 * To copy db back regular drive from RAM |
355 * |
356 * |
356 */ |
357 */ |
357 void DoCopyDBFromRamL( TInt aIndex ); |
358 void DoCopyDBFromRam( TInt aIndex ); |
358 |
359 |
359 /** |
360 /** |
360 * To replace dummy file with new content |
361 * To replace dummy file with new content |
361 * Writes over previous dummy file without freeing disk space |
362 * Writes over previous dummy file without freeing disk space |
362 */ |
363 */ |
447 * @param aCorrupt specifies whether the database is corrupted or not |
452 * @param aCorrupt specifies whether the database is corrupted or not |
448 */ |
453 */ |
449 void CreateTablesL(RSqlDatabase& aDatabase, TBool aCorrupt); |
454 void CreateTablesL(RSqlDatabase& aDatabase, TBool aCorrupt); |
450 |
455 |
451 /** |
456 /** |
452 * Opens a specified database. |
457 * Opens root database at C-drive. |
453 * @param aDrive identifies the drive unit of the database to open |
458 */ |
454 */ |
459 void OpenRootDatabaseL(); |
455 void OpenDatabaseL(TDriveUnit aDrive); |
|
456 |
460 |
457 /** |
461 /** |
458 * Creates a specified database. |
462 * Creates a specified database. |
459 * @param aDrive identifies the drive unit of the database to create |
463 * @param aDrive identifies the drive unit of the database to create |
460 */ |
464 */ |
461 void CreateDatabaseL(TDriveUnit aDrive); |
465 void CreateDatabaseL(TDriveUnit aDrive); |
462 |
466 |
463 /** |
467 /** |
464 * Attached a specified database. |
468 * Attached a specified database. |
465 * @param aDrive identifies the drive unit of the database to attach |
469 * @param aIndex Index to iDatabaseHandles |
466 */ |
470 */ |
467 void AttachDatabaseL(TDriveUnit aDrive); |
471 void AttachDatabaseL(TInt aIndex); |
468 |
472 |
469 /** |
473 /** |
470 * Detach a specified database. |
474 * Detach a specified database. |
471 * @param aDrive identifies the drive unit of the database to detach |
475 * @param aIndex Index to iDatabaseHandles |
472 */ |
476 */ |
473 void DetachDatabaseL(TDriveUnit aDrive); |
477 void DetachDatabaseL(TInt aIndex); |
|
478 |
|
479 /** |
|
480 * Open database |
|
481 * @param aIndex Index to iDatabaseHandles |
|
482 */ |
|
483 void OpenDatabaseAtIndexL( TInt aIndex ); |
|
484 |
|
485 /** |
|
486 * Close database |
|
487 * @param aIndex Index to iDatabaseHandles |
|
488 */ |
|
489 void CloseDatabaseAtIndexL(TInt aIndex); |
474 |
490 |
475 /** |
491 /** |
476 * Create filename on a specified drive unit. |
492 * Create filename on a specified drive unit. |
477 * @param aDrive identifies the drive unit |
493 * @param aDrive identifies the drive unit |
478 */ |
494 */ |