本文整理汇总了C++中CContactDatabase::FindLC方法的典型用法代码示例。如果您正苦于以下问题:C++ CContactDatabase::FindLC方法的具体用法?C++ CContactDatabase::FindLC怎么用?C++ CContactDatabase::FindLC使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CContactDatabase
的用法示例。
在下文中一共展示了CContactDatabase::FindLC方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: TestFindLC
//===============================================================================================
// SEARCHING entries
//===============================================================================================
void TestFindLC(CContactDatabase& aDb, TContactItemId aIccId, TContactItemId aNonIccId)
{
test.Next(_L("Test FindLC"));
// Successful find of icc entry
CContactItemFieldDef* fieldDef=new(ELeave) CContactItemFieldDef;
CleanupStack::PushL(fieldDef);
fieldDef->AppendL(KUidContactFieldFamilyName);
syncChecker->ResetMethodCallCountsL();
CContactIdArray* array = aDb.FindLC(KIccName,fieldDef);
test(syncChecker->ValidateMethodCallCountL() == 1);
test(array!=NULL);
test(array->Count() == 1);
test((*array)[0]==aIccId);
CleanupStack::PopAndDestroy(array);
array=NULL;
test.Next(_L("Test searching when ICC locked"));
// Unsuccessful find of icc entry because icc locked
syncChecker->SetValidateResponseL(MContactSynchroniser::ESearch,KErrLocked);
syncChecker->ResetMethodCallCountsL();
TRAPD(err,array = aDb.FindLC(KIccName,fieldDef));
test(syncChecker->ValidateMethodCallCountL() == 1);
test(err==KErrLocked);
test(array==NULL);
// successful find of non-icc entry, even though icc locked
syncChecker->ResetMethodCallCountsL();
array = aDb.FindLC(KNonIccName,fieldDef);
test(syncChecker->ValidateMethodCallCountL() == 0);
test(array!=NULL);
test(array->Count() == 1);
test((*array)[0]==aNonIccId);
CleanupStack::PopAndDestroy(2,fieldDef); // array, fieldDef
}
示例2: CheckFoundL
void CTestResources::CheckFoundL(TInt i)
{
if(i<0 || i>GNumberOfFieldNames)
{
User::Leave(KErrNotSupported);
}
iFindFields->Reset();
if(i==GNumberOfFieldNames)
{
for(TInt k =0; k<i; k++)
{
iFindFields->AppendL(TUid::Uid(GFieldNames[k]));
}
}
else
{
iFindFields->AppendL(TUid::Uid(GFieldNames[i]));
}
CContactIdArray* ids = iDb->FindLC(KStringToFind, iFindFields);
TInt count = ids->Count();
test(count == GNumberOfFinds[i]);
CleanupStack::PopAndDestroy(ids);
}