本文整理汇总了C++中CContactItem::LastModified方法的典型用法代码示例。如果您正苦于以下问题:C++ CContactItem::LastModified方法的具体用法?C++ CContactItem::LastModified怎么用?C++ CContactItem::LastModified使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CContactItem
的用法示例。
在下文中一共展示了CContactItem::LastModified方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AddUidRevPropertyL
/** Add UID and REV properties to the input vCard files
* This helps in importing the vCards in Merge Mode
* @param aContactItem - existing contact item
* @param fsSession - File Session
* @param aSource - new file
* @param aDestination - File contains Uid of existing Contact item and field value from new file
* @return - void
*/
void CTestImportContactMergeModeStep::AddUidRevPropertyL(const CContactItem& aContactItem, RFs& fsSession, const TDesC& aSource, const TDesC& aDestination)
{
CParserVCard* vCardParser=CParserVCard::NewL();
CleanupStack::PushL(vCardParser);
InternalizeFileL(*vCardParser,aSource,fsSession);
CParserPropertyValueDateTime* valueDateTime = CreateDateTimePropertyL(aContactItem.LastModified(),TVersitDateTime::EIsMachineLocal);
CleanupStack::PushL(valueDateTime);
CParserProperty* property=CParserGroupedProperty::NewL(*valueDateTime,KVersitTokenREV,NULL,NULL);
CleanupStack::Pop(valueDateTime);
CleanupStack::PushL(property);
vCardParser->AddPropertyL(property); //takes ownership
CleanupStack::Pop(property);
TInt64 machineUniqueId = dBase->MachineId();
TPtrC guid=aContactItem.UidStringL(machineUniqueId);
CParserPropertyValueHBufC* uidValue=CParserPropertyValueHBufC::NewL(guid);
CleanupStack::PushL(uidValue);
CParserProperty* uidproperty=CParserGroupedProperty::NewL(*uidValue,KVersitTokenUID,NULL,NULL);
CleanupStack::Pop(uidValue);
CleanupStack::PushL(uidproperty);
vCardParser->AddPropertyL(uidproperty); //takes ownership
CleanupStack::Pop(uidproperty);
ExternaliseFileL(*vCardParser,aDestination, fsSession);
CleanupStack::PopAndDestroy(vCardParser);
}
示例2: Compare
TBool CPackagerCntComparator::Compare(const CContactItem& anItem1, const CContactItem& anItem2) const
/** Compares two CContactItem items.
@param anItem1 The first CContactItem to be compared.
@param anItem2 The second CContactItem to be compared.
@return ETrue if the two items are equal, EFalse otherwise. */
{
return (DoCompareCContactItemType(anItem1, anItem2) &
DoCompareCContactItemFieldSet(anItem1.CardFields(), anItem2.CardFields()) &
DoCompareCContactItemAttribute(anItem1, anItem2) &
DoCompareTContactItemId(anItem1.Id(), anItem2.Id()) &
DoCompareTContactItemId(anItem1.TemplateRefId(), anItem2.TemplateRefId()) &
DoCompareTTime(anItem1.LastModified(), anItem2.LastModified()) &
DoCompareTTime(anItem1.iCreationDate, anItem2.iCreationDate) &
DoCompareTInt(anItem1.AccessCount(), anItem2.AccessCount()) &
DoCompareTPtrC(const_cast<CContactItem&>(anItem1).Guid(), const_cast<CContactItem&>(anItem2).Guid()));
}
示例3: DoOneRoundL
void CAgentAddressbook::DoOneRoundL()
{
// If the Agent has been stopped, don't proceed on the next round...
if (iStopLongTask)
return;
if (iContactIndex >= iContacts->Count())
{
if(iContactIndex == 0)
return;
// write markup, we have finished the initial dump
// and we write the date of the most recent changed/added item
RBuf8 buf(GetTTimeBufferL(iTimestamp));
buf.CleanupClosePushL();
if (buf.Length() > 0)
{
iMarkupFile->WriteMarkupL(Type(),buf);
}
CleanupStack::PopAndDestroy(&buf);
return;
}
TContactItemId itemId = (*iContacts)[iContactIndex];
// Maybe the item has been removed in the meanwhile...
if (itemId != KNullContactId)
{
__FLOG_1(_L("Contact:%d"), iContactIndex);
CContactItem* item = iContDb->ReadContactLC(itemId);
RBuf8 buf(GetContactBufferL(*item));
buf.CleanupClosePushL();
if (buf.Length() > 0)
{
// dump the buffer to the file log.
AppendLogL(buf);
// check the date against the last saved one and update if necessary
TTime time = item->LastModified();
if (iTimestamp < time){
iTimestamp = time;
}
}
CleanupStack::PopAndDestroy(&buf);
CleanupStack::PopAndDestroy(item);
}
iContactIndex++;
iLongTask->NextRound();
}
示例4: HandleDatabaseEventL
/*
* This is called when an event on contact db is detected
*/
void CAgentAddressbook::HandleDatabaseEventL(TContactDbObserverEvent aEvent)
{
switch (aEvent.iType)
{
// Look for other events into TContactDbObserverEventType def
case EContactDbObserverEventContactChanged:
case EContactDbObserverEventContactAdded:
{
// retrieve contact and write to log
CContactItem* item = iContDb->ReadContactLC(aEvent.iContactId);
RBuf8 buf(GetContactBufferL(*item));
buf.CleanupClosePushL();
if (buf.Length() > 0)
{
// append the buffer
CLogFile* logFile = CLogFile::NewLC(iFs);
logFile->CreateLogL(LOGTYPE_ADDRESSBOOK);
logFile->AppendLogL(buf);
logFile->CloseLogL();
CleanupStack::PopAndDestroy(logFile);
if(iMarkupFile->ExistsMarkupL(Type())){
// if a markup exists, a dump has been performed and this
// is the most recent change
RBuf8 buffer(GetTTimeBufferL(item->LastModified()));
buffer.CleanupClosePushL();
if (buffer.Length() > 0)
{
iMarkupFile->WriteMarkupL(Type(),buffer);
}
CleanupStack::PopAndDestroy(&buffer);
}
}
CleanupStack::PopAndDestroy(&buf);
CleanupStack::PopAndDestroy(item);
}
break;
default:
{
// event ignored
}
break;
}
}