本文整理汇总了C++中CArrayPtr::Delete方法的典型用法代码示例。如果您正苦于以下问题:C++ CArrayPtr::Delete方法的具体用法?C++ CArrayPtr::Delete怎么用?C++ CArrayPtr::Delete使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CArrayPtr
的用法示例。
在下文中一共展示了CArrayPtr::Delete方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DeleteItemL
void CMainMenuGridContainer::DeleteItemL(TInt aIndex)
{
CArrayPtr<CGulIcon>* icons =
iGrid->ItemDrawer()->FormattedCellData()->IconArray();
if (icons && aIndex >= 0 && aIndex < icons->Count()) {
//Delete item if index is valid.
_LIT(KItem, "%d\t\t0");
TBuf<8> buf;
MDesCArray* array = iGrid->Model()->ItemTextArray();
CDesCArray* cArray = (CDesCArray*)array;
//Remove icon and items.
icons->Delete(aIndex);
cArray->Delete(aIndex, (cArray->Count() - aIndex));
iGrid->HandleItemRemovalL();
//Re-add the items behind, needed since we changed the indexes.
for (TInt i = aIndex; i < icons->Count(); i++) {
buf.Format(KItem, i);
cArray->AppendL(buf);
}
//Inform list box that data was added.
iGrid->HandleItemAdditionL();
SetGridGraphicStyleL();
}
}
示例2:
// ---------------------------------------------------------------------------
// CAppMngr2ListContainer::DeleteItemSpecificIcons()
// ---------------------------------------------------------------------------
//
void CAppMngr2ListContainer::DeleteItemSpecificIcons( CArrayPtr<CGulIcon>& aIconArray )
{
if( iItemSpecificIcons )
{
TInt iconArrayCount = aIconArray.Count();
TInt firstItemSpecificIcon = iconArrayCount - iItemSpecificIcons;
for( TInt index = firstItemSpecificIcon; index < iconArrayCount; index++ )
{
delete aIconArray[ index ];
}
aIconArray.Delete( firstItemSpecificIcon, iItemSpecificIcons );
iItemSpecificIcons = 0;
}
}
示例3: MergeEntityL
// ------------------------------------------------------------------------------------------------
// CNSmlDataModBase::MergeEntityL
// Merges data from old entity to new entity.
// ------------------------------------------------------------------------------------------------
void CNSmlDataModBase::MergeEntityL( CVersitParser* aNewEntity, CVersitParser* aOldEntity, TBool& aModified, TBool aFieldLevel ) const
{
_DBG_FILE("CNSmlDataModBase::MergeEntityL(): begin");
// Remove all data that was not supposed to be supported by the partner but
// it was still sent to us.
StripAllNotOnPartnerListL( aNewEntity, aModified );
if( !aFieldLevel )
{
// Remove all properties from old item that are supported by remote server.
// If it is field level then old this is not done.
StripAllOnPartnerListL( aOldEntity, aModified, ETrue );
CArrayPtr<CParserProperty>* mergeProps = aOldEntity->ArrayOfProperties( ETrue );
if( mergeProps )
{
CleanupStack::PushL( mergeProps );
for( TInt i = 0; i < mergeProps->Count(); i++ )
{
aNewEntity->AddPropertyL( mergeProps->At( i ), ETrue );
}
CleanupStack::PopAndDestroy(); // mergeProps
}
}
else // Support for Field level merge
{
//Field level merge. Merge new item with old item. Properties of
//the old item are copied to new item if the new item entity does not
//contain certain property.
//------------------------------------------------------------------------
// Old New Merged
//------------------------------------------------------------------------
// BEGIN:VCARD -> BEGIN:VCARD = BEGIN:VCARD
// VERSION:2.1 -> VERSION:2.1 = VERSION:2.1
// N:Smith;John -> N:White;John = N:White;John
// ORG:Firm = ORG:Firm
// TITLE:Boss = TITLE:Boss
// -> TEL;CELL;VOICE:1234 = TEL;CELL;VOICE:1234
// END:VCARD -> END:VCARD = END:VCARD
CArrayPtr<CParserProperty>* newProps = aNewEntity->ArrayOfProperties( EFalse );
if( newProps )
{
CArrayPtr<CParserProperty>* oldProps = aOldEntity->ArrayOfProperties( EFalse );
// Iterate through old list of properties. Add missing properties from old
// contact item, if some of the properties is not included in new item.
for( TInt i = 0; i < oldProps->Count(); )
{
CParserProperty* oldProperty = oldProps->At( i );
//Check if the property is included in received vCard
CArrayPtr<CParserProperty>* properties = aNewEntity->PropertyL(
oldProperty->Name(), oldProperty->Uid(), EFalse );
if ( !properties )
{
// New vCard does not include certain property. Copy all matching properties from
// existing contact item.
CArrayPtr<CParserProperty>* oldProperties =
aOldEntity->PropertyL( oldProperty->Name(), oldProperty->Uid(), ETrue );
CleanupPtrArrayPushL( oldProperties );
for ( TInt j = oldProperties->Count()-1; j >= 0; --j )
{
CParserProperty* property = oldProperties->At( j );
oldProperties->Delete( j );
CleanupStack::PushL( property );
aNewEntity->AddPropertyL( property, EFalse );
CleanupStack::Pop( property );
aModified = ETrue;
}
CleanupStack::PopAndDestroy( oldProperties );
}
else
{
// If new vCard includes at least one property with same name we will not copy
// any any property with same name from existing contact item.
delete properties;
++i;
}
}
}
}
#ifdef __NSML_DEBUG__
CArrayPtr<CParserProperty>* props = aNewEntity->ArrayOfProperties( EFalse );
for( TInt i = 0; i < props->Count(); i++ )
{
TBuf8<512> b;
const CParserProperty* p = props->At( i );
b = p->Name();
const CArrayPtr<CParserParam>* pa = ( ( CNSmlProperty* )p )->Parameters();
if( pa )
//.........这里部分代码省略.........
示例4: StripAllNotOnPartnerListL
//.........这里部分代码省略.........
{
removeMe = EFalse;
break;
}
}
}
else
{
removeMe = EFalse;
break;
}
}
}
else
{
//Handling when the device supports VersitTokenType as "Encoding"
if(ownparamname == KVersitTokenENCODING)
{
removeMe = EFalse;
}
else
{
for(TInt remoteparam = 0; remoteparam < remoteProperty.ParamCount(); remoteparam++)
{
TDesC8 remoteparamname = remoteProperty.Param( remoteparam ).Field().Name().DesC();
if(ownparamname.Compare(remoteProperty.Param( remoteparam ).Field().Name().DesC()) == 0)
{
const CSmlDataField& field = remoteProperty.Param( remoteparam ).Field();
if( field.EnumValueCount() > 0)
{
for( TInt rmtenumcount = 0; rmtenumcount < field.EnumValueCount(); rmtenumcount++ )
{
TPtrC8 rmtenumvalue = field.EnumValue( rmtenumcount ).DesC();
if( rmtenumvalue.Compare(ownparamvalue)== 0 )
{
removeMe = EFalse;
break;
}
}
}
else
{
removeMe = EFalse;
break;
}
}
}
}
}
if( removeMe )
{
break;
}
}
}
else
{
removeMe = EFalse;
}
}
}
else
{
removeMe = EFalse;
}
if( !removeMe )
{
break;
}
}
}
if( removeMe )
{
#ifdef __NSML_DEBUG__
TPtrC8 pn( ownProperty.Name() );
DBG_ARGS8(_S8("CNSmlDataModBase::StripAllNotOnPartnerListL(): Dropping %S"), &pn);
#endif // __NSML_DEBUG__
delete allProps->At( i );
allProps->Delete( i );
wasModified = ETrue;
aModified = ETrue;
}
else
{
#ifdef __NSML_DEBUG__
TPtrC8 pn( ownProperty.Name() );
DBG_ARGS8(_S8("CNSmlDataModBase::StripAllNotOnPartnerListL(): NOT dropping %S"), &pn);
#endif // __NSML_DEBUG__
i++;
}
}
// can't use aModified as that may have been set earlier!
if( wasModified )
{
allProps->Compress();
}
}
_DBG_FILE("CNSmlDataModBase::StripAllNotOnPartnerListL(): end");
}