当前位置: 首页>>代码示例>>C++>>正文


C++ CMsvSession::GetEntryL方法代码示例

本文整理汇总了C++中CMsvSession::GetEntryL方法的典型用法代码示例。如果您正苦于以下问题:C++ CMsvSession::GetEntryL方法的具体用法?C++ CMsvSession::GetEntryL怎么用?C++ CMsvSession::GetEntryL使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CMsvSession的用法示例。


在下文中一共展示了CMsvSession::GetEntryL方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: ExecuteActionL

void CMtfTestActionCompareAttachment::ExecuteActionL()
	{
	TestCase().INFO_PRINTF2(_L("Test Action %S start..."), &KTestActionCompareAttachment);
	CMsvSession* paramSession = ObtainParameterReferenceL<CMsvSession>(TestCase(),ActionParameters().Parameter(0));
	TMsvId messageEntry = ObtainValueParameterL<TMsvId>(TestCase(),ActionParameters().Parameter(1));
	TMsvAttachmentId attachId = ObtainValueParameterL<TMsvAttachmentId>(TestCase(),ActionParameters().Parameter(2));
	HBufC* dataFilePath   = ObtainParameterReferenceL<HBufC>(TestCase(),ActionParameters().Parameter(3));

	CMsvEntry* entry = paramSession->GetEntryL(messageEntry);
	CleanupStack::PushL(entry);
	
	CMsvStore* store = entry->ReadStoreL();
	CleanupStack::PushL(store);
	
	MMsvAttachmentManager& manager = store->AttachmentManagerL();
	
	RFile fileAttachment = manager.GetAttachmentFileL(attachId);
	CleanupClosePushL(fileAttachment);
	
	CompareFileL(fileAttachment, *dataFilePath);
	
	CleanupStack::PopAndDestroy(&fileAttachment);
	
	CleanupStack::PopAndDestroy(2, entry); // store, entry
	TestCase().INFO_PRINTF2(_L("Test Action %S completed."), &KTestActionCompareAttachment);
	TestCase().ActionCompletedL(*this);
	}
开发者ID:cdaffara,项目名称:symbiandump-mw2,代码行数:27,代码来源:CMtfTestActionCompareAttachment.cpp

示例2: RunTestActionL

void CMtfTestActionSmtpGetAttachmentFileFromId::RunTestActionL()
	{
	CMsvSession* paramSession = ObtainParameterReferenceL<CMsvSession>(TestCase(),ActionParameters().Parameter(0));
	TMsvId messageEntry = ObtainValueParameterL<TMsvId>(TestCase(),ActionParameters().Parameter(1));
	TMsvAttachmentId attachId = ObtainValueParameterL<TMsvAttachmentId>(TestCase(),ActionParameters().Parameter(2));
	HBufC* dataFilePath   = ObtainParameterReferenceL<HBufC>(TestCase(),ActionParameters().Parameter(3), NULL);

	CMsvEntry* entry = paramSession->GetEntryL(messageEntry);
	CleanupStack::PushL(entry);
	
	CImEmailMessage* emailMsg = CImEmailMessage::NewL(*entry);
	CleanupStack::PushL(emailMsg);
	
	MMsvAttachmentManager& manager = emailMsg->AttachmentManager();
	
	RFile fileAttachment = manager.GetAttachmentFileL(attachId);
	CleanupClosePushL(fileAttachment);
	
	if( dataFilePath != NULL )
		{
		// check of contents of attachment file is requested
		CompareFileL(fileAttachment, *dataFilePath);
		}
	
	CleanupStack::PopAndDestroy(3, entry); // fileAttachment, emailMsg, entry
	}
开发者ID:cdaffara,项目名称:symbiandump-mw2,代码行数:26,代码来源:CMtfTestActionSmtpGetAttachmentFileFromId.cpp

示例3: RunTestL

