本文整理汇总了C++中CMsvEntry::Count方法的典型用法代码示例。如果您正苦于以下问题:C++ CMsvEntry::Count方法的具体用法?C++ CMsvEntry::Count怎么用?C++ CMsvEntry::Count使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CMsvEntry
的用法示例。
在下文中一共展示了CMsvEntry::Count方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: RestoreScheduleSettingsL
void CMsvSendExe::RestoreScheduleSettingsL(TMsvId aServiceId, const TUid& aMtm, CMsvScheduleSettings& aSettings)
{
TMsvSelectionOrdering order;
order.SetShowInvisibleEntries(ETrue);
CMsvEntry* cEntry = CMsvEntry::NewL(*iSession, KMsvRootIndexEntryId, order);
CleanupStack::PushL(cEntry);
if (aServiceId == KMsvLocalServiceIndexEntryId)
{
const TInt count = cEntry->Count();
for (TInt i = 0; i < count; i++)
{
const TMsvEntry& entry = (*cEntry)[i];
if (entry.iType == KUidMsvServiceEntry && entry.iMtm == aMtm)
{
aServiceId = entry.Id();
break;
}
}
}
if (aServiceId == KMsvLocalServiceIndexEntryId)
User::Leave(KErrNotFound);
CRepository* repository = CRepository::NewLC(aMtm);
TMsvScheduleSettingsUtils::LoadScheduleSettingsL(aSettings, *repository);
CleanupStack::PopAndDestroy(2, cEntry); // repository, cEntry
}
示例2: ShowChildrenL
void CMsvTestUtils::ShowChildrenL(const CMsvEntry& aEntry, TInt aStart, TInt& aMore, TInt aMaxCount)
{
iRTest.Printf(_L("Parent: "));
DisplayChildL(aEntry.Entry());
iRTest.Printf(KMsvTestUtilsNewLine);
iRTest.Printf(KMsvTestUtilsNewLine);
if (!aEntry.Entry().Owner())
return;
TInt count = aEntry.Count() - aStart;
if (aMaxCount > 0)
count = Min(count, aMaxCount);
for (TInt i = aStart; i < count + aStart; i++)
{
TBuf<16> prefix;
prefix.Zero();
prefix.AppendNum(i - aStart);
prefix.Append(_L(". ("));
prefix.AppendFormat(_L("%2d"), i + 1),
prefix.Append(_L("/"));
prefix.AppendFormat(_L("%2d"), aEntry.Count()),
prefix.Append(_L(")"));
iRTest.Printf(prefix);
DisplayChildL(aEntry[i]);
iRTest.Printf(KMsvTestUtilsNewLine);
}
aMore = aEntry.Count() - aStart - aMaxCount;
if (aMore > 0)
iRTest.Printf(_L("...%d more...\n"), aMore);
}
示例3: CheckInboxL
/*
-----------------------------------------------------------------------------
----------------------------------------------------------------------------
*/
void CSMSMonitor::CheckInboxL(void)
{
TInt smsCount(0),mmsCount(0);
CMsvEntry* Entrie = iSession->GetEntryL(KMsvGlobalInBoxIndexEntryId);
if(Entrie)
{
CleanupStack::PushL(Entrie);
if(Entrie->Count())
{
TMsvSelectionOrdering MySortType;
MySortType.SetSorting(EMsvSortByDate);
Entrie->SetSortTypeL(MySortType);
CMsvEntrySelection* entries = Entrie->ChildrenL();
if(entries)
{
CleanupStack::PushL(entries);
for(TInt i = (entries->Count() - 1); i >= 0; i--)
{
if(Entrie->ChildDataL(entries->At(i)).Unread())
{
if(Entrie->ChildDataL(entries->At(i)).iMtm == KUidMsgTypeSMS)
{
smsCount++;
}
else if(Entrie->ChildDataL(entries->At(i)).iMtm == KUidMsgTypeMultimedia)
{
mmsCount++;
}
}
}
CleanupStack::PopAndDestroy(entries);
}
}
CleanupStack::PopAndDestroy(1);//Entrie
}
if(iObserver){
iObserver->InboxChangedL(smsCount,mmsCount);
}
}
示例4: TraverseL
void CTestUTCParse::TraverseL(const TMsvId aTMsvId)
{
//open the entry, dont sort
TMsvSelectionOrdering ordering;
ordering.SetSorting(EMsvSortByNone);
CMsvEntry* entry = CMsvEntry::NewL(*iSession, aTMsvId,ordering);
CleanupStack::PushL(entry);
//retrieve the entries children
CMsvEntrySelection* msvEntrySelection;
msvEntrySelection=entry->ChildrenL();
CleanupStack::PushL(msvEntrySelection);
TInt count = entry->Count();
CMsvEntry* child;
TMsvEntry childDetails;
//for each child test if its a message entry
for(TInt i=0;i<count;i++)
{
child=iSession->GetEntryL((*msvEntrySelection)[i]);
childDetails=child->Entry();
if(childDetails.iType==KUidMsvMessageEntry)
{
iMessageEntryCount++;
iTimeList->AppendL(childDetails.iDate);
PrintEntryTime(&childDetails.iDate);
}
//recursive call
TraverseL(childDetails.Id());
if(child)
{
delete child;
}
}
CleanupStack::PopAndDestroy(msvEntrySelection);
CleanupStack::PopAndDestroy(entry);
}
示例5: RemoveDefaultEntryL
void CTestUTCSort::RemoveDefaultEntryL()
{
TMsvSelectionOrdering ordering;
//sort the gloabl inbox by date
CMsvEntry* inboxEntry = CMsvEntry::NewL(*iSession, KMsvDraftEntryIdValue,ordering);
CleanupStack::PushL(inboxEntry);
if(inboxEntry->Count()==1)
{
CMsvEntrySelection* mvEntrySelection;
mvEntrySelection=inboxEntry->ChildrenL();
CleanupStack::PushL(mvEntrySelection);
CMsvEntry* child;
child=iSession->GetEntryL((*mvEntrySelection)[0]);
iSession->RemoveEntry(child->EntryId());
delete child;
CleanupStack::PopAndDestroy(mvEntrySelection);
}
CleanupStack::PopAndDestroy(inboxEntry);
}
示例6: DoNavigateMessageStoreL
TInt CMsvTestUtils::DoNavigateMessageStoreL(TMsvId& aParent, TInt& aStart)
{
TMsvSelectionOrdering order;
order.SetShowInvisibleEntries(ETrue);
CMsvEntry* parent = CMsvEntry::NewL(*iMsvSession, aParent, order);
CleanupStack::PushL(parent);
iRTest.Printf(KMsvTestUtilsNewLine);
TInt more = 0;
const TInt KMax = 10;
ShowChildrenL(*parent, aStart, more, KMax);
iRTest.Printf(KMsvTestUtilsNewLine);
iRTest.Printf(_L("Select a message or '.' (for parent) or 'N'ext or 'P'revious or e'X'it\n"));
const TInt count = Min(KMax, parent->Count() - aStart);
const TChar startChar = '0';
const TChar endChar = startChar + count - 1;
const TChar key = iRTest.Getch();
TInt ret = KErrNotFound;
if (key >= '0' && key <= endChar)
{
iRTest.Printf(KMsvTestUtilsNewLine);
TMsvEntry entry((*parent)[key - startChar + aStart]);
if (entry.Owner())
{
aStart = 0;
aParent = entry.Id();
}
else
{
DisplayChildDetailsL(entry);
}
ret = KErrNone;
}
else if (key == '.')
{
aStart = 0;
if (aParent != KMsvRootIndexEntryId)
aParent = parent->Entry().Parent();
ret = KErrNone;
}
else if (key == 'n' || key == 'N')
{
if (more > 0)
{
aStart += KMax;
}
ret = KErrNone;
}
else if (key == 'p' || key == 'P')
{
if (aStart > 0)
{
aStart -= KMax;
}
ret = KErrNone;
}
else if (key == 'x' || key == 'X')
{
ret = KErrDied;
}
CleanupStack::PopAndDestroy(parent);
return ret;
}