本文整理汇总了C++中CContactDatabase::MatchPhoneNumberL方法的典型用法代码示例。如果您正苦于以下问题:C++ CContactDatabase::MatchPhoneNumberL方法的具体用法?C++ CContactDatabase::MatchPhoneNumberL怎么用?C++ CContactDatabase::MatchPhoneNumberL使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CContactDatabase
的用法示例。
在下文中一共展示了CContactDatabase::MatchPhoneNumberL方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: TestPhoneMatchingL
void TestPhoneMatchingL(CContactDatabase& aDb)
{
test.Next(_L("Test phone match"));
CContactIdArray* array = aDb.MatchPhoneNumberL(KTelephoneNum,KMaxPhoneMatchLength);
test(array->Count() == 4);
delete array;
syncChecker->SetValidateResponseL(MContactSynchroniser::ERead,KErrNone);
syncChecker->SetValidateResponseL(MContactSynchroniser::EEdit, KErrNone);
syncChecker->SetValidateWriteResponseL(KErrNone);
aDb.SetDbViewContactType(KUidContactICCEntry);
TContactItemId id = (*aDb.SortedItemsL())[0];
CContactItem* item = aDb.OpenContactLX(id);
CleanupStack::PushL(item);
CContactItemFieldSet& fieldset = item->CardFields();
const TInt pos = fieldset.Find(KUidContactFieldPhoneNumber);
CContactItemField& field = fieldset[pos];
CContactTextField* textfield = field.TextStorage();
textfield->SetTextL(KTelephoneNumModified);
aDb.CommitContactL(*item);
CleanupStack::PopAndDestroy(2); //item, lock record
CContactIdArray* array2 = aDb.MatchPhoneNumberL(KTelephoneNumModified,KMaxPhoneMatchLength);
test(array2->Count() == 1);
delete array2;
}
示例2: TestMatchPhoneNumberL
void TestMatchPhoneNumberL(CContactDatabase& aDb, TContactItemId aIccId, TContactItemId aNonIccId)
{
// The synchroniser is not called to validate the IDs at for this method because
// phone number resolution needs to be as quick as possible.
// Instead, validation is done when the client attempts to read the items.
test.Next(_L("Test MatchPhoneNumberL"));
// Successful find of icc entry phone number
syncChecker->ResetMethodCallCountsL();
CContactIdArray* array = aDb.MatchPhoneNumberL(KIccNumber,KMaxPhoneMatchLength);
test(syncChecker->ValidateMethodCallCountL() == 0);
test(array!=NULL);
test(array->Count() == 1);
test((*array)[0]==aIccId);
delete array;
array=NULL;
test.Next(_L("Test searching when ICC locked"));
// successful find when icc locked - validation done when entry read
syncChecker->SetValidateResponseL(MContactSynchroniser::ESearch,KErrLocked);
syncChecker->ResetMethodCallCountsL();
TRAPD(err,array = aDb.MatchPhoneNumberL(KIccNumber,KMaxPhoneMatchLength));
test(syncChecker->ValidateMethodCallCountL() == 0);
test(array!=NULL);
test(err==KErrNone);
test((*array)[0]==aIccId);
delete array;
array=NULL;
syncChecker->ResetMethodCallCountsL();
array = aDb.MatchPhoneNumberL(KNonIccNumber,KMaxPhoneMatchLength);
test(syncChecker->ValidateMethodCallCountL() == 0);
test(array!=NULL);
test(array->Count() == 1);
test((*array)[0]==aNonIccId);
delete array;
array=NULL;
}