void CMtfTestActionAddFileAttachmentByHandle::RunTestL()
	{
	CMsvSession* paramSession = ObtainParameterReferenceL<CMsvSession>(TestCase(),ActionParameters().Parameter(0));
	TMsvId messageEntry = ObtainValueParameterL<TMsvId>(TestCase(),ActionParameters().Parameter(1));
	HBufC* paramFilePath   = ObtainParameterReferenceL<HBufC>(TestCase(),ActionParameters().Parameter(2));
	HBufC8* paramMimeType = ObtainParameterReferenceL<HBufC8>(TestCase(),ActionParameters().Parameter(3));

	iEntry = paramSession->GetEntryL(messageEntry);
	iStore = iEntry->EditStoreL();
	iAttachment = CMsvAttachment::NewL(CMsvAttachment::EMsvFile);
	iAttachment->SetMimeTypeL(*paramMimeType);
	
	RFile fileHandle = OpenFileL(paramSession->FileSession(), *paramFilePath);
	CleanupClosePushL(fileHandle);
	TFileName fileName;
	User::LeaveIfError(fileHandle.Name(fileName));
	iAttachment->SetAttachmentNameL(fileName);
	TInt fileSize = 0;
	User::LeaveIfError(fileHandle.Size(fileSize));
	iAttachment->SetSize(fileSize);
	
	MMsvAttachmentManager& manager = iStore->AttachmentManagerL();
	CActiveScheduler::Add(this);
	SetActive();
	manager.AddAttachmentL(fileHandle, iAttachment, iStatus);
	iAttachmentId = iAttachment->Id();
	iAttachment = NULL; // ownership passed to manager
	
	CleanupStack::Pop(&fileHandle);
	}
开发者ID:cdaffara,项目名称:symbiandump-mw2,代码行数:30,代码来源:CMtfTestActionAddFileAttachmentByHandle.cpp

示例4: RunTestActionL

void CMtfTestActionGetAttachmentFileFromIndex::RunTestActionL()
	{
	CMsvSession* paramSession = ObtainParameterReferenceL<CMsvSession>(TestCase(),ActionParameters().Parameter(0));
	TMsvId messageEntry = ObtainValueParameterL<TMsvId>(TestCase(),ActionParameters().Parameter(1));
	TInt attachIndex = ObtainValueParameterL<TInt>(TestCase(),ActionParameters().Parameter(2));
	HBufC* dataFilePath   = ObtainParameterReferenceL<HBufC>(TestCase(),ActionParameters().Parameter(3), NULL);

	CMsvEntry* entry = paramSession->GetEntryL(messageEntry);
	CleanupStack::PushL(entry);
	
	CMsvStore* store = entry->ReadStoreL();
	CleanupStack::PushL(store);
	
	MMsvAttachmentManager& manager = store->AttachmentManagerL();
	
	RFile fileAttachment = manager.GetAttachmentFileL(attachIndex);
	CleanupClosePushL(fileAttachment);
	
	if( dataFilePath != NULL )
		{
		// check of contents of attachment file is requested
		CompareFileL(fileAttachment, *dataFilePath);
		}
	
	CleanupStack::PopAndDestroy(3, entry); // fileAttachment, store, entry
	}
开发者ID:cdaffara,项目名称:symbiandump-mw2,代码行数:26,代码来源:CMtfTestActionGetAttachmentFileFromIndex.cpp

示例5: LaunchEditorL

// methods from CSendAsEditUtils
void CSendAsTestEditUtils::LaunchEditorL(TMsvId /*aId*/, TRequestStatus& aStatus)
	{

	CDummyObserver* ob1 = new(ELeave) CDummyObserver;
	CleanupStack::PushL(ob1);

	CMsvSession* session = CMsvSession::OpenSyncL(*ob1);
	CleanupStack::PushL(session);

	CMsvEntry* cEntry = CMsvEntry::NewL(*session, KMsvDraftEntryId, 
		TMsvSelectionOrdering(KMsvNoGrouping,EMsvSortByNone,ETrue));
	CleanupStack::PushL(cEntry);

	CMsvEntrySelection* selection = cEntry->ChildrenL();
	CleanupStack::PushL(selection);

	CMsvEntry* cEntry2 = session->GetEntryL(selection->At(0));
	CleanupStack::PushL(cEntry2);

	TMsvEntry entry = cEntry2->Entry();
	entry.SetMtmData3(234567890); // Show we've been called by touching the TMsvEntry.
	cEntry2->ChangeL(entry);
	
	CleanupStack::PopAndDestroy(5, ob1); // cEntry2, selection, cEntry, session, ob1

	iUserStatus = &aStatus;
	aStatus = KRequestPending;
	// wait a few seconds before completing
	iEditTimer->After(KSendAsTestEditWaitTime);
	}
开发者ID:cdaffara,项目名称:symbiandump-mw2,代码行数:31,代码来源:csendastesteditutils.cpp

示例6: RunTestL

void CMtfTestActionSmtpRemoveEntryAttachmentById::RunTestL()
	{
	CMsvSession* paramSession = ObtainParameterReferenceL<CMsvSession>(TestCase(),ActionParameters().Parameter(0));
	TMsvId messageEntry = ObtainValueParameterL<TMsvId>(TestCase(),ActionParameters().Parameter(1));
	TMsvAttachmentId attachId = ObtainValueParameterL<TMsvAttachmentId>(TestCase(),ActionParameters().Parameter(2));

	CMsvEntry* entry = paramSession->GetEntryL(messageEntry);
	CleanupStack::PushL(entry);
	
	CImEmailMessage* emailMsg = CImEmailMessage::NewL(*entry);
	CleanupStack::PushL(emailMsg);
	
	MMsvAttachmentManager& manager = emailMsg->AttachmentManager();
	
	CMsvAttachment* attachInfo = manager.GetAttachmentInfoL(attachId);
	CleanupStack::PushL(attachInfo);
	
	// First ensure that the attachment is a file attachment
	if( attachInfo->Type() != CMsvAttachment::EMsvMessageEntry )
		{
		User::Leave(KErrGeneral);
		}
		
	// Get the linked file
	TMsvId msgId = attachInfo->EntryAttachmentId();
	CleanupStack::PopAndDestroy(attachInfo);
		
	// Remove the attachment
	CMtfAsyncWaiter* waiter = CMtfAsyncWaiter::NewL();
	CleanupStack::PushL(waiter);
	manager.RemoveAttachmentL(attachId, waiter->iStatus);
	waiter->StartAndWait();
	User::LeaveIfError(waiter->Result());
	CleanupStack::PopAndDestroy(waiter);	
	
	CleanupStack::PopAndDestroy(2, entry); // email msg, entry

	// Ensure that the message entry still exists
	CMsvEntry* checkEntry = paramSession->GetEntryL(msgId);
	delete checkEntry;
	checkEntry = NULL;
	}
开发者ID:cdaffara,项目名称:symbiandump-mw2,代码行数:42,代码来源:CMtfTestActionSmtpRemoveEntryAttachmentById.cpp

示例7: ExecuteActionL

void CMtfTestActionSmtpModifyAttachmentInfo::ExecuteActionL()
	{
	TestCase().INFO_PRINTF2(_L("Test Action %S start..."), &KTestActionSmtpModifyAttachmentInfo);
	CMsvSession* paramSession = ObtainParameterReferenceL<CMsvSession>(TestCase(),ActionParameters().Parameter(0));
	TMsvId messageEntry = ObtainValueParameterL<TMsvId>(TestCase(),ActionParameters().Parameter(1));
	TMsvAttachmentId attachmentId = ObtainValueParameterL<TMsvAttachmentId>(TestCase(),ActionParameters().Parameter(2));

	CMsvEntry* entry = paramSession->GetEntryL(messageEntry);
	CleanupStack::PushL(entry);
	
	CImEmailMessage* emailMsg = CImEmailMessage::NewL(*entry);
	CleanupStack::PushL(emailMsg);

	MMsvAttachmentManager& manager = emailMsg->AttachmentManager();
	
	CMsvMimeHeaders* mimeHeaders = CMsvMimeHeaders::NewL();
	CleanupStack::PushL(mimeHeaders);

	mimeHeaders->SetContentDescriptionL(KTxtContentDescription());
	mimeHeaders->SetContentBaseL(KTxtContentBase());
	mimeHeaders->SetContentLocationL(KTxtContentLocation());
	mimeHeaders->SetContentIdL(KTxtContentId());
	mimeHeaders->SetContentTypeL(KTxtContentType());
	mimeHeaders->SetContentSubTypeL(KTxtContentSubType());
	mimeHeaders->SetContentDispositionL(KTxtContentDisposition());
	mimeHeaders->ContentTypeParams().AppendL(KTxtParam1());
	mimeHeaders->ContentTypeParams().AppendL(KTxtParam2());
	mimeHeaders->ContentTypeParams().AppendL(KTxtParam3());
	mimeHeaders->ContentDispositionParams().AppendL(KTxtParam4());
	mimeHeaders->ContentDispositionParams().AppendL(KTxtParam5());
	mimeHeaders->ContentDispositionParams().AppendL(KTxtParam6());
	mimeHeaders->XTypeParams().AppendL(KTxtParam7());
	mimeHeaders->XTypeParams().AppendL(KTxtParam8());
	mimeHeaders->XTypeParams().AppendL(KTxtParam9());

	CMtfAsyncWaiter* waiter = CMtfAsyncWaiter::NewL();
	CleanupStack::PushL(waiter);
	CMsvAttachment* attachment = manager.GetAttachmentInfoL(attachmentId);
	CleanupStack::PushL(attachment);
	mimeHeaders->StoreL(*attachment);
	manager.ModifyAttachmentInfoL(attachment, waiter->iStatus);
	CleanupStack::Pop(attachment);
	waiter->StartAndWait();
	User::LeaveIfError(waiter->Result());

	CleanupStack::PopAndDestroy(2, mimeHeaders); // waiter, mimeHeaders
	
	CompareMimeHeadersL(*emailMsg, attachmentId);
	
	CleanupStack::PopAndDestroy(2, entry);//emailMsg, entry

	TestCase().INFO_PRINTF2(_L("Test Action %S completed."), &KTestActionSmtpModifyAttachmentInfo);
	TestCase().ActionCompletedL(*this);
	}
开发者ID:cdaffara,项目名称:symbiandump-mw2,代码行数:54,代码来源:CMtfTestActionSmtpModifyAttachmentInfo.cpp

示例8: RunTestL

void CMtfTestActionSmtpAddLinkedAttachment::RunTestL()
	{
	CMsvSession* paramSession = ObtainParameterReferenceL<CMsvSession>(TestCase(),ActionParameters().Parameter(0));
	TMsvId messageEntry = ObtainValueParameterL<TMsvId>(TestCase(),ActionParameters().Parameter(1));
	HBufC* paramFilePath   = ObtainParameterReferenceL<HBufC>(TestCase(),ActionParameters().Parameter(2));
	HBufC8* paramMimeType = ObtainParameterReferenceL<HBufC8>(TestCase(),ActionParameters().Parameter(3));

	CMsvEntry* entry = paramSession->GetEntryL(messageEntry);
	CleanupStack::PushL(entry);
	
	CImEmailMessage* emailMsg = CImEmailMessage::NewL(*entry);
	CleanupStack::PushL(emailMsg);
	
	CMtfAsyncWaiter* waiter = CMtfAsyncWaiter::NewL();
	CleanupStack::PushL(waiter);
	
	CMsvAttachment* attachment = CMsvAttachment::NewL(CMsvAttachment::EMsvLinkedFile);
	CleanupStack::PushL(attachment);
	
	attachment->SetMimeTypeL(*paramMimeType);
	
	TParse fileNameParser;
	User::LeaveIfError(fileNameParser.Set(*paramFilePath, NULL, NULL));
	attachment->SetAttachmentNameL(fileNameParser.NameAndExt());
	
	TEntry fileEntry;
	User::LeaveIfError(paramSession->FileSession().Entry( fileNameParser.FullName(), fileEntry));
	attachment->SetSize(fileEntry.iSize);

	MMsvAttachmentManager& manager = emailMsg->AttachmentManager();
	
	manager.AddLinkedAttachmentL(*paramFilePath, attachment, waiter->iStatus);
	CleanupStack::Pop(attachment); // ownership passed to manager
	waiter->StartAndWait();
	User::LeaveIfError(waiter->Result());
	CleanupStack::PopAndDestroy(waiter);
	
	attachment = NULL;
	
	TInt attachmentCount = manager.AttachmentCount();
	attachment = manager.GetAttachmentInfoL(attachmentCount - 1);
	CleanupStack::PushL(attachment);
	
	TMsvAttachmentId attachmentId = attachment->Id();
	
	CleanupStack::PopAndDestroy(attachment);
	
	CleanupStack::PopAndDestroy(2, entry); // emailMsg, entry
	
	StoreParameterL<TMsvAttachmentId>(TestCase(),attachmentId,ActionParameters().Parameter(4));
	}
开发者ID:cdaffara,项目名称:symbiandump-mw2,代码行数:51,代码来源:CMtfTestActionSmtpAddLinkedAttachment.cpp

示例9: ConstructL

/**
ConstructL()
Used to ensure that MMsvAttachmentManager is not destroyed until we want it to be.
To do this we need to preserve certain objects of CImEmailMessage, which if disappeared
would invalidate MMsvAttachmentManager. But this should be deleted in a controlled manner.

@param aSession
An object of type CMsvSession object.

@param aEntry
An object of type TMsvEntry used to get the entry ID. 
*/
void CAttachmentItem::ConstructL(CMsvSession& aSession, TMsvEntry aEntry)
	{
	iMsvEntry = aSession.GetEntryL(aEntry.Id());

	iMsvEntry->SetEntryL(aEntry.Id());
	iEmailMsg = CImEmailMessage::NewL(*iMsvEntry);
		
	CMsvOperationActiveSchedulerWait* waiter = CMsvOperationActiveSchedulerWait::NewLC();
 	iEmailMsg->GetAttachmentsListL(waiter->iStatus, aEntry.Id(),
								   CImEmailMessage::EAllAttachments, 
								   CImEmailMessage::EThisMessageOnly);
	waiter->Start();

	CleanupStack::PopAndDestroy(1, waiter); //waiter		
	}
开发者ID:cdaffara,项目名称:symbiandump-mw2,代码行数:27,代码来源:T_ComparePopEmailMsgs.cpp

示例10: ConstructL

// ---------------------------------------------------------------------------
// Second level constructor. Creates the data members to the heap.
// Creates also the folder CMsvEntry.
// ---------------------------------------------------------------------------
//
void CIpsPlgMsgIterator::ConstructL(        
    CMsvSession& aMsvSession,
    const TFSMailMsgId aFolderId,
    const RArray<TFSMailSortCriteria>& aSorting )
    {
    FUNC_LOG;
    iFolderEntry  = aMsvSession.GetEntryL( aFolderId.Id() );
    
    StoreSortCriteriaL(aSorting);
    iMsgSortKey   = new (ELeave) TIpsPlgMsgKey( *iFolderEntry, iSortingCriteria );
    iMsgSwapper   = new (ELeave) TIpsPlgMsgSwap( *iFolderEntry );
    iSortingOn    = 
        ( aSorting.Count() > 0 ) && ( aSorting[0].iField != EFSMailDontCare);
    iMsgMapper    = CIpsPlgMsgMapper::NewL( aMsvSession, iPlugin );
    iMsvSession   = &aMsvSession;
    }
开发者ID:cdaffara,项目名称:symbiandump-ossapps,代码行数:21,代码来源:ipsplgmsgiterator.cpp

示例11: ExecuteActionL

void CMtfTestActionRemoveAllAttachments::ExecuteActionL()
	{
	TestCase().INFO_PRINTF2(_L("Test Action %S start..."), &KTestActionRemoveAllAttachments);
	CMsvSession* paramSession = ObtainParameterReferenceL<CMsvSession>(TestCase(),ActionParameters().Parameter(0));
	TMsvId messageEntry = ObtainValueParameterL<TMsvId>(TestCase(),ActionParameters().Parameter(1));
	TInt attachIdFlag = ObtainValueParameterL<TInt>(TestCase(),ActionParameters().Parameter(2), 0);

	CMsvEntry* entry = paramSession->GetEntryL(messageEntry);
	CleanupStack::PushL(entry);
	
	CMsvStore* store = entry->EditStoreL();
	CleanupStack::PushL(store);
	
	MMsvAttachmentManager& manager = store->AttachmentManagerL();
	
	TInt attachmentCount = manager.AttachmentCount();
		
	for ( ; attachmentCount > 0 ; attachmentCount-- )
	{
	CMtfAsyncWaiter* waiter = CMtfAsyncWaiter::NewL();
	CleanupStack::PushL(waiter);
		
	if( attachIdFlag == 1 )
		{
		CMsvAttachment* attachInfo = manager.GetAttachmentInfoL(0);
		CleanupStack::PushL(attachInfo);
				
		manager.RemoveAttachmentL(attachInfo->Id(), waiter->iStatus);
		CleanupStack::PopAndDestroy(attachInfo);
		}
	else
		{
		manager.RemoveAttachmentL(0, waiter->iStatus);
		}
	waiter->StartAndWait();
	User::LeaveIfError(waiter->Result());
	CleanupStack::PopAndDestroy(waiter);
	}
	
	store->CommitL();
	
	CleanupStack::PopAndDestroy(2, entry); // store, entry

	TestCase().INFO_PRINTF2(_L("Test Action %S completed."), &KTestActionRemoveAllAttachments);
	TestCase().ActionCompletedL(*this);
	}
开发者ID:cdaffara,项目名称:symbiandump-mw2,代码行数:46,代码来源:CMtfTestActionRemoveAllAttachments.cpp

示例12: GetTMsvEntryL

// Get the TMsvEntry of the message whose TMsvId is passed from the client..
void CDummyServerSession::GetTMsvEntryL(const RMessage2& aMessage)
	{
	CDummyObserver* ob = new(ELeave) CDummyObserver;
	CleanupStack::PushL(ob);
	
	TPckgBuf<TMsvId> idBuf;
	idBuf = aMessage.Int0();
	
	CMsvSession* session = CMsvSession::OpenSyncL(*ob);
	CleanupStack::PushL(session);
	
	TMsvId entryId = idBuf();
    CMsvEntry* cEntry = session->GetEntryL(entryId);
	CleanupStack::PushL(cEntry); 
	
	TPckgBuf<TMsvEntry> pckg = cEntry->Entry();
	aMessage.WriteL(1,pckg);
	
	CleanupStack::PopAndDestroy(3,ob);//cEntry,session,ob
	}
开发者ID:cdaffara,项目名称:symbiandump-mw2,代码行数:21,代码来源:DummyServer.cpp

示例13: SaveL

/**
Stores the Unknown Push message in the message store.

Saves the message data in a new attachment file. This makes it more efficient for the UI
to read the data.

@param	aSession		
Message server session

@param	aParent	
ID of the parent for the new entry. It is the caller's responsibility to ensure 
that the parent ID is correct.

@return	
ID of the new message server entry.

@see	CPushMsgEntryBase::SaveL()
*/
EXPORT_C TMsvId CUnknownPushMsgEntry::SaveL(CMsvSession& aSession, TMsvId aParent)

	{
	CMsvEntry* entryPtr = aSession.GetEntryL(KMsvRootIndexEntryId);
	CleanupStack::PushL(entryPtr);

	// This tidies itself up
	TMsvId newEntry = CPushMsgEntryBase::SaveL(aSession, aParent);
	
#ifdef __MESSAGING_API_V2__
	TRAPD(
		saveError,
		TFileName fileName = ContentFileNameL();
		entryPtr->SetEntryL(newEntry);
		CMsvStore* store = entryPtr->EditStoreL();
		CleanupStack::PushL(store);
		SaveMessageBodyL(store->AttachmentManagerL(), fileName);
		store->CommitL();
		CleanupStack::PopAndDestroy(store);
		)
开发者ID:cdaffara,项目名称:symbiandump-mw2,代码行数:38,代码来源:Cunknownpushmsgentry.cpp

示例14: ExecuteActionL

void CMtfTestActionGetEntry::ExecuteActionL()
{
    TestCase().INFO_PRINTF2(_L("Test Action %S start..."), &KTestActionAddGetEntry);
    if(TestCase().TestStepResult() == EPass)
    {
        CMsvSession* paramSession = ObtainParameterReferenceL<CMsvSession>(TestCase(),ActionParameters().Parameter(0));
        TMsvId messageEntry = ObtainValueParameterL<TMsvId>(TestCase(),ActionParameters().Parameter(1));

        CMsvEntry* entry = paramSession->GetEntryL(messageEntry);
        CleanupStack::PushL(entry);

        entry->SetEntryL(messageEntry);

        StoreParameterL<CMsvEntry>(TestCase(),*entry,ActionParameters().Parameter(2));
        CleanupStack::Pop(entry);

        TestCase().INFO_PRINTF2(_L("Test Action %S completed."), &KTestActionAddGetEntry);
    }
    TestCase().ActionCompletedL(*this);
}
开发者ID:kuailexs,项目名称:symbiandump-mw2,代码行数:20,代码来源:CMtfTestActionGetEntry.cpp

示例15: ExecuteActionL

void CMtfTestActionRemoveFileAttachmentWithDestroy::ExecuteActionL()
	{
	TestCase().INFO_PRINTF2(_L("Test Action %S start..."), &KTestActionRemoveFileAttachmentWithDestroy);
	CMsvSession* paramSession = ObtainParameterReferenceL<CMsvSession>(TestCase(),ActionParameters().Parameter(0));
	TMsvId messageEntry = ObtainValueParameterL<TMsvId>(TestCase(),ActionParameters().Parameter(1));
	TMsvAttachmentId attachId = ObtainValueParameterL<TMsvAttachmentId>(TestCase(),ActionParameters().Parameter(2));

	CMsvEntry* entry = paramSession->GetEntryL(messageEntry);
	CleanupStack::PushL(entry);
	
	CMsvStore* store = entry->EditStoreL();
	CleanupStack::PushL(store);
	
	MMsvAttachmentManager& manager = store->AttachmentManagerL();
	
	CMsvAttachment* attachInfo = manager.GetAttachmentInfoL(attachId);
	CleanupStack::PushL(attachInfo);
	
	// First ensure that the attachment is a file attachment
	if( attachInfo->Type() != CMsvAttachment::EMsvFile )
		{
		User::Leave(KErrGeneral);
		}
	
	CleanupStack::PopAndDestroy(attachInfo);
	
	CMtfAsyncWaiter* waiter = CMtfAsyncWaiter::NewL();
	CleanupStack::PushL(waiter);
	manager.RemoveAttachmentL(attachId, waiter->iStatus);
	waiter->StartAndWait();
	User::LeaveIfError(waiter->Result());
	CleanupStack::PopAndDestroy(waiter);	
	
	// destroy the store without commit
	CleanupStack::PopAndDestroy(2, entry); // store, entry
	
	TestCase().INFO_PRINTF2(_L("Test Action %S completed."), &KTestActionRemoveFileAttachmentWithDestroy);
	TestCase().ActionCompletedL(*this); 
	}
开发者ID:cdaffara,项目名称:symbiandump-mw2,代码行数:39,代码来源:CMtfTestActionRemoveFileAttachmentWithDestroy.cpp


注:本文中的CMsvSession::GetEntryL方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。