本文整理汇总了C++中CDesCArrayFlat类的典型用法代码示例。如果您正苦于以下问题:C++ CDesCArrayFlat类的具体用法?C++ CDesCArrayFlat怎么用?C++ CDesCArrayFlat使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CDesCArrayFlat类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: new
// -----------------------------------------------------------------------------
// CTestSDKSettingPages::TestSettingpagesRadioButtonListBoxControlL
// -----------------------------------------------------------------------------
//
TInt CTestSDKSettingPages::TestSettingpagesRadioButtonListBoxControlL( CStifItemParser& /*aItem*/ )
{
CDesCArrayFlat* mArr = new( ELeave ) CDesCArrayFlat( KSize );
CleanupStack::PushL( mArr );
TBuf<KBufSize> tom( KTom );
TBuf<KBufSize> jack( KJack );
TBuf<KBufSize> mary( KMary );
mArr->AppendL( tom );
mArr->AppendL( jack );
mArr->AppendL( mary );
TInt optin( KZero );
CAknRadioButtonSettingPage* dialog =
new (ELeave) CAknRadioButtonSettingPage( R_EXAMPLE_SETTING_PAGE,
optin, mArr );
CleanupStack::PushL( dialog );
CAknSetStyleListBox* editorControl = dialog->ListBoxControl();
STIF_ASSERT_NULL( editorControl );
dialog->ConstructL();
editorControl = dialog->ListBoxControl();
STIF_ASSERT_NOT_NULL( editorControl );
CleanupStack::PopAndDestroy( KTwo );
return KErrNone;
}
开发者ID:cdaffara,项目名称:symbiandump-mw1,代码行数:33,代码来源:testsdksettingpagesblocksaknradiobuttonsettingpage.cpp
示例2: new
// -----------------------------------------------------------------------------
// CTestSDKGrids::TestGridsGridmSetStartCellsL
// -----------------------------------------------------------------------------
//
TInt CTestSDKGrids::TestGridsGridmSetStartCellsL( CStifItemParser& /*aItem*/ )
{
CAknGridM* grid = new( ELeave ) CAknGridM;
CleanupStack::PushL( grid );
CDesCArrayFlat* arr = new(ELeave)CDesCArrayFlat(KSize);
CleanupStack::PushL( arr );
HBufC* buf1 = KTom().AllocLC();
arr->AppendL(*buf1);
grid->SetItemTextArray( arr );
TInt cells = grid->IndexOfFirstDataItem();
STIF_ASSERT_EQUALS( KZero, cells );
grid->SetStartCells( KThree );
cells = grid->IndexOfFirstDataItem();
STIF_ASSERT_EQUALS( KThree, cells );
CleanupStack::PopAndDestroy( buf1 );
CleanupStack::Pop( arr );
CleanupStack::PopAndDestroy( grid );
return KErrNone;
}
示例3: LOG1
// ----------------------------------------------------------------------------------------------------------
// Remove an item from the collection database using the given path
// ----------------------------------------------------------------------------------------------------------
//
void CTestCollectionPlugin::RemoveL (const CMPXCollectionPath& aPath)
{
LOG1(_L("CTestCollectionPlugin::RemoveL"));
LogPath( aPath );
CDesCArrayFlat* fp = new (ELeave) CDesCArrayFlat(8);
CleanupStack::PushL( fp );
switch( aPath.Levels() )
{
case 2:
if(aPath.Id() == 14)
{ // Test0091
iObs->HandleRemove( *fp, KErrNotFound );
}
break;
case 3:
if(aPath.Id() == 212)
{ // Test0090
fp->AppendL( _L("\\song3121.ts") );
fp->AppendL( _L("\\song3122.ts") );
fp->AppendL( _L("\\song3123.tp") );
iObs->HandleRemove( *fp, KErrNone );
}
break;
case 4:
if(aPath.Id() == 3111)
{ // Test0088
fp->AppendL( _L("\\song3111.ts") );
iObs->HandleRemove( *fp, KErrNone );
}
break;
default:
User::Panic(_L("CTestCollectionPlugin::RemoveL panic"), 1); // magic number
}
CleanupStack::PopAndDestroy( fp );
}
示例4: WriteToLog
// ---------------------------------------------------------
// TXdmSettingsApi::CollectionNamesL
//
// ---------------------------------------------------------
//
EXPORT_C CDesCArray* TXdmSettingsApi::CollectionNamesLC( RArray<TInt>& aSettingIds )
{
#ifdef _DEBUG
WriteToLog( _L8( "TXdmSettingsApi::CollectionNamesL()" ) );
#endif
TInt error = KErrNone;
CDesCArrayFlat* propertySet = new ( ELeave ) CDesCArrayFlat( 10 );
CleanupStack::PushL( propertySet );
CRepository* repository = CRepository::NewL( KCRUidXdmEngine );
CleanupStack::PushL( repository );
RArray<TUint32> nameKeys = FindByTypeL( repository, EXdmPropName );
CleanupClosePushL( nameKeys );
RArray<TUint32> idKeys = FindByTypeL( repository, EXdmPropSettingsId );
CleanupClosePushL( idKeys );
#ifdef _DEBUG
WriteToLog( _L8( " ID key count: %d" ), idKeys.Count() );
WriteToLog( _L8( " Name key count: %d" ), nameKeys.Count() );
#endif
TInt count = nameKeys.Count();
if( count > 0 )
{
TInt numId = 0;
HBufC* name = NULL;
TBuf<10> identifier;
for( TInt i = 0; i < count; i++ )
{
identifier.Zero();
name = HBufC::NewLC( NCentralRepositoryConstants::KMaxUnicodeStringLength );
TPtr desc( name->Des());
error = repository->Get( nameKeys[i], desc );
error = repository->Get( idKeys[i], identifier );
if( error == KErrNone && desc.Length() > 0 && identifier.Length() > 0 )
{
#ifdef _DEBUG
HBufC8* eightName = HBufC8::NewLC( desc.Length() );
TPtr8 eightDesc( eightName->Des() );
eightDesc.Copy( desc );
WriteToLog( _L8( " Collection no. %d - Name: %S ID: %S" ), i, &eightDesc, &identifier );
CleanupStack::PopAndDestroy(); //eightName
#endif
propertySet->AppendL( desc );
TLex id( identifier );
error = id.Val( numId );
aSettingIds.Append( error == KErrNone ? numId : error );
}
else
{
#ifdef _DEBUG
WriteToLog( _L8( " Fetching of the name no. %d failed with: %d" ), i, error );
#endif
}
CleanupStack::PopAndDestroy(); //name
}
}
CleanupStack::PopAndDestroy( 3 ); //idKeys, nameKeys, repository
return propertySet;
}
示例5: new
/** Creates a CDesCArray property
@return CDesCArray parser Property value
*/
CParserPropertyValue* CContactsPBAPExportUtilityClass::CreateCDesCArrayL()
{
CDesCArrayFlat* desArray = new (ELeave)CDesCArrayFlat(4);
CleanupStack::PushL(desArray);
desArray->AppendL(KAddr1);
desArray->AppendL(KAddr2);
desArray->AppendL(KAddr3);
CParserPropertyValue* propertyValue = new (ELeave) CParserPropertyValueCDesCArray(desArray);
CleanupStack::Pop(); // desArray
return propertyValue;
}
示例6: GetFieldKeysL
// -----------------------------------------------------------------------------
void CPresenceCacheBuddyInfo::GetFieldKeysL(
CDesCArrayFlat& aKeys )
{
aKeys.Reset();
THashMapIter<TDesC*, TInt> iter(iHashMap);
TDesC* const* nextKey = iter.NextKey();
while (nextKey)
{
aKeys.AppendL( **nextKey );
nextKey = iter.NextKey();
}
}
示例7: ntohs
TBool CPingController::DecodeRespL()
{
// Reply from %S: bytes=%D time=%Dms TTL=%D
// time
TUint32 triptime = User::NTickCount() - iTimestamp;//icmpHdr->timestamp;
const TUint8* reply = iReplyBuf.Ptr();
const TIpHdr* ipHdr = (const TIpHdr*)reply;
const TIcmpHdr* icmpHdr = (const TIcmpHdr*)(reply + ipHdr->ip_hl * 4);
if (ntohs(icmpHdr->icd_id) != ICMP_ID)
{
iReplyText = StringLoader::LoadL(R_PKTPING_SOMEONE_ELSE_PACKET_RECEIVED);
return EFalse;
}
if (icmpHdr->icmp_type != ICMP_ECHOREPLY)
{
iReplyText = StringLoader::LoadL(R_PKTPING_NONE_ECHO_TYPE_RECEIVED_FORMAT, icmpHdr->icmp_type);
return ETrue;
}
if (ntohs(icmpHdr->icd_seq) != iIcmpPacket->SeqNo())
{
iReplyText = StringLoader::LoadL(R_PKTPING_OUT_OF_ORDER_PACKET_RECEIVED);
return EFalse;
}
// from
iRecv.Zero();
iRecvAddr.Output(iRecv);
// bytes
TUint16 bytes = ntohs(ipHdr->ip_len) - ipHdr->ip_hl * 4 - ICMP_HDR_LEN;
// TTL
TUint8 ttl = ipHdr->ip_ttl;
CDesCArrayFlat* strings = new (ELeave) CDesCArrayFlat( 1 );
CleanupStack::PushL( strings );
strings->AppendL(iRecv);
CArrayFix<TInt>* vals = new (ELeave) CArrayFixFlat<TInt>(3);
CleanupStack::PushL( vals );
vals->AppendL(bytes);
vals->AppendL(triptime);
vals->AppendL(ttl);
iReplyText = StringLoader::LoadL(R_PKTPING_REPLY_TEXT_FORMAT, *strings, *vals);
CleanupStack::PopAndDestroy(2); // strings, vals
//stat
iStat.sum += triptime;
++(iStat.received);
iStat.min = Min(iStat.min, triptime);
iStat.max = Max(iStat.max, triptime);
return ETrue;
}
示例8: new
// ----------------------------------------------------
// CAlfExCalendarEngine::ConstructL
// ----------------------------------------------------
void CAlfExCalendarEngine::ConstructL()
{
TReal randomNumber;
TInt randomNumberInt;
TInt64 seed=0;
CDesCArrayFlat* array = new(ELeave) CDesCArrayFlat(KAlfExCalendarEngineArrayGranularity);
CleanupStack::PushL( array );
CEikonEnv* coeEnv = CEikonEnv::Static();
TResourceReader reader;
coeEnv->CreateResourceReaderLC(reader, R_ALFEXCALENDAR_CALENDAR_EVENTS_ARRAY);
const TInt count = reader.ReadInt16();
for(TInt loop = 0; loop < count; loop++)
{
HBufC* txt = reader.ReadHBufCL();
CleanupStack::PushL(txt);
array->AppendL(*txt);
CleanupStack::PopAndDestroy(txt);
}
CleanupStack::PopAndDestroy(); //reader2
TAlfExCalendarEngineListItem event;
event.iItemDay.HomeTime();
seed = event.iItemDay.Int64();
randomNumber = count * Math::FRand(seed);
randomNumberInt = (TInt) randomNumber;
TTimeIntervalDays days(KAlfExCalendarEngineDayTenDays);
event.iItemDay -= days; // lets start 10 days before present
for(TInt i=0; i<KAlfExCalendarEngineDayRandomizeLoopCount; i++)
{
for(TInt loop = 0; loop < count; loop++)
{
randomNumber = Math::FRand(seed);
if(randomNumber < KAlfExCalendarEngineChangeDay)
{
randomNumber *= KAlfExCalendarEngineDayRandomize;
randomNumberInt = (TInt) randomNumber;
days = TTimeIntervalDays(randomNumberInt);
event.iItemDay += days;
}
event.iItemText.Copy((*array)[loop]);
iCalendarEventArray.AppendL(event);
}
}
CleanupStack::PopAndDestroy(array);
}
示例9: _LIT
// -----------------------------------------------------------------------------
// CActiveExample::ShowTheListMsgQueryL
// -----------------------------------------------------------------------------
//
void CActiveExample::ShowTheListMsgQueryL()
{
_LIT( KHead, "Message" );
_LIT( KText, "Item" );
TBufC<20> tempString( KText );
CDesCArrayFlat* arrayItem = new( ELeave ) CDesCArrayFlat( 20 );
arrayItem->AppendL( tempString );
iGlobalListMsgQuery->ShowListMsgQueryL( arrayItem, iStatus, KHead, KText );
SetActive();
CActiveScheduler::Start();
}
示例10: CleanupClosePushL
void T_CSPSettings::T_CSPSettings_FindServiceNamesLL( )
{
RIdArray ids;
CleanupClosePushL( ids );
iCSPSettings->FindServiceIdsL( ids );
CDesCArrayFlat* names = new ( ELeave ) CDesCArrayFlat( 10 );
CleanupStack::PushL( names );
EUNIT_ASSERT( KErrNone == iCSPSettings->FindServiceNamesL( ids, *names ) );
TInt count = names->MdcaCount();
EUNIT_ASSERT( count );
CleanupStack::PopAndDestroy( names );
CleanupStack::PopAndDestroy( &ids );
}
示例11: ConstructL
void CRpsMsg::ConstructL(const TDesC8& aMsgType, const TDesC8& aOpCode, const TUint aMsgNum, const CDesCArrayFlat& aArgArray)
{
TUint numArgs(aArgArray.Count());
iMsgDataArray = new (ELeave)CDesC8ArrayFlat(1);
// Calc the total msg length
TUint msgLen(KRqstLengthNoOpCodeNoArgsNoCommas + aOpCode.Length());
for(TInt i(0); i < numArgs; ++i)
{
msgLen += aArgArray.MdcaPoint(i).Length();
}
// add commas to calculation
msgLen += KRqstMsgElementsNoArgs + numArgs - 1;
// Msg Type
iMsgDataArray->AppendL(aMsgType);
iMsgDataArray->AppendL(KComma);
// Msg Len
TBuf8<KMaxMsgLenChars> mlenString;
mlenString.NumFixedWidth(msgLen, EDecimal, KMaxMsgLenChars);
iMsgDataArray->AppendL(mlenString);
iMsgDataArray->AppendL(KComma);
// Msg Seq Num
TBuf8<KMaxMsgNumChars> msnString;
//msnString.Num(NextMsgNum());
msnString.NumFixedWidth(aMsgNum, EDecimal, KMaxMsgNumChars);
iMsgDataArray->AppendL(msnString);
iMsgDataArray->AppendL(KComma);
// OpCode
iMsgDataArray->AppendL(aOpCode);
iMsgDataArray->AppendL(KComma);
// Arguments. Convert aArgArray data to 8-bit as we go.
for(TInt i(0); i < numArgs; ++i)
{
TBuf8<KMaxElementSize> buf;
buf.Copy(aArgArray.MdcaPoint(i));
iMsgDataArray->AppendL(buf);
iMsgDataArray->AppendL(KComma);
}
// EOM
iMsgDataArray->AppendL(KEOM);
}
示例12: new
// Set data to the listbox.
void CContactsSubScreenView::SetData()
{
TBuf<50> titlename;
TBuf<50> formatBuf;
titlename.Copy(_L(""));
formatBuf.Copy(_L(""));
formatBuf.Append(*(iEikonEnv->AllocReadResourceL(R_STATUSTEXT_CONTACTS_UPLOADED)));
titlename.Format(formatBuf, iContactsArray->MdcaCount());
iAppTitle->SetTextL(titlename, CCknAppTitle::EMainTitle);
iListbox->HandleItemRemovalL();
CDesCArrayFlat* listItems = new (ELeave) CDesCArrayFlat(1);
if(iContactsArray->MdcaCount() > 0)
{
listItems->Reset();
CDesCArrayFlat* listItems = new (ELeave) CDesCArrayFlat(iContactsArray->MdcaCount());
}
CleanupStack::PushL(listItems);
TBuf<500> item;
for (TInt i = 0; i < iContactsArray->MdcaCount() ; i++)
{
item.Copy(_L(""));
item.Append((*iContactsArray)[i]);
item.Append(_L(","));
item.Append((*iMobileArray)[i]);
listItems->AppendL(item);
}
CleanupStack::Pop(listItems);
CTextListBoxModel* model = iListbox->Model();
model->SetItemTextArray(listItems);
// Set ListBox model responsible for deleting the listItems array
model->SetOwnershipType(ELbmOwnsItemArray);
iListbox->HandleItemAdditionL();
DrawDeferred();
}
示例13: KGranularity
// Creates text string for the settings list box
HBufC* CDirectPrintFloatCapability::ListBoxTextL()
{
const TInt KGranularity( 4 );
TRealFormat format( KMaxTRealCharNum, KDecimals );
TBuf<KMaxTRealCharNum> numStr;
numStr.Zero();
numStr.AppendNum( iRealValue, format );
CDesCArrayFlat* strings = new ( ELeave ) CDesCArrayFlat( KGranularity );
CleanupStack::PushL( strings );
strings->AppendL( iTitle );
strings->AppendL( numStr );
HBufC* buf = StringLoader::LoadL( R_QTN_LBOX_FORMAT, *strings );
CleanupStack::PopAndDestroy(); // strings
return buf;
}
示例14: new
void CFormatOptionsDialog::TUintChoiceList(TInt aResourceId, const RArray<TUint>& aArray)
{
CEikChoiceList* list = static_cast<CEikChoiceList*>(Control(aResourceId));
if (aArray.Count()==0)
{
list->MakeVisible(EFalse);
return;
}
TBuf <10> buf;
CDesCArrayFlat* array = new (ELeave) CDesCArrayFlat(4);
CleanupStack::PushL(array);
for (TInt i=0; i<aArray.Count(); i++)
{
buf.Num(aArray[i]);
array->AppendL(buf);
}
list->SetArrayL(array);
CleanupStack::Pop(); //array
}
示例15: AddBackItem
void CPlaylistMgr::EventOpenDefault()
{
iControlMgr->CleanList();
//返回
iBackIndex = KPlaylistBackStateRoot;
AddBackItem();
CDesCArrayFlat* files = CUIViewData::GetInstance()->GetSelectFileList();
for (TInt i=0; i<files->Count(); i++)
{
pListItemStruct back = new (ELeave) ListItemStruct;
back->iIconIndex = 0;
back->iShowName = (*files)[i].AllocL();
back->iType = KPlaylistItemTypeNode;
iControlMgr->AddListItem(back);
}
}