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


C++ CMsvEntrySelection::Back方法代码示例

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


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

示例1: DoDeleteEntriesL

void CMsvServerEntry::DoDeleteEntriesL(CMsvEntrySelection& aSelection, CMsvEntrySelection*& aDeleted, CMsvEntrySelection*& aMoved)
//
//
//
	{
	__ASSERT_DEBUG(!aDeleted && !aMoved, PanicServer(EMsvDeleteAndMoveSelectionsNotNull));
	__ASSERT_DEBUG(aSelection.Count() > 0, PanicServer(EMsvDeletingEmptySelection));

	// Total entries deleted and moved
	aDeleted = new(ELeave)CMsvEntrySelection;
	aMoved = new(ELeave)CMsvEntrySelection;

	// Entries deleted when a single item is deleted
	CMsvEntrySelection* deleted = new(ELeave)CMsvEntrySelection;
	CleanupStack::PushL(deleted);

	// Entries moved when a single item is deleted
	CMsvEntrySelection* moved = new(ELeave)CMsvEntrySelection;
	CleanupStack::PushL(moved);

	CMsvEntrySelection* selection = new(ELeave)CMsvEntrySelection;
	CleanupStack::PushL(selection);

	CMsvDelete* del = CMsvDelete::NewL(iServer);
	CleanupStack::PushL(del);

	TInt firstError = KErrNone;

	TInt count = aSelection.Count();
	while(count--)
		{
		TMsvId id = aSelection.At(count);
		TInt error = KErrNone;

		// Only delete children
		if (!IsAChild(id))
			error = KErrNotFound;
		else
			{
			// Need to know maximum number of entries that might be deleted
			selection->AppendL(id);
			error = iServer.IndexAdapter().ExpandSelectionRecursively(*selection);
			if (error == KErrNone)
				{
				// Reserve space in lists
				aDeleted->SetReserveL(aDeleted->Count() + selection->Count());
				aMoved->SetReserveL(aMoved->Count() + selection->Count());
				del->StartL(id, *deleted, *moved);
				aSelection.Delete(count);

				if (deleted->Count() > 0)
					aDeleted->AppendL(deleted->Back(0), deleted->Count());

				if (moved->Count() > 0)
					aMoved->AppendL(moved->Back(0), moved->Count());
				}

			deleted->Reset();
			moved->Reset();
			selection->Reset();
			}

		// Remember error
		if (error != KErrNone && firstError == KErrNone)
			firstError = error;
		}

	User::LeaveIfError(firstError);
	CleanupStack::PopAndDestroy(4); // del, selection, moved, deleted
	}
开发者ID:cdaffara,项目名称:symbiandump-mw2,代码行数:70,代码来源:MSVENTRY.CPP


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