本文整理汇总了C++中CArrayFixFlat::Count方法的典型用法代码示例。如果您正苦于以下问题:C++ CArrayFixFlat::Count方法的具体用法?C++ CArrayFixFlat::Count怎么用?C++ CArrayFixFlat::Count使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CArrayFixFlat
的用法示例。
在下文中一共展示了CArrayFixFlat::Count方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: PolicyCertificateStatusL
TCertStatus CPolicyStore::PolicyCertificateStatusL(CIkeData* aIkeData) const
{
LOG(Log::Printf(_L("-> CPolicyStore::PolicyCertificateStatusL()")));
TCertStatus status = ECertValid;
CArrayFixFlat<TCertInfo*> *cAList = aIkeData->iCAList;
if ((cAList == NULL || cAList->Count() == 0) &&
!aIkeData->iOwnCert.iOwnCertExists)
{
status = ECertNotNeeded;
}
else
{
RPKIServiceAPI pkiService;
User::LeaveIfError(pkiService.Connect());
CleanupClosePushL(pkiService);
pkiService.SetInformational(ETrue);
CDesC8ArrayFlat* caSubjectNameArray = new (ELeave) CDesC8ArrayFlat(2);
CleanupStack::PushL(caSubjectNameArray);
if (cAList != NULL && cAList->Count() > 0)
{
status = PkiUtil::GetValidCaCertSubjectNameListL(pkiService, *cAList,
*caSubjectNameArray);
}
if (status == ECertValid)
{
// Set store type to device store,
// if Own_cert_type is defined as "DEVICE"
if ( aIkeData->iClientCertType != NULL )
{
TPtrC16 certStoreType = aIkeData->iClientCertType->GetData();
if ( certStoreType.CompareF(_L("DEVICE")) == 0 )
{
LOG(Log::Printf(_L("Set store type to STORETYPE_DEVICE")));
pkiService.SetStoreType(EPkiStoreTypeDevice);
}
else
{
LOG(Log::Printf(_L("Set store type to STORETYPE_USER")));
pkiService.SetStoreType(EPkiStoreTypeUser);
}
}
else
{
LOG(Log::Printf(_L("Set store type to STORETYPE_USER")));
pkiService.SetStoreType(EPkiStoreTypeUser);
}
status = PkiUtil::CheckUserCertValidityL(pkiService, *caSubjectNameArray,
aIkeData->iOwnCert);
}
CleanupStack::PopAndDestroy(caSubjectNameArray);
CleanupStack::PopAndDestroy(); //pkiService
}
LOG(Log::Printf(_L("<- CPolicyStore::PolicyCertificateStatusL()")));
return status;
}
示例2: MdcaCount
TInt CContextMediaArrayImpl::MdcaCount() const
{
CALLSTACKITEM_N(_CL("CContextMediaArrayImpl"), _CL("MdcaCount"));
if (iItem == ENone) {
return iPostArray->Count();
} else {
return iPostArray->Count()+1;
}
}
示例3: CompareArrays
//#pragma warning( disable : 4701 ) //local variable 'docPosError' may be used without having been initialized
TBool CLinePaginatorTest::CompareArrays()
{
TInt numPages=iCharsPerPage->Count();
TInt numTestPages=iTestChars->Count();
TInt numChars;
TInt numTestChars;
TBool pagesSame=EFalse;
TBuf8<128> text;
TInt prevDocPos=0;
TInt docPosError=0;
TBuf<256> buf;
if (numPages==numTestPages)
{
buf.AppendFormat(_L("Correct Number of Pages = %d\n"), numPages);
TESTPRINT(buf);
pagesSame=ETrue;
for (TInt i=0; i<numPages; i++)
{
numChars=(*iCharsPerPage)[i];
numTestChars=(*iTestChars)[i]-prevDocPos;
if(numChars!=numTestChars)
{
if (pagesSame)
docPosError=(*iTestChars)[i];
pagesSame=EFalse;
}
prevDocPos=(*iTestChars)[i];
}
if (pagesSame)
{
TESTPRINT(_L("Correct Number of Characters on Pages -- PASSED\n"));
}
else
{
TESTPRINT(_L("Incorrect Number of Characters on Pages -- FAILED\n"));
buf.Zero();
buf.AppendFormat(_L("First Error Occurs at Position = %d"), docPosError);
TESTPRINT(buf);
}
}
else
{
TESTPRINT(_L("Incorrect Number of Pages -- FAILED\n"));
buf.Zero();
buf.AppendFormat(_L("Number Calculated by LinePaginator = %d\n"), numPages);
buf.AppendFormat(_L("Number Contained in File = %d\n"), numTestPages);
TESTPRINT(buf);
}
iTestFile.Close();
return pagesSame;
}
示例4: TestLanguageL
void CBCTestPtiEngine::TestLanguageL()
{
CArrayFixFlat<TInt>* langs = new (ELeave) CArrayFixFlat<TInt>(100);
CleanupStack::PushL(langs);
iEngine->GetAvailableLanguagesL(langs);
AssertTrueL(langs->Count()>0, _L("available languages got"));
CleanupStack::PopAndDestroy( 1 ); // cores, langs
RArray<TInt> langRefs;
iEngine->GetAvailableLanguagesL(langRefs);
AssertTrueL(langRefs.Count()>0, _L("available languages got into RArray"));
//
//activate
//
if(langRefs.Count())
{
MPtiLanguage *lan = iEngine->GetLanguage(langRefs[0]);
if (lan->HasInputMode(EPtiEngineMultitapping))
{
iEngine->ActivateLanguageL(lan->LanguageCode(), EPtiEngineMultitapping);
AssertTrueL( ETrue, _L("activate multitapping"));
}
else
{
iEngine->ActivateLanguageL(lan->LanguageCode(), EPtiEnginePredictive);
AssertTrueL( ETrue, _L("activate predictive"));
}
}
langRefs.Close();
}
示例5: if
TUint32 CIkev2NatT::CheckPeerNotifysL(const CArrayFixFlat<TNotifPayloadIkev2*>& aNotifys,
const TInetAddr& aLocalAddr, const TInetAddr& aRemoteAddr, TUint16 aPort,
const TDesC8& aInitiatorSpi, const TDesC8& aResponderSpi, TBool& aSupported)
{
//
// Check does there exists NAT_DETECTION_SOURCE_IP and NAT_DETECTION_DESTINATION_IP
// Notify payload. If found compare payload data to local end NAT
// traversal data as follows:
// -- NAT_DETECTION_SOURCE_IP Notifys are examined against local Notify
// payload iDstIdentiy data: If no match found
// ==> Peer is behind NAT
// -- NAT_DETECTION_DESTINATION_IP Notify is examined against local Notify
// payload iSrcIdentiy data: If no match found
// ==> Local end behind NAT
//
aSupported = EFalse;
TInt Count = aNotifys.Count();
CIkev2NatT* RefObj = CIkev2NatT::NewL(aLocalAddr, aRemoteAddr, aPort,
aInitiatorSpi, aResponderSpi);
TNotifPayloadIkev2* PeerNotify;
TUint32 PeerLth;
TBool SrcMatch = EFalse;
TBool DstMatch = EFalse;
TUint32 NatFlags = 0;
TInt i = 0;
while ( i < Count )
{
PeerNotify = aNotifys.At(i);
if ( (PeerNotify->GetMsgType() == NAT_DETECTION_SOURCE_IP) && !SrcMatch )
{
NatFlags |= REMOTE_END_NAT;
PeerLth = TPayloadIkev2::Cast(PeerNotify)->GetLength() - (TUint32)(PeerNotify->Size() + PeerNotify->GetSPISize());
const TPtrC8 peerNotify(PeerNotify->NotifData(), PeerLth);
if ( RefObj->DestinNofify().Compare(peerNotify) == 0)
{
SrcMatch = ETrue;
NatFlags &= ~REMOTE_END_NAT;
}
}
else if ( (PeerNotify->GetMsgType() == NAT_DETECTION_DESTINATION_IP) && !DstMatch )
{
aSupported = ETrue;
NatFlags |= LOCAL_END_NAT;
PeerLth = TPayloadIkev2::Cast(PeerNotify)->GetLength() - (TUint32)(PeerNotify->Size() + PeerNotify->GetSPISize());
const TPtrC8 peerNotify(PeerNotify->NotifData(), PeerLth);
if ( RefObj->SourceNofify().Compare(peerNotify) == 0 )
{
DstMatch = ETrue;
NatFlags &= ~LOCAL_END_NAT;
}
}
i ++;
}
delete RefObj;
return NatFlags;
}
示例6: new
/**
@SYMTestCaseID T-RApaLsSessionTestStep-TestServiceDiscovery5L
@SYMPREQ 538
@SYMTestCaseDesc Test the functionality of GetAppServicesL which gets all the service uids of a particular app
@SYMTestPriority
@SYMTestStatus Implemented
@SYMTestActions Call GetAppServicesL with two parameters: the app uid and an array to put in the uid of the services
on z: drive.\n
API Calls:\n
RApaLsSession::GetAppServicesL(TUid aAppUid, CArrayFixFlat<TUid>& aServiceUids) const
@SYMTestExpectedResults Populates the array with the uids of the services offered by this particular app.
The returned data should be the same as that defined in the registration files.
*/
void CT_ServicesTestStep::TestServiceDiscovery5L()
{
INFO_PRINTF1(_L("TestServiceDiscovery5 about to start..."));
const TUid KUidServerApp = {0x10004c56};
const TUid KUidService1234 = {0x01020304};
const TUid KUidService2345 = {0x02030405};
const TUid KUidService5678 = {0x05060708};
const TUid KUidService = {0x01020333};
// get UIDs of all services implemented by an app
CArrayFixFlat<TUid>* uidArray = new(ELeave) CArrayFixFlat<TUid>(4);
CleanupStack::PushL(uidArray);
iApaLsSession.GetAppServicesL(KUidServerApp,*uidArray);
TInt count = uidArray->Count();
TUid uid;
if(count>0)
{
TEST(count==6); // Takes into account the open service
uid = (*uidArray)[0];
TEST(uid==KUidService);
uid = (*uidArray)[1];
TEST(uid==KUidService5678);
uid = (*uidArray)[2];
TEST(uid==KUidService5678);
uid = (*uidArray)[3];
TEST(uid==KUidService2345);
uid = (*uidArray)[4];
TEST(uid==KUidService1234);
}
CleanupStack::PopAndDestroy(uidArray);
uidArray = NULL;
}
示例7: new
CGulIcon* CTap2MenuAppUi::LoadAppIconHard(TUid aUid)
{
RApaLsSession ls;
ls.Connect();
CGulIcon *retval = NULL;
CArrayFixFlat<TSize> *array = new CArrayFixFlat<TSize>(3);
CleanupStack::PushL(array);
TInt err = ls.GetAppIconSizes(aUid, *array);
if(err == KErrNone && array->Count() > 0)
{
CApaMaskedBitmap *bitmap = CApaMaskedBitmap::NewLC();
err = ls.GetAppIcon(aUid, (*array)[0], *bitmap);
if(err == KErrNone)
{
CFbsBitmap* bmp = new (ELeave) CFbsBitmap();
CleanupStack::PushL(bmp);
CFbsBitmap* bmp_mask = new (ELeave) CFbsBitmap();
CleanupStack::PushL(bmp_mask);
User::LeaveIfError(bmp->Create(bitmap->SizeInPixels(), bitmap->DisplayMode()));
User::LeaveIfError(bmp_mask->Create(bitmap->Mask()->SizeInPixels(), bitmap->Mask()->DisplayMode()));
CopyBitmapL(bitmap, bmp);
CopyBitmapL(bitmap->Mask(), bmp_mask);
retval = CGulIcon::NewL(bmp, bmp_mask);
CleanupStack::Pop(2); // bmp, bmp_mask
}
CleanupStack::PopAndDestroy(bitmap);
}
CleanupStack::PopAndDestroy(array);
ls.Close();
return retval;
}
示例8: FixupL
/**
This method should only be used by CImapAtomParser.
During parsing, a ReAllocL() may be required on the heap buffer that this atom and its
descendants' string data descriptor points at.
This happens when the heap buffer needs to be expanded.
If this causes the heap buffer's address to change, then this atom and its descendants'
pointer descriptors need updating.
@param The address of the new heap buffer
@param The address of the data within the heap buffer before the ReAllocL took place.
*/
void CImapAtom::FixupL(const HBufC8 *aNewBuffer, const TText8 *aOldBuffer)
{
// Fixup descriptor pointers
CArrayFixFlat<CImapAtom*>* atomStack = new (ELeave) CArrayFixFlat<CImapAtom*>(10);
CleanupStack::PushL(atomStack);
atomStack->AppendL(this);
CImapAtom* currentAtom;
while (atomStack->Count() != 0)
{
// Pop the top atom off of the stack
currentAtom = (*atomStack)[atomStack->Count() - 1];
atomStack->ResizeL(atomStack->Count() - 1);
// Fix up the current atom
if (currentAtom->iAtom.Length()>0)
{
// Find offset from start of old buffer
TInt start=(currentAtom->iAtom.Ptr()-aOldBuffer);
// Make new descriptor & assign it
TPtrC8 bufptr(aNewBuffer->Ptr()+start,currentAtom->iAtom.Length());
currentAtom->iAtom.Set(bufptr); // Note that we are setting the real iAtom not the copy returned by Atom()
}
// Add the first sibling to the stack,
// subsequent siblings are added when this sibling is visited
CImapAtom* siblingAtom = currentAtom->Next();
if (siblingAtom)
{
atomStack->AppendL(siblingAtom);
}
// Add child to the stack
CImapAtom* childAtom = currentAtom->Child();
if (childAtom)
{
atomStack->AppendL(childAtom);
}
}
CleanupStack::PopAndDestroy(atomStack);
}
示例9: ReleasePosts
void CContextMediaArrayImpl::ReleasePosts()
{
if (iPostArray) {
int i;
for (i=0;i<iPostArray->Count();i++) {
CCMPost * aPost = (*iPostArray)[i];
if (aPost) {
CC_TRAPD(err, iStorage.Release( aPost, 0 ));
}
}
}
}
示例10: CloseArrayOfCallObjects
LOCAL_C void CloseArrayOfCallObjects(TAny* aCallArray)
/**
Close and delete the call object array.
*/
{
CArrayFixFlat<RMobileCall>* callArray = reinterpret_cast<CArrayFixFlat<RMobileCall>*>(aCallArray);
TInt count = callArray->Count();
for (TInt i=count-1; i>=0; --i)
{
callArray->At(i).Close();
}
delete callArray;
callArray = NULL;
}
示例11: PostEvent
void CContextMediaArrayImpl::PostEvent(CCMPost* aParent, CCMPost* aChild, TEvent aEvent)
{
CALLSTACKITEM_N(_CL("CContextMediaArrayImpl"), _CL("PostEvent"));
if (aParent != iParentPost) return;
if (aEvent==EChildAdded) {
iPostIdArray->AppendL(aChild->iPostId());
iPostArray->AppendL(0);
iObserver.PostEvent(aParent, aChild, aEvent);
}
if (aEvent==EPlaceholderFilled) {
TInt i;
for (i=0; i<iPostIdArray->Count();i++) {
if (iPostIdArray->At(i) == aChild->iPostId()) {
CC_TRAPD(ignore, iStorage.Release(iPostArray->At(i), 0));
iPostArray->At(i) = 0;
iObserver.PostEvent(aParent, aChild, aEvent);
return;
}
}
}
if (aEvent==EPostHidden) {
ReadFromStorage();
iObserver.PostEvent(aParent, aChild, aEvent);
}
if (aEvent==EPostVisible) {
ReadFromStorage();
iObserver.PostEvent(aParent, aChild, aEvent);
}
if (aEvent==EPostUpdated) {
iObserver.PostEvent(aParent, aChild, aEvent);
}
if ((aEvent==EThumbnailLoaded) || (aEvent==EUnreadChanged)) {
iObserver.PostEvent(aParent, aChild, aEvent);
}
if (aEvent==ELastPostChanged) {
iObserver.PostEvent(aParent, aChild, aEvent);
}
//do nothing for:
// EMediaLoaded,
// EErrorUpdated,
}
示例12:
LOCAL_C TBool operator==(const CArrayFixFlat<TTaskSchedulerCondition>& aConditions1, const CArrayFixFlat<TTaskSchedulerCondition>& aConditions2)
{
TInt count1 = aConditions1.Count();
TInt count2 = aConditions2.Count();
// Compare the conditions.
if( count1 != count2 )
{
// Different number of conditions - no match.
return EFalse;
}
// Search for all the conditions in info1 are in info2
for( TInt ii = 0; ii < count1; ++ii )
{
TTaskSchedulerCondition condition1 = aConditions1[ii];
TTaskSchedulerCondition condition2;
TBool found = EFalse;
TInt jj = 0;
while( !found && jj < count2 )
{
condition2 = aConditions2[jj];
if( condition2.iKey == condition1.iKey )
found = ETrue;
else
++jj;
}
if( !found || condition2.iState != condition1.iState || condition2.iType != condition1.iType )
{
// Either aConditions2 has not got this condition or it has but it
// does not match - no match.
return EFalse;
}
}
return ETrue;
}
示例13: changeLanguage
/*!
\brief Returns names and identifiers of supported languages in a phone.
Language names are localized according the language's native presentation.
Language ID's returned by this functions may be used as language parameter for changeLanguage(int language) function.
Language IDs and names are OS specific and may vary across the platforms and releases.
\attention Symbian specific API
\deprecated HbLanguageUtil::supportedLanguages()
is deprecated. Please use HbLocaleUtil::supportedLanguages() instead.
\return Symbian - localized names and integer identifiers of languages supported in a device
\return other platforms - empty QHash
*/
QHash<int, QString> HbLanguageUtil::supportedLanguages()
{
#if defined(Q_OS_SYMBIAN)
QHash<int, QString> languages;
QTranslator translator;
QString path = "c:";
path += QString(TRANSLATOR_PATH);
if (!translator.load(path)) {
path = "z:";
path += QString(TRANSLATOR_PATH);
if (!translator.load(path)) {
return languages;
}
}
QCoreApplication::installTranslator(&translator);
QHash<int, QString> hashLanguageNames = readLanguageList();
CArrayFixFlat<TInt>* systemEpocLanguageCodes = 0;
TInt error = SysLangUtil::GetInstalledLanguages( systemEpocLanguageCodes );
if ( error != KErrNone ) {
delete systemEpocLanguageCodes;
return languages;
}
for (int i = 0; i < systemEpocLanguageCodes->Count(); ++i) {
int code = systemEpocLanguageCodes->At(i);
QString id = QString(LANGUAGE_ID_PREFIX);
id += QString::number(code);
QString locName = hbTrId(id.toAscii().constData());
if (locName.isEmpty() || locName == id) {
locName = hashLanguageNames.value(code);
}
languages.insert(code, locName);
}
delete systemEpocLanguageCodes;
return languages;
#else
QHash<int, QString> dummy;
return dummy;
#endif
}
示例14: FindScheduleL
/**
Searches the scheduler for an existing conditions schedule item with a set of
pending conditions and timeout value that matches with those supplied.
@see RScheduler::GetScheduleL
@param aScheduler
Handle to the scheduler.
@param aConditions
The set of System Agent conditions that are required to be met to trigger the
schedule.
@param aTimeout
The timeout value for the schedule.
@param aRef
On return, the schedule item.
@leave KErrNotFound
No schedule found matching the schedule conditions and timeout.
*/
EXPORT_C void CMsvScheduleSend::FindScheduleL(
RScheduler& aScheduler,
const CArrayFixFlat<TTaskSchedulerCondition>& aConditions,
const TTime& aTimeout,
TSchedulerItemRef& aRef)
{
CArrayFixFlat<TTaskSchedulerCondition>* schConditions = new (ELeave) CArrayFixFlat<TTaskSchedulerCondition>(KMsvSchsendArrayGrowth);
CleanupStack::PushL(schConditions);
CArrayFixFlat<TTaskInfo>* taskInfos = new (ELeave) CArrayFixFlat<TTaskInfo>(1);
CleanupStack::PushL(taskInfos);
aRef.iHandle = KErrNotFound;
CArrayFixFlat<TSchedulerItemRef>* refs = new (ELeave) CArrayFixFlat<TSchedulerItemRef>(KMsvSchsendArrayGrowth);
CleanupStack::PushL(refs);
User::LeaveIfError(aScheduler.GetTaskRefsL(*refs, EAllSchedules, EMyTasks));
TInt count = refs->Count();
TScheduleState2 state;
TTsTime nextTimeout;
while( count-- && aRef.iHandle == KErrNotFound )
{
const TSchedulerItemRef& tempRef = (*refs)[count];
TScheduleType type;
User::LeaveIfError(aScheduler.GetScheduleTypeL(tempRef.iHandle, type));
if( type == EConditionSchedule )
{
taskInfos->Reset();
const TInt err = aScheduler.GetScheduleL(tempRef.iHandle, state, *schConditions, nextTimeout, *taskInfos);
if( err == KErrNone && nextTimeout.GetUtcTime() == aTimeout && *schConditions == aConditions )
aRef = tempRef;
}
}
CleanupStack::PopAndDestroy(3, schConditions);
if (aRef.iHandle == KErrNotFound)
User::Leave(KErrNotFound);
}
示例15: WrapTitleTextL
// ---------------------------------------------------------------------------
// CAknDiscreetPopupDrawer::WrapTitleTextL
// Wraps long text to two lines.
// ---------------------------------------------------------------------------
//
void CAknDiscreetPopupDrawer::WrapTitleTextL()
{
CArrayFixFlat<TInt>* lineWidths
= new ( ELeave ) CArrayFixFlat<TInt>( KMaxNumOfLines );
CleanupStack::PushL( lineWidths );
CArrayFixFlat<TPtrC>* wrappedArray
= new ( ELeave ) CArrayFixFlat<TPtrC>( KMaxNumOfLines );
CleanupStack::PushL( wrappedArray );
for ( TInt i = 0; i < KMaxNumOfLines; i++ )
{
lineWidths->AppendL( iTitleTextData.iTextRect.Width() );
}
HBufC* visualBuffer = HBufC::NewLC(
iTitleText->Length() + KMaxNumOfLines * KAknBidiExtraSpacePerLine );
*visualBuffer = *iTitleText;
TPtr ptr( visualBuffer->Des() );
AknBidiTextUtils::ConvertToVisualAndWrapToArrayL(
ptr, *lineWidths, *iTitleTextData.iTextFont, *wrappedArray, ETrue );
if ( wrappedArray->Count() && wrappedArray->At( 1 ) != KNullDesC )
{
delete iTitleText;
iTitleText = NULL;
delete iBodyText;
iBodyText = NULL;
iTitleText = wrappedArray->At( 0 ).AllocL();
iBodyText = wrappedArray->At( 1 ).AllocL();
}
CleanupStack::PopAndDestroy( visualBuffer );
CleanupStack::PopAndDestroy( wrappedArray );
CleanupStack::PopAndDestroy( lineWidths );
}