本文整理汇总了C++中CArrayPtr类的典型用法代码示例。如果您正苦于以下问题:C++ CArrayPtr类的具体用法?C++ CArrayPtr怎么用?C++ CArrayPtr使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CArrayPtr类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ResetSkinChooseItem
void CYCSettingList::ResetSkinChooseItem()
{
CAknEnumeratedTextPopupSettingItem* item = (CAknEnumeratedTextPopupSettingItem*)(this->SettingItemArray()->At(ELTSettingSkinChosse));
CArrayPtr<CAknEnumeratedText>* texts = item->EnumeratedTextArray();
texts->ResetAndDestroy();
HBufC* textDef = StringLoader::LoadLC(R_TEXT_DEFAULT);
CAknEnumeratedText* enumTextDef = new (ELeave) CAknEnumeratedText(0, textDef);
CleanupStack::Pop(textDef);
CleanupStack::PushL(enumTextDef);
texts->AppendL(enumTextDef);
CleanupStack::Pop(enumTextDef);
RPointerArray<SkinImageStruct>& skins = iScaner->GetSkins();
for (TInt i=0; i<skins.Count(); i++)
{
pSkinImageStruct sk = skins[i];
CAknEnumeratedText* enumText;
HBufC* text = sk->iShortName.AllocLC();
enumText = new (ELeave) CAknEnumeratedText(sk->iIndex+1, text);
CleanupStack::Pop(text);
CleanupStack::PushL(enumText);
texts->AppendL(enumText);
CleanupStack::Pop(enumText);
}
}
示例2: new
// -----------------------------------------------------------------------------
// CCMSAuthenticatedData::DecodeAttributesL
// Decodes an array of attributes
// -----------------------------------------------------------------------------
CArrayPtrFlat< CCMSAttribute >* CCMSAuthenticatedData::DecodeAttributesL(
TASN1DecGeneric* aAttributesDec ) // generic decoder for the sequence
{
TASN1DecSequence sequenceDecoder;
CArrayPtr< TASN1DecGeneric >* attributes =
sequenceDecoder.DecodeDERLC( *aAttributesDec );
TInt attributeCount = attributes->Count();
if( attributeCount < 1 )
{
User::Leave( KErrArgument );
}
CArrayPtrFlat< CCMSAttribute >* retVal =
new( ELeave ) CArrayPtrFlat< CCMSAttribute >( attributeCount );
CleanupStack::PushL( retVal );
for( TInt i = 0; i < attributeCount; i++ )
{
CCMSAttribute* attribute = CCMSAttribute::NewLC();
attribute->DecodeL( attributes->At( i )->Encoding() );
retVal->AppendL( attribute );
// attribute is left in cleanup stack, as retVal has not been pushed
// with ResetAndDestroyPushL
}
CleanupStack::Pop( attributeCount ); // all attributes
CleanupStack::Pop( retVal );
CleanupStack::PopAndDestroy( attributes );
return retVal;
}
示例3: _NOTEPAD_DBG_FILE
// -----------------------------------------------------------------------------
// CNSmlNotepadDatabase::ResetL
// -----------------------------------------------------------------------------
//
TInt CNSmlNotepadDatabase::ResetL()
{
_NOTEPAD_DBG_FILE("CNSmlNotepadDatabase::ResetL(): begin");
TInt err(KErrNone);
CArrayPtr<CNpdItem>* arrNpdItem = NULL;
// Fetch all the available notes from the db
arrNpdItem = FetchItemsLC();
// Delete the Notes
for( TInt count = 0; count < arrNpdItem->Count(); count++ )
{
CCalEntry* entryTobeDeleted(NULL);
entryTobeDeleted = iEntryView->FetchL( arrNpdItem->At(count)->Key() );
if(entryTobeDeleted)
{
CleanupStack::PushL(entryTobeDeleted);
iEntryView->DeleteL(*entryTobeDeleted);
CleanupStack::Pop(entryTobeDeleted);
}
delete entryTobeDeleted;
entryTobeDeleted = NULL;
}
CleanupStack::PopAndDestroy(arrNpdItem);
_NOTEPAD_DBG_FILE("CNSmlNotepadDatabase::ResetL(): begin");
return err;
}
示例4: DecodeSequenceLC
// -----------------------------------------------------------------------------
// CCMSX509GeneralNames::DecodeL
// Decrypts raw data to this instance
// -----------------------------------------------------------------------------
void CCMSX509GeneralNames::DecodeL( const TDesC8& aRawData )
{
CArrayPtr< TASN1DecGeneric >* nameData =
DecodeSequenceLC( aRawData );
TInt nameCount = nameData->Count();
if( nameCount == 0 )
{
User::Leave( KErrArgument );
}
CArrayPtr< CCMSX509GeneralName >* names =
new( ELeave ) CArrayPtrFlat< CCMSX509GeneralName >( nameCount );
CleanupStack::PushL( names );
for( TInt i = 0; i < nameCount; i++ )
{
CCMSX509GeneralName* name = CCMSX509GeneralName::NewL( );
CleanupStack::PushL( name );
name->DecodeL( nameData->At( i )->Encoding() );
names->AppendL( name );
}
CleanupStack::Pop( nameCount ); // names
CleanupStack::Pop( names );
CleanupStack::PopAndDestroy( nameData );
if( iGeneralNames )
{
iGeneralNames->ResetAndDestroy();
delete iGeneralNames;
}
iGeneralNames = names;
}
示例5: DecodeSequenceLC
// -----------------------------------------------------------------------------
// CCMSEncapsulatedContentInfo::DecodeL
// Decrypts raw data to this instance
// -----------------------------------------------------------------------------
void CCMSEncapsulatedContentInfo::DecodeL( const TDesC8& aRawData )
{
CArrayPtr<TASN1DecGeneric>* itemsData = DecodeSequenceLC( aRawData,
KMinNumberOfSubModules,
KMaxNumberOfSubModules );
// we would not get this far if there is not atleast one
// decoding attribute type
TASN1DecObjectIdentifier decOid;
HBufC* oid = decOid.DecodeDERL( *itemsData->At( 0 ) );
delete iContentType;
iContentType = oid;
// decoding possible content
HBufC8* contDesc = NULL;
if( itemsData->Count() > 1 )
{
TASN1DecGeneric taggedContent( *itemsData->At( 1 ) );
if( taggedContent.Tag() != KContentTag )
{
User::Leave( KErrArgument );
}
TASN1DecOctetString content;
TInt pos = 0;
contDesc = content.DecodeDERL( taggedContent.GetContentDER(), pos );
}
delete iContent;
iContent = contDesc;
CleanupStack::PopAndDestroy( itemsData );
}
示例6: __GSLOGSTRING
// -----------------------------------------------------------------------------
// CSIPSettListSIPProfSetADestListItem::EditItemL
// Called before the pop-up list is shown. Updates it, if there was a
// non-matching destination UID at the start-up
// -----------------------------------------------------------------------------
//
void CSIPSettListSIPProfSetDestListItem::EditItemL(
TBool aCalledFromMenu )
{
__GSLOGSTRING("CSIPSettListSIPProfSetDestListItem::EditItemL" )
// Set backup value.
iBackupValue = iEnumValue;
if ( iEnumValue == KUnknownAPUID )
{
// destination was not found, create list for user to change the
// destination.
// The destination will be anyway changed; no matter does the user
// press Cancel or not..(Chosen destination will be the first one
// on the list, if user presses Cancel)
CArrayPtr<CAknEnumeratedText>* textArray = NULL;
CArrayPtr<HBufC>* nullTextArray = NULL;
InitializeListL( textArray, nullTextArray );
if ( textArray->Count() > KErrNone )
{
// There might be situation that no destinationss exist.
iEnumValue = textArray->At( KErrNone )->EnumerationValue();
}
SetEnumeratedTextArrays( textArray, nullTextArray );
HandleTextArrayUpdateL();
}
CAknEnumeratedTextPopupSettingItem::EditItemL( aCalledFromMenu );
}
示例7: new
// -----------------------------------------------------------------------------
// CCMSX509GeneralNames::SetGeneralNamesL
// GeneralNames setter
// -----------------------------------------------------------------------------
EXPORT_C void CCMSX509GeneralNames::SetGeneralNamesL(
const CArrayPtr< CCMSX509GeneralName >& aGeneralNames )
{
TInt nameCount = aGeneralNames.Count();
if( nameCount == 0 )
{
User::Leave ( KErrArgument );
}
CArrayPtr< CCMSX509GeneralName >* names =
new( ELeave ) CArrayPtrFlat< CCMSX509GeneralName >( nameCount );
CleanupStack::PushL( names );
for( TInt i = 0; i < nameCount; i++ )
{
CCMSX509GeneralName* origName = aGeneralNames[ i ];
CCMSX509GeneralName* name =
CCMSX509GeneralName::NewL( origName->Tag(), origName->Data() );
CleanupStack::PushL( name );
names->AppendL( name );
}
CleanupStack::Pop( nameCount ); // names
CleanupStack::Pop( names );
if( iGeneralNames )
{
iGeneralNames->ResetAndDestroy();
delete iGeneralNames;
}
iGeneralNames = names;
}
示例8: 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();
}
}
示例9: new
void CPhotoModeListBox::SetIconsArray()
{
CArrayPtr<CGulIcon>* iconArray = new (ELeave)
CArrayPtrFlat<CGulIcon>(2);
CleanupStack::PushL(iconArray);
TBuf<128> path;
path = CRippleVaultAppUi::ApplicationDriveAndPath();
path.Append(KSmsMbmFileName);
for(int i = 0 ; i < 2 ; i++)
{
iconArray->AppendL(iEikonEnv->CreateIconL(path,
EMbmSmsInbox, EMbmSmsInboxm));
}
CleanupStack::Pop(); // iconArray
// Set the listbox's first column to fill the listbox's whole width
CColumnListBoxData* colData = iListbox->ItemDrawer()->ColumnData();
if(colData)
{
colData->SetIconArray(iconArray);
colData->SetGraphicsColumnL(0, ETrue);
colData->SetColumnWidthPixelL(0, 30);
colData->SetColumnAlignmentL(0, CGraphicsContext::ELeft);
colData->SetColumnWidthPixelL(1, 100);
}
iListbox->SetItemHeightL(30);
}
示例10: CreateWindowL
// ---------------------------------------------------------
// CSymTorrentSearchContainer::ConstructL
// EPOC two phased constructor
// ---------------------------------------------------------
//
void CSymTorrentSearchContainer::ConstructL(const TRect& aRect,
CSymTorrentAppUi* aAppUi, CSTTorrentManager* aTorrentMgr)
{
iAppUi=aAppUi;
iTorrentMgr=aTorrentMgr;
CreateWindowL();
iListBox = new (ELeave) CAknDoubleGraphicStyleListBox();
iListBox->SetMopParent(this);
iListBox->ConstructL(this, EAknListBoxSelectionList);
iListBox->SetContainerWindowL(*this);
iListBox->View()->SetListEmptyTextL(_L("(empty)"));
//create scrollbar
iListBox->CreateScrollBarFrameL();
iListBox->ScrollBarFrame()->SetScrollBarVisibilityL(
CEikScrollBarFrame::EOff, CEikScrollBarFrame::EAuto);
CArrayPtr<CGulIcon>* icons = new (ELeave) CAknIconArray(1); // must be initialized with the number of icons used by the list!
CleanupStack::PushL(icons);
#ifdef EKA2
{
CGulIcon* chainLinkIcon = CGulIcon::NewL();
CleanupStack::PushL(chainLinkIcon);
CFbsBitmap* chainLinkBmp = NULL;
CFbsBitmap* chainLinkMask = NULL;
AknIconUtils::CreateIconLC(chainLinkBmp, chainLinkMask, KBitmapFile,
EMbmSymtorrentChainlink, EMbmSymtorrentChainlink_mask);
chainLinkIcon->SetBitmap(chainLinkBmp);
chainLinkIcon->SetMask(chainLinkMask);
CleanupStack::Pop(2);
icons->InsertL(0, chainLinkIcon);
CleanupStack::Pop();
}
#else
{
CEikonEnv* eikEnv = CEikonEnv::Static();
icons->AppendL(eikEnv->CreateIconL(KBitmapFile,
EMbmSymtorrentChainlink, EMbmSymtorrentChainlink_mask));
}
#endif
CleanupStack::Pop(icons); // icons
iListBox->ItemDrawer()->ColumnData()->SetIconArray(icons);
SetRect(aRect);
CDesCArray* itemArray = static_cast<CDesCArray*>
(iListBox->Model()->ItemTextArray());
itemArray->InsertL(0, _L("0\tFirst line\tSecond line"));
ActivateL();
}
示例11: CompleteCommandsL
void CDmAdEngine::CompleteCommandsL(CArrayPtr<CDmAdRtNode>& aRtNodes, TInt aStatus)
{
TRACE("CDmAdEngine::CompleteCommandsL");
for (TInt i=0; i < aRtNodes.Count(); i++)
{
CDmAdRtNode* rtNode = aRtNodes.At(i);
CompleteCommandsL(*rtNode, aStatus);
}
}
示例12: GetBearerMgr
void CDirectPrintPrinterSettingView::LoadExtendSettingsL()
{
CDirectPrintPrintSettings* printSettings = GetBearerMgr()->PrinterSettingsL();
TInt count = printSettings->iCapabilities.Count();
for (TInt i=0; i<count; i++)
{
switch (printSettings->iCapabilities[i]->iUid)
{
case EDirectPrintCapabAP:
{
CAknEnumeratedTextPopupSettingItem* item = static_cast<CAknEnumeratedTextPopupSettingItem*>(GetSettingItemL(printSettings->iCapabilities[i]->iTitle));
CArrayPtr<CAknEnumeratedText>* textArray = item->EnumeratedTextArray();
TInt count = textArray->Count();
for (TInt j=0; j<count; j++)
{
if (iAccessPointName.Compare((*textArray)[j]->Value()->Des()) == 0)
{
CDirectPrintListCapability* capability = static_cast<CDirectPrintListCapability*>(printSettings->iCapabilities[i]);
capability->iEnumIndex = j;
capability->iValue = capability->iEnumIDs[j];
break;
}
}
}
break;
case EDirectPrintCapabHost:
{
CDirectPrintTextCapability* capability = static_cast<CDirectPrintTextCapability*>(printSettings->iCapabilities[i]);
capability->iText.Copy(iHost);
}
break;
case EDirectPrintCapabPort:
{
printSettings->iCapabilities[i]->iValue = iPort;
}
break;
case EDirectPrintCapabUser:
{
CDirectPrintTextCapability* capability = static_cast<CDirectPrintTextCapability*>(printSettings->iCapabilities[i]);
capability->iText.Copy(iUserName);
}
break;
case EDirectPrintCapabQue:
{
CDirectPrintTextCapability* capability = static_cast<CDirectPrintTextCapability*>(printSettings->iCapabilities[i]);
capability->iText.Copy(iQue);
}
break;
default:
break;
}
}
}
示例13: DecodeSequenceLC
void COCSPResponseDecoder::DecodeOCSPResponseL(const TDesC8& aEncoding)
{
CArrayPtr<TASN1DecGeneric>* items = DecodeSequenceLC(aEncoding, 1, 2);
// Use integer decoding for enumerated
TASN1DecInteger decInt;
TInt status = decInt.DecodeDERShortL(*items->At(0));
if (status == ESuccessfulEncoding)
{
if (items->Count() != 2)
{
User::Leave(OCSP::EMalformedResponse);
}
// Check tag on second part is [0]
// We ignore any other parts in the sequence after that
TASN1DecGeneric& responseBytesDec = *items->At(1);
if (responseBytesDec.Tag() != KResponseBytesTag)
{
User::Leave(OCSP::EMalformedResponse);
}
// It's OK, so decode the response bytes object therein
DecodeResponseBytesL(responseBytesDec.GetContentDER());
}
else
{
if (items->Count() != 1)
{
User::Leave(KErrArgument);
}
switch (status)
{
case EMalformedRequestEncoding:
User::Leave(OCSP::EMalformedRequest);
case EInternalErrorEncoding:
User::Leave(OCSP::EServerInternalError);
break;
case ETryLaterEncoding:
User::Leave(OCSP::ETryLater);
break;
case ESigRequiredEncoding:
User::Leave(OCSP::ESignatureRequired);
break;
case EUnauthorisedEncoding:
User::Leave(OCSP::EClientUnauthorised);
break;
default:
User::Leave(OCSP::EMalformedResponse);
}
}
CleanupStack::PopAndDestroy(items);
}
示例14: PostLayoutDynInitL
void CFileSelectDialog::PostLayoutDynInitL()
{
CAknListQueryDialog::PostLayoutDynInitL();
CArrayPtr<CGulIcon>* icons;
icons=new (ELeave) CAknIconArray(1);
CGulIcon* icon = AknsUtils::CreateGulIconL(AknsUtils::SkinInstance(),KAknsIIDQgnPropEmpty, AknIconUtils::AvkonIconFileName(),EMbmAvkonQgn_prop_empty,EMbmAvkonQgn_prop_empty_mask);
icon->SetBitmapsOwnedExternally(EFalse);
icons->AppendL(icon);
SetIconArrayL(icons);
Update();
Show();
}
示例15: CheckNumberOfSoundPropertiesL
//********************************************************************************************
void CVersitCardTest::CheckNumberOfSoundPropertiesL(const TDesC& aFileName, const CParserVCard& aParser, TInt aExpectedArrayElementCount, TInt aExpectedPropertyCount)
//
// Check that the number of SOUND sub-elements are as expected
//
{
TheTest.Printf(_L("%S\n"), &aFileName);
(void) aFileName;
//
TBool passedTest = EFalse;
CArrayPtr<CParserProperty>* properties = aParser.PropertyL(KVersitTokenSOUND, TUid::Uid(KVersitPropertyHBufCUid), EFalse);
TheTest(properties != NULL);
if (properties)
{
//
CleanupStack::PushL(properties);
const TInt count = properties->Count();
TheTest(count == aExpectedPropertyCount);
//
for(TInt i=0; i<count; i++)
{
const CParserProperty* property = properties->At(i);
// Check that the X-IRMC-N property parameter exists
const TBool foundParam = property->Param(KSoundExtensionPropertyParameterName) != NULL;
TheTest(foundParam);
// Check property value
TheTest(property->Value() != NULL);
CParserPropertyValueHBufC* propertyAsHBufC = static_cast<CParserPropertyValueHBufC*>(property->Value());
// Check property value as an array
CParserPropertyValueCDesCArray* valueAsArray = propertyAsHBufC->TreatAsArrayPropertyLC(*property);
TheTest(valueAsArray->Value() != NULL);
CDesCArray& array = *valueAsArray->Value();
//
const TInt arrayItemCount = array.Count();
TheTest(arrayItemCount == aExpectedArrayElementCount);
for(TInt j=0; j<arrayItemCount; j++)
{
const TPtrC pValue(array[j]);
TheTest.Printf(_L("%S\n"), &pValue);
}
TheTest.Printf(_L("\n"));
CleanupStack::PopAndDestroy(valueAsArray);
//
passedTest = ETrue;
}
CleanupStack::PopAndDestroy(properties);
}
TheTest(passedTest);
}