void CIacSettingsParser::RestoreParsedDataL() { // We are assuming the server context is set to the Bio Msg entry iEntry.SetEntryL(iEntryId); if(iEntry.Entry().MtmData3() != KBIO_MSG_ENTRY_PARSED && iEntry.Entry().MtmData3() != KBIO_MSG_ENTRY_PROCESSED) { iSmsParsed=EFalse; //sms not parsed yet User::Leave(KIacpErrSmsDataNotRestored); } if(!iEntry.HasStoreL()) { iSmsParsed=EFalse; //sms not parsed yet User::Leave(KIacpErrSmsDataNotRestored); } CMsvStore* store=iEntry.EditStoreL(); CleanupStack::PushL(store); RestoreL(*store); CleanupStack::PopAndDestroy();//store // work out what type it is PopulateFieldCollectionsL(); }
void CHlpPicture::ConstructL(const CStreamStore& aStore, TStreamId aStreamId) { // Just restore for now __ASSERT_ALWAYS(iHlpModel, Panic(EHlpNoHelpModelPointer)); const THlpZoomState aZoomState = iHlpModel->ZoomSize(); RestoreL(aStore, aStreamId, iDatabase, aZoomState); }
void TIniData::LoadL(CDictionaryStore& aStore) { if (aStore.IsPresentL(KTestUid)) { RDictionaryReadStream stream; stream.OpenL(aStore,KTestUid); CEmbeddedStore* store=CEmbeddedStore::FromLC(stream); RestoreL(*store,store->Root()); CleanupStack::PopAndDestroy(); } }
EXPORT_C CFileStore* CEikDocument::OpenFileL(TBool aDoOpen,const TDesC& aFilename,RFs& aFs) /** Restores the document's state from the specified file, or creates a new default document. If aDoOpen is true, the function tries to open the file for exclusive writing. If that fails, it tries to open it for reading only. If that fails, it leaves. If aDoOpen is false, the function creates a new default document whose path and name are specified in aFilename. This function is called by the UI framework during application start-up. @param aDoOpen True to open an existing file, false to create a new default file. @param aFilename The path and name of the file to open or create. @param aFs File server session to use. @return The file store that stores the main document. */ { CFileStore* docStore=NULL; TUint appFileMode=EFileShareExclusive|EFileWrite; if (aDoOpen) { CStreamDictionary* streamDic=NULL; TRAPD(err, streamDic=CApaProcess::ReadRootStreamLC(aFs,docStore,aFilename,appFileMode); CleanupStack::Pop();); if (err==KErrNone) CleanupStack::PushL(streamDic); else { appFileMode=EFileRead|EFileShareReadersOnly; if (err==KErrAccessDenied || err==KErrInUse) streamDic=CApaProcess::ReadRootStreamLC(aFs,docStore,aFilename,appFileMode); else User::Leave(err); } CleanupStack::PushL(docStore); RestoreL(*docStore,*streamDic); CleanupStack::Pop();// docStore CleanupStack::PopAndDestroy(); // streamDic }
// ----------------------------------------------------------------------------- // CDRMHelperServer::ConstructL // Symbian 2nd phase constructor can leave. // ----------------------------------------------------------------------------- // void CDRMHelperServer::ConstructL() { TInt err = 0; #ifdef _DRM_TESTING TRAPD( r , WriteL(_L8("ConstructL")) ); #endif TUint8 waitCount = 0; User::LeaveIfError(iFs.Connect()); User::LeaveIfError(iDrm.StartServer()); User::LeaveIfError(iDrm.Connect()); StartL(KDRMHelperServerName); //ignore errors err = User::RenameProcess( KDRMHSServerFileName ); err = User::RenameThread(KDRMHSServerFileName); CreatePrivatePathL(iFs); // create path for internal data file iEndTimeFactory = CEndTimeFactory::NewL( *this ); err = KErrNotFound; while( err!=0 && waitCount < 30 ) // wait maximum of 6s { TRAP( err , iNotifier = CDRMNotifier::NewL() ); if ( err ) // wait only if the server isn't running { User::After(200000); // 0.2s waitCount++; } if (iNotifier) { iNotifier->RegisterEventObserverL( *this , KEventTimeChange ); } } #ifdef _DRM_TESTING TRAP( r , WriteL(_L8("ConstructL->Notifier")) ); #endif User::LeaveIfError( err ); // None can do, throw an exception. iUiTimeNotifier = CEnvironmentChangeNotifier::NewL( EPriorityHigh, TCallBack(UiTimeChanged,this) ); iUiTimeNotifier->Start(); iIdleObserver = CIdleObserver::NewL( *this ); iIdleObserver->StartL(); #ifdef _DRM_TESTING TRAP( r , WriteL(_L8("ConstructL->IdleObserver")) ); #endif CreateCRKeyL(); RestoreL(); iEndTimeFactory->HandleExpiredL(); #ifdef _DRM_TESTING TRAP( r , WriteL(_L8("ConstructL->End")) ); #endif }
// Complete the construction of the // CCompound object void CCompound::ConstructL(CStreamStore& aStore,TStreamId anId) { iCa = new (ELeave) CClassA; iCb = new (ELeave) CClassB; RestoreL(aStore,anId); }