本文整理汇总了C++中CDesCArrayFlat::Count方法的典型用法代码示例。如果您正苦于以下问题:C++ CDesCArrayFlat::Count方法的具体用法?C++ CDesCArrayFlat::Count怎么用?C++ CDesCArrayFlat::Count使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CDesCArrayFlat
的用法示例。
在下文中一共展示了CDesCArrayFlat::Count方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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);
}
示例2: EventOpenDefault
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);
}
}
示例3: EventOpenFavorite
void CPlaylistMgr::EventOpenFavorite()
{
iControlMgr->CleanList();
//返回
iBackIndex = KPlaylistBackStateRoot;
AddBackItem();
CDesCArrayFlat* files = iDataMgr->GetPlaylistFiles();
for (TInt i=0; i<files->Count(); i++)
{
pListItemStruct back = new (ELeave) ListItemStruct;
back->iIconIndex = 0;
back->iHideInfo = (*files)[i].AllocL();
back->iShowName = (*files)[i].AllocL();
back->iType = KPlaylistItemTypePlaylist;
iControlMgr->AddListItem(back);
}
}
示例4: PopulateCategoryListL
//
// NEW
//
void CHlpView::PopulateCategoryListL()
{
// First get a category listing, then get the list of topics
// for each specified category.
// Get and print the category listing
CDesCArrayFlat* array = new(ELeave) CDesCArrayFlat(5);
CleanupStack::PushL(array);
iHelpModel.CategoryListL(array);
if (!array->Count())
User::Leave(KErrArgument); // ??
iHelpCategories->SetArrayExternalOwnership(EFalse);
iHelpCategories->SetArrayL(array);
iHelpCategories->SetArrayExternalOwnership(EFalse);
iHelpCategories->SetCurrentItem(0);
PopulateTopicListL(iHelpCategories->Array()->MdcaPoint(iHelpCategories->CurrentItem()));
CleanupStack::Pop();
}
示例5: HandleEventL
// ----------------------------------------------------------------------------
// CSCPHistoryPlugin::HandleEvent
//
//
// Status : Approved
// ----------------------------------------------------------------------------
//
void CSCPHistoryPlugin :: HandleEventL( TInt aID, CSCPParamObject& aParam, CSCPParamObject& aOutParam)
{
Dprint ( ( _L( "CSCPHistoryPlugin::HandleEvent()" ) ) );
if ( iFs == NULL )
{
return ; // Eventhandler not available
}
// check for Case
switch ( aID )
{
case ( KSCPEventValidate ) :
{
// Obtain the paramValue
Dprint ( ( _L( "CSCPHistoryPlugin::KSCPEventValidate" ) ) );
TInt passhistoryParamValue;
passhistoryParamValue = GetHistoryCountParamValue();
Dprint ( ( _L( "CSCPHistoryPlugin::HandleEvent passhistoryParamValue = %d" ), passhistoryParamValue ) );
// if all required bounds are zero, there is nothing to do.
if ( passhistoryParamValue != 0)
{
// Get the configFile's path.
// If this fails, there is something badly wrong(Private folder is not there)
TInt errSCF = SetConfigFile ();
if (errSCF != KErrNone)
{
break; // Break out from Case
}
// Get the historyItemCount, If the err is raised, the file is not there
// This will lead to KSCPEventPasswordChanged event and new history file will
// be created
TInt historyItemCounter;
TInt errHC = GetHistoryItemCount( historyItemCounter );
Dprint ( ( _L( "CSCPHistoryPlugin::HandleEvent historyItemCounter = %d" ), historyItemCounter ) );
if (errHC != KErrNone)
{
break; // Break out from Case
}
// continue with the KSCPEventValidate Check
// Get the password from the paramObject
TBuf<KSCPPasscodeMaxLength> seccode;
if ( aParam.Get( KSCPParamPassword, seccode ) != KErrNone )
{
// Nothing to do anymore
Dprint( (_L("CSCPHistoryPlugin::HandleEvent()\
ERROR: KSCPEventValidate/KSCPParamPassword is != KErrNone") ));
break; // Break out from Case
}
// Hash the securitycode
TBuf<KSCPPasscodeMaxLength> securityhash;
iEventHandler->HashInput(seccode,securityhash);
// get history
CDesCArrayFlat* array = NULL;
TInt errGH = KErrNone;
array = new CDesCArrayFlat(1);
if ( array != NULL )
{
TRAPD( err2, errGH = GetHistoryArrayL( *array ) );
if ( err2 != KErrNone )
{
errGH = err2;
}
}
else
{
errGH = KErrNoMemory;
}
// If for some reason err is raised, break out
// If the Historyonfig file get deleted on the fly ex
if (errGH != KErrNone)
{
array->Reset();
delete array;
break; // Break out from Case
}
TInt correction;
correction = 0;
if ( array->Count() >= passhistoryParamValue )
{
correction = array->Count() - passhistoryParamValue;
}
// check for match
TBuf<KSCPPasscodeMaxLength> arrayItem;
//.........这里部分代码省略.........
示例6: ShowTypedQueryL
// -----------------------------------------------------------------------------
// ShowTypedQueryL
// Shows list query and returns the user selection.
// -----------------------------------------------------------------------------
//
TUid CSendUiImpl::ShowTypedQueryL(
CSendUi::TSendUiMenuType aMenuType,
const CMessageData* aMessageData,
TSendingCapabilities aRequiredCapabilities,
CArrayFix<TUid>* aServicesToDim,
const TDesC& aTitleText )
{
// Implemented for CR # 401-1806 >>
// This section to enable/disable features (supported by feature manager) at run time, is to be revised,
// once an observer class is available from feature manager side to intimate about feature state
CRepository* repository = CRepository::NewLC( KCRUidSendUi );
TInt oldFeatures(0);
TInt newFeatures(0);
TBool updateNeeded( EFalse );
if ( repository->Get( KKeySendUiFeatureManagerServices, oldFeatures ) != KErrNone )
{
updateNeeded = ETrue;
}
FeatureManager::InitializeLibL();
FeatureStatus( KFeatureIdMmsPostcard, newFeatures, KSendUiPostcard );
FeatureStatus( KFeatureIdAudioMessaging, newFeatures, KSendUiAudioMessage );
FeatureStatus( KFeatureIdSenduiMmsUpload, newFeatures, KSendUiMmsUpload );
FeatureManager::UnInitializeLib();
if ( newFeatures != oldFeatures )
{
repository->Set( KKeySendUiFeatureManagerServices, newFeatures );
updateNeeded = ETrue;
}
CleanupStack::PopAndDestroy( repository );
RProperty propertyUpdateOperation;
TRequestStatus status;
if ( updateNeeded )
{
RProperty::Set(
KPSUidSendUiProperty,
KSendUiUpdateRequest,
KSendUiUpdateRequested );
User::LeaveIfError( propertyUpdateOperation.Attach( KPSUidSendUiProperty, KSendUiUpdateRequest ));
propertyUpdateOperation.Subscribe( status );
User::WaitForRequest(status);
TInt value = KErrNone;
if(propertyUpdateOperation.Get( value ) !=KErrNotFound && value == KSendUiUpdated )
{
TRAPD( err, GetServicesL() );
if ( err )
{
#ifdef _DEBUG
TBuf<256> buf;
buf.Format(_L("SendUi err"));
User::InfoPrint(buf);
#endif
TUid serviceId( KNullUid );
return serviceId;
}
}
propertyUpdateOperation.Close();
}
// Implemented for CR # 401-1806 <<
// List items for list query.
CDesCArrayFlat* listItems = new (ELeave) CDesCArrayFlat( KArrayGranularity );
CleanupStack::PushL( listItems);
// This array is used to map user selection to correct service.
CArrayFix<TUid>* listItemUids =
new ( ELeave ) CArrayFixFlat<TUid>( KArrayGranularity );
CleanupStack::PushL( listItemUids );
iServicesToDim->Reset();
TInt i = 0;
if ( aServicesToDim )
{
for ( i = 0; i < aServicesToDim->Count(); i++ )
{
iServicesToDim->AppendL( (*aServicesToDim)[i] );
}
}
// Get and filter ECom based services.
FilterServicesL(
*listItems,
*listItemUids,
aRequiredCapabilities,
aMessageData,
aMenuType );
TUid serviceId( KNullUid );
if ( listItems->Count() > 0 )
{
// Show list query.
SortListL( *listItems, *listItemUids );
//.........这里部分代码省略.........