本文整理汇总了C++中CArrayPtrFlat::Count方法的典型用法代码示例。如果您正苦于以下问题:C++ CArrayPtrFlat::Count方法的具体用法?C++ CArrayPtrFlat::Count怎么用?C++ CArrayPtrFlat::Count使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CArrayPtrFlat
的用法示例。
在下文中一共展示了CArrayPtrFlat::Count方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ClearL
void CClearConfig::ClearL(RULogger& loggerSession)
{
loggerSession.Stop();//C.A. previously:loggerSession.StopOutputting();
loggerSession.DeActivateInputPlugin();
CArrayPtrFlat<HBufC8> *allplugins = new (ELeave)CArrayPtrFlat<HBufC8>(1);
loggerSession.GetInstalledOutputPlugins(*allplugins);//C.A. previously:loggerSession.InstalledOutputPlugins(*allplugins);
for(TInt i=0;i<(allplugins->Count());i++)
if(allplugins->Count())
{
TBuf8<50> dataBuf;
dataBuf.Copy(allplugins->At(i)->Des());
loggerSession.RemovePluginConfigurations(dataBuf);
}
CArrayFixFlat<TUint8> *getfilter = new (ELeave)CArrayFixFlat<TUint8>(1);
loggerSession.GetPrimaryFiltersEnabled(*getfilter);//C.A. previously:loggerSession.GetEnabledClassifications(*getfilter);
TInt Result=loggerSession.SetPrimaryFiltersEnabled(*getfilter,EFalse);//C.A. previously:TInt Result=loggerSession.DisableClassifications(*getfilter);
RArray<TUint32> get2filter;
loggerSession.GetSecondaryFiltersEnabled(get2filter);//C.A. previously:loggerSession.GetEnabledModuleUids(get2filter);
loggerSession.SetSecondaryFiltersEnabled(get2filter,EFalse);//C.A. previously:loggerSession.DisableModuleUids(get2filter);
//C.A. previously:loggerSession.EnableClassificationFiltering();
loggerSession.SetSecondaryFilteringEnabled(ETrue);//C.A. previously:loggerSession.EnableModuleUidFiltering();
loggerSession.SetBufferSize(1024);
loggerSession.SetNotificationSize(512);
loggerSession.SetBufferMode(1);//C.A. previously:loggerSession.SetBufferMode(EStraight);
}
示例2: InitializeL
// ---------------------------------------------------------
// CDownloadMgrSession::InitializeL
// ---------------------------------------------------------
//
void CDownloadMgrSession::InitializeL()
{
CLOG_ENTERFN( "CDownloadMgrSession::DownloadMgrAttachCountL" )
iIsMaster = (TBool)CurrentMessage().Int2();
TUid uid;
TPckg<TUid> uidPckg( uid );
Read( 0, uidPckg );
CreateClientAppInstanceL( uidPckg().iUid );
// Check how many download we have and return it to the client
CLOG_WRITE_FORMAT( "CDownloadMgrSession::InitializeL iClientAppInstance %d", iClientAppInstance );
CArrayPtrFlat<CHttpDownload>* currentDownloads = iClientAppInstance->DownloadsL();
TPckg<TInt> countPckg( currentDownloads->Count() );
TPckg<TInt> sessionId( iSessionId );
Write( 1, CurrentMessage(), countPckg );
Write( 3, CurrentMessage(), sessionId );
CLOG_NAME_2( _L("Session_%x_%x"), uidPckg().iUid, iSessionId );
currentDownloads->Reset();
delete currentDownloads;
}
示例3: Connected
// -----------------------------------------------------------------------------
// CHttpConnHandler::Connected
// ?implementation_description
// (other items were commented in a header).
// -----------------------------------------------------------------------------
//
void CHttpConnHandler::Connected()
{
if( iNewConnection )
{
iNewConnection = EFalse;
if( iStatus.Int() == KErrNone )
{
if( !iIapId )
{
UpdateIapId();
}
TRAP_IGNORE( SetConnectionInfoL() );
}
}
__ASSERT_DEBUG( iClientApp, DMPanic( KErrCorrupt ) );
CArrayPtrFlat<CHttpDownload>* downloads =
iClientApp->Downloads();
for( TInt i = 0; i < downloads->Count(); ++i )
{
if( (*downloads)[i]->ConnHandler() == this )
{
iShutDown->Cancel();
(*downloads)[i]->Connected();
}
}
}
示例4: ConstructL
// -----------------------------------------------------------------------------
// CHttpDownloadManagerServerEngine::ConstructL
// Symbian 2nd phase constructor can leave.
// -----------------------------------------------------------------------------
//
void CHttpDownloadManagerServerEngine::ConstructL()
{
CLOG_NAME( _L("Engine") );
LOGGER_ENTERFN( "ConstructL()" );
User::LeaveIfError( iRfs.Connect() );
User::LeaveIfError(iRfs.ShareProtected());
iDocHandler = CDocumentHandler::NewL();
iFeatProgressiveDownload = FeatureManager::FeatureSupported( KFeatureIdBrowserProgressiveDownload );
iProperty = new (ELeave) RProperty;
CLOG_ATTACH( iProperty, this );
iProperty->Attach( KPSUidUikon,KUikMMCInserted );
iMMCNotifier = new (ELeave) CMMCNotifier( iProperty );
CLOG_ATTACH( iMMCNotifier, this );
iMMCNotifier->StartObserving( this );
QueryMMCUniqueId();
QueryDriveListL();
iClientApps = new (ELeave) CArrayPtrFlat<CHttpClientApp>(2);
// make directory for the server
// No problem if it already exists
TInt error = iRfs.MkDirAll( KDmDefaultDir );
if( error != KErrNone && error != KErrAlreadyExists )
// leave if makedir failed in some way
// don't leave if already exists
{
CLOG_WRITE8_1( "MkDirAll: %d", error );
User::Leave( error );
}
LoadClientsL();
// This code generates a unique id for the next download
// client will create. It is always the the highest unique
// id of all downloads + 1.
iNextDownloadId = 1;
for( TInt apps = 0; apps < iClientApps->Count(); ++apps )
{
CArrayPtrFlat<CHttpDownload>* allDownloads = (*iClientApps)[apps]->Downloads();
for( TInt i = 0; i < allDownloads->Count(); ++i )
{
if( iNextDownloadId <= (*allDownloads)[i]->Id() )
{
iNextDownloadId = (*allDownloads)[i]->Id() + 1;
}
}
}
error = iSocketServ.Connect();
User::LeaveIfError(error);
}
示例5: AllDownloadsSizeInDriveL
// -----------------------------------------------------------------------------
// CHttpDownloadManagerServerEngine::AllDownloadsSizeInDriveL
// ?implementation_description
// (other items were commented in a header).
// -----------------------------------------------------------------------------
//
TInt CHttpDownloadManagerServerEngine::AllDownloadsSizeInDriveL(const CHttpDownload *aDownload, TInt aDriveId) const
{
LOGGER_ENTERFN( "AllDownloadsSizeInDriveL" );
TInt allDownloadsSize( 0 );
TInt numClientApps = iClientApps->Count();
for( TInt apps = 0; apps < numClientApps; ++apps )
{
CArrayPtrFlat<CHttpDownload>* dlArray = (*iClientApps)[apps]->Downloads();
TInt numDownloads = dlArray->Count();
for( TInt dl = 0; dl < numDownloads; ++dl )
{
if( ( aDownload != (*dlArray)[dl]) && (*dlArray)[dl]->State() != EHttpDlMultipleMOCompleted
&& aDriveId == (*dlArray)[dl]->GetDestinationDriveID())
{
TInt32 totalSize(0);
TInt32 downloadedSize(0);
(*dlArray)[dl]->GetIntAttributeL(EDlAttrMultipleMOLength, totalSize);
(*dlArray)[dl]->GetIntAttributeL(EDlAttrMultipleMODownloadedSize, downloadedSize);
//Do not conside the downloads with unknown size
if(KDefaultContentLength != totalSize)
allDownloadsSize += (totalSize - downloadedSize);
}
}
}
return allDownloadsSize;
}
示例6:
void CX509CertExtension::ConstructL(const TDesC8& aBinaryData, TInt& aPos)
{
TASN1DecSequence encSeq;
CArrayPtrFlat<TASN1DecGeneric>* seq = encSeq.DecodeDERLC(aBinaryData, aPos, 2, KMaxTInt);
TASN1DecObjectIdentifier encOID;
iId = encOID.DecodeDERL(*(seq->At(0)));
//second is either critical flag, or the ext
TASN1DecGeneric* second = seq->At(1);
if (second->Tag() != EASN1Boolean)
{
iData = second->Encoding().AllocL();
aPos += second->LengthDER();
}
else
{
TASN1DecBoolean encBool;
iCritical = encBool.DecodeDERL(*second);
if (seq->Count() != 3)
{
User::Leave(KErrArgument);
}
TASN1DecGeneric* third = seq->At(2);
iData = third->Encoding().AllocL();
}
CleanupStack::PopAndDestroy();//seq
}
示例7:
void CWapDgrmTestStep::_Parse2L(CArrayPtrFlat<CSmsMessage>& aSmsArray,
CWapReassemblyStore* aWapStore)
/**
* This method tests mainly CWapDatagram::DecodeConcatenatedMessagesL
*/
{
TInt Count = aSmsArray.Count();
// In reverse order
// Note ! You can test additional features by changing value of
// i or a global variable (insertSms). For example:
// incrementing i by 1: a duplicate test
// decrementing i by 1: not all datagrams are pushed to the store
// ncreasing insertSms causes datagrams to be appended to the reserve array
// Remember to set flush the reserve array on a later phase
// by setting iIsFlushReserveArray true
for (TInt i=Count-1;i>=iInsertSms;i--)
{
CWapDatagram* Wap=CWapDatagram::NewL(*(aSmsArray.At(i)));
if (!Wap->IsComplete())
{
TInt Index = 0;
TBool IsComplete = EFalse;
IsComplete = aWapStore->AddMessageL(Index,*Wap);
if (IsComplete)
{
aWapStore->GetDatagramL(Index,*Wap);
aWapStore->BeginTransactionLC();
aWapStore->DeleteEntryL(Index);
aWapStore->CommitTransactionL();
_Print(*Wap);
}
}
else
_Print(*Wap);
delete Wap;
}
// append rest of the datagrams to the ReserveArray
if (iInsertSms>0 && Count>1)
{
// reserve order here too
for (TInt i=iInsertSms-1;i>=0;i--)
{
CWapDatagram* Wap=CWapDatagram::NewL(*(aSmsArray.At(i)));
iReserveArray->AppendL(Wap);
}
}
if (iIsFlushReserveArray)
{
_FlushReserveArrayL(aWapStore);
iInsertSms = 0;
iIsFlushReserveArray = EFalse;
}
}
示例8: DownloadMgrAttachL
// ---------------------------------------------------------
// CDownloadMgrSession::DownloadMgrAttachL
// ---------------------------------------------------------
//
void CDownloadMgrSession::DownloadMgrAttachL()
{
CLOG_ENTERFN( "CDownloadMgrSession::DownloadMgrAttachL" )
// The client would like to attach the dowmloads were created previously.
// Here, we create a buffer with the unique handles of download subsessions
// and copy it to the client's address space.
CLOG_WRITE_FORMAT( "CDownloadMgrSession::DownloadMgrAttachL iClientAppInstance %d", iClientAppInstance );
CArrayPtrFlat<CHttpDownload>* currentDownloads = iClientAppInstance->DownloadsL();
CleanupStack::PushL( currentDownloads );
TPckgBuf<TInt> arrayPckg;
HBufC8* buf = HBufC8::NewLC( currentDownloads->Count() * arrayPckg.Size() );
// Cerate subsessions one by one and write the unique handles to the client.
// Later the handles is used by the client subsession to attach to the server.
for( TInt i = 0; i < currentDownloads->Count(); i++ )
{
CHttpDownload* httpDownload = (*currentDownloads)[i];
// make a new download object
CDownloadSubSession* download = CDownloadSubSession::NewL( this, httpDownload );
CleanupStack::PushL( download );
// add object to object container to gererate unique id
iObjectContainer->AddL( download );
// add object to object index; this returns a unique handle so we can get it again
CLOG_WRITE_FORMAT( "CDownloadMgrSession::DownloadMgrAttachL, download %d", download );
arrayPckg() = iObjectIx->AddL( download );
CLOG_WRITE_FORMAT( "CDownloadMgrSession::DownloadMgrAttachL, iObjectIx->ActiveCount() %d", iObjectIx->ActiveCount() );
// Store handle to the subsession. It is used when the URL is checked.
download->SetHandle( arrayPckg() );
CleanupStack::Pop( download ); //download
buf->Des().Append( arrayPckg );
}
TPtr8 ptr = buf->Des();
Write( 0, CurrentMessage(), ptr );
CleanupStack::PopAndDestroy( buf ); // buf
currentDownloads->Reset();
CleanupStack::PopAndDestroy( currentDownloads ); // currentDownloads
}
示例9: ConnectionError
// -----------------------------------------------------------------------------
// CHttpConnHandler::ConnectionError
// ?implementation_description
// (other items were commented in a header).
// -----------------------------------------------------------------------------
//
void CHttpConnHandler::ConnectionError( TInt aError )
{
__ASSERT_DEBUG( iClientApp, DMPanic( KErrCorrupt ) );
CArrayPtrFlat<CHttpDownload>* downloads =
iClientApp->Downloads();
for( TInt i = 0; i < downloads->Count(); ++i )
{
if( (*downloads)[i]->ConnHandler() == this )
{
(*downloads)[i]->ConnectionFailed( aError );
}
}
}
示例10: DoCancel
// -----------------------------------------------------------------------------
// CHttpConnHandler::DoCancel
// ?implementation_description
// (other items were commented in a header).
// -----------------------------------------------------------------------------
//
void CHttpConnHandler::DoCancel()
{
LOGGER_ENTERFN( "DoCancel" );
CArrayPtrFlat<CHttpDownload>* downloads =
iClientApp->Downloads();
for( TInt i = 0; i < downloads->Count(); ++i )
{
if( (*downloads)[i]->ConnHandler() == this )
{
(*downloads)[i]->ConnectionFailed( KErrCancel );
}
}
}
示例11: seqGen
void CDecPkcs12Attribute::ConstructL(const TDesC8& aBagAttributes)
{
TASN1DecGeneric seqGen(aBagAttributes);
seqGen.InitL();
// Check if this is a Sequence
if (seqGen.Tag() != EASN1Sequence || seqGen.Class() != EUniversal)
{
User::Leave(KErrArgument);
}
TASN1DecSequence seq;
CArrayPtrFlat<TASN1DecGeneric>* attributeSet = seq.DecodeDERLC(seqGen);
const TASN1DecGeneric* attributeSetAt0 = attributeSet->At(0);
if(attributeSetAt0->Tag() != EASN1ObjectIdentifier || attributeSetAt0->Class() != EUniversal)
{
User::Leave(KErrArgument);
}
// Decode the ObjectIdentifier
TASN1DecObjectIdentifier oid;
iAttributeId = oid.DecodeDERL(*attributeSetAt0);
const TASN1DecGeneric* attributeSetAt1 = attributeSet->At(1);
if(attributeSetAt1->Tag() != EASN1Set || attributeSetAt1->Class() != EUniversal)
{
User::Leave(KErrArgument);
}
// Attribute Set
TASN1DecSet decSet;
CArrayPtrFlat<TASN1DecGeneric>* attributeValues = decSet.NewDERLC(attributeSetAt1->Encoding());
TInt attributeCount = attributeValues->Count();
for(TInt index = 0; index < attributeCount; ++index)
{
const TASN1DecGeneric* attributeValuesAt = attributeValues->At(index);
TASN1DecGeneric seqGen(*attributeValuesAt);
seqGen.InitL();
TPtrC8 attrValue = seqGen.Encoding();
TDesC8* attributeVal = attrValue.AllocL();
CleanupStack::PushL(attributeVal);
iAttributeValue.AppendL(attributeVal);
CleanupStack::Pop(attributeVal);
}
CleanupStack::PopAndDestroy(2,attributeSet); // attributeSet,attributeValues
}
示例12: ShutDown
// -----------------------------------------------------------------------------
// CHttpConnHandler::ShutDown
//
// Connection notification is not canceled here, because need to know
// when the connection is really closed. Forget the connection name, set by
// the client app only if the connection is really closed.
// -----------------------------------------------------------------------------
//
void CHttpConnHandler::ShutDown( TBool aFromDestructor )
{
CLOG_WRITE( "ShutDown" );
CLOG_WRITE8_1( "dest: %d", aFromDestructor );
iNewConnection = EFalse;
if( iShutDown )
{
iShutDown->Cancel();
}
if( iConnNotif )
{
iConnNotif->Cancel();
}
Cancel();
CLOG_WRITE( "Canceled" );
iConnStage = KConnectionUninitialised;
CLOG_WRITE( "Closing connection" );
iConnection.Close();
CLOG_WRITE( "Conn closed" );
// Pause the downloads
CArrayPtrFlat<CHttpDownload>* downloads =
iClientApp->Downloads();
for( TInt i = 0; i < downloads->Count(); ++i )
{
if( (*downloads)[i]->ConnHandler() == this )
{
TRAP_IGNORE( (*downloads)[i]->PauseL( ETrue ) );
}
}
if( !iClientInst && !aFromDestructor )
// Client instance already exited and all download disconnected ->
// no need for this connhandler anymore.
// the next client will create a new connhandler and assigned downloads
// will use that one.
{
CLOG_WRITE( "Destroy me" );
// DO NOT USE 'this' after this call!!!
iClientApp->DestroyConnHandler( this );
}
}
示例13: ConnectionStageChanged
// -----------------------------------------------------------------------------
// CHttpConnHandler::ConnectionStageChanged
// ?implementation_description
// (other items were commented in a header).
// -----------------------------------------------------------------------------
//
void CHttpConnHandler::ConnectionStageChanged( TInt aStage )
{
CLOG_WRITE8_1( "Stage: %d", aStage );
iConnStage = aStage;
if( iConnStage == KConnectionUninitialised ||
iConnStage == KDataTransferTemporarilyBlocked
)
{
__ASSERT_DEBUG( iClientApp, DMPanic( KErrCorrupt ) );
CArrayPtrFlat<CHttpDownload>* downloads =
iClientApp->Downloads();
for( TInt i = 0; i < downloads->Count(); ++i )
{
if( (*downloads)[i]->ConnHandler() == this )
{
if( iConnStage == KConnectionUninitialised )
{
// from now on this name is invalid -> forget it!
delete iConnName; iConnName = NULL;
(*downloads)[i]->Disconnected();
}
else
{
(*downloads)[i]->Suspended();
}
}
}
if( iConnStage == KConnectionUninitialised )
{
ShutDown();
}
if ( iConnStage == KDataTransferTemporarilyBlocked )
{
iShutDown->Start( KShutDownTimer );
}
}
else if( iConnStage == KLinkLayerOpen )
// connection open
{
Connected();
}
}
示例14: return
// -----------------------------------------------------------------------------
// CHttpDownloadManagerServerEngine::FindDownload
// ?implementation_description
// (other items were commented in a header).
// -----------------------------------------------------------------------------
//
CHttpDownload*
CHttpDownloadManagerServerEngine::FindDownload( TInt32 aDownloadId )
{
for( TInt apps = 0; apps < iClientApps->Count(); ++apps )
{
CArrayPtrFlat<CHttpDownload>* allDownloads = (*iClientApps)[apps]->Downloads();
for( TInt i = 0; i < allDownloads->Count(); ++i )
{
if( (*allDownloads)[i]->Id() == aDownloadId )
{
return (*allDownloads)[i];
}
}
}
return NULL;
}
示例15: Referencies
// -----------------------------------------------------------------------------
// CHttpConnHandler::Referencies
// ?implementation_description
// (other items were commented in a header).
// -----------------------------------------------------------------------------
//
TInt CHttpConnHandler::Referencies()
{
TInt refs( 0 );
__ASSERT_DEBUG( iClientApp, DMPanic( KErrCorrupt ) );
CArrayPtrFlat<CHttpDownload>* downloads =
iClientApp->Downloads();
for( TInt i = 0; i < downloads->Count(); ++i )
{
if( (*downloads)[i]->ConnHandler() == this )
{
++refs;
}
}
return refs;
}