persistentstorage/dbms/ustor/US_FILE.CPP
branchGCC_SURGE
changeset 38 c4e342fcf0c8
parent 35 0d6db0a14001
child 55 44f437012c90
equal deleted inserted replaced
27:ba32e40d9f36 38:c4e342fcf0c8
    95 	CFileStore* store;
    95 	CFileStore* store;
    96 	switch (aMode)
    96 	switch (aMode)
    97 		{
    97 		{
    98 	default:
    98 	default:
    99 		__LEAVE(KErrNotSupported);
    99 		__LEAVE(KErrNotSupported);
   100 	case TDbFormat::ECreate:
   100 	case TDbFormat::ECreate:   
   101 		store=CPermanentFileStore::CreateL(iFs,aName,EFileRead|EFileWrite);
   101 		store=CPermanentFileStore::CreateL(iFs,aName,EFileRead|EFileWrite);
   102 		break;
   102 		break;
   103 	case TDbFormat::EReplace:
   103 	case TDbFormat::EReplace:
   104 		store=CPermanentFileStore::ReplaceL(iFs,aName,EFileRead|EFileWrite);
   104 		store=CPermanentFileStore::ReplaceL(iFs,aName,EFileRead|EFileWrite);
   105 		break;
   105 		break;
   141 EXPORT_C void CDbFileStoreDatabase::OpenL(const TDesC& aName,TDbFormat::TOpen aMode)
   141 EXPORT_C void CDbFileStoreDatabase::OpenL(const TDesC& aName,TDbFormat::TOpen aMode)
   142 	{
   142 	{
   143 	__ASSERT(!iName);	// check construction phase
   143 	__ASSERT(!iName);	// check construction phase
   144 //
   144 //
   145 	iName=aName.AllocL();
   145 	iName=aName.AllocL();
   146 	const TUint mode=aMode==TDbFormat::EReadOnly ? EFileShareReadersOnly : EFileWrite;
   146 	TUint mode=aMode==TDbFormat::EReadOnly ? EFileShareReadersOnly : EFileWrite;
   147 	CFileStore* store=CPermanentFileStore::OpenL(iFs,*iName,mode);
   147 	CFileStore* store=CPermanentFileStore::OpenL(iFs,*iName,mode);
   148 	iStore=store;
   148 	iStore=store;
   149 	CDbStoreDatabase::RestoreL(DatabaseIdL(store->Root()));
   149 	CDbStoreDatabase::RestoreL(DatabaseIdL(store->Root()));
   150 	}
   150 	}
   151 
   151