本文整理汇总了C++中CArrayPtr::At方法的典型用法代码示例。如果您正苦于以下问题:C++ CArrayPtr::At方法的具体用法?C++ CArrayPtr::At怎么用?C++ CArrayPtr::At使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CArrayPtr
的用法示例。
在下文中一共展示了CArrayPtr::At方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DecodeL
// -----------------------------------------------------------------------------
// 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 );
}
示例2: DecodeBasicOCSPResponseL
void COCSPResponseDecoder::DecodeBasicOCSPResponseL(const TDesC8& aEncoding)
{
CArrayPtr<TASN1DecGeneric>* items = DecodeSequenceLC(aEncoding, 3, 4);
// First, the ResponseData object
DecodeResponseDataL(items->At(0)->Encoding());
// Continue, with the AlgorithmIdentifier
iResponse->iSigningAlgorithm = CX509SigningAlgorithmIdentifier::NewL(items->At(1)->Encoding());
// Now move on to the signature
TASN1DecBitString encBS;
iResponse->iSignature = encBS.ExtractOctetStringL(*items->At(2));
// And finally, the certs (if they're there)
if (items->Count() == 4)
{
// Check explicit tag [0]
TASN1DecGeneric& certsDec = *items->At(3);
if (certsDec.Tag() != KCertificatesTag)
{
User::Leave(OCSP::EMalformedResponse);
}
// It's OK, so decode the response bytes object therein
DecodeCertificatesL(certsDec.GetContentDER());
}
CleanupStack::PopAndDestroy(items);
}
示例3: DecodeOCSPResponseL
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);
}
示例4: DecodeResponseExtensionL
void COCSPResponseDecoder::DecodeResponseExtensionL(const TDesC8& aEncoding)
{
CArrayPtr<TASN1DecGeneric>* items = DecodeSequenceLC(aEncoding, 2, 3);
// Get oid
TASN1DecGeneric& oid = *items->At(0);
if (oid.Tag() != EASN1ObjectIdentifier)
{
User::Leave(OCSP::EMalformedResponse);
}
TASN1DecObjectIdentifier oidDec;
HBufC* oidVal = oidDec.DecodeDERL(oid);
CleanupStack::PushL(oidVal);
TBool critical = EFalse; // Default value of critical flag
if (items->Count() == 3)
{
// The critical flag is specified - what does it say?
TASN1DecBoolean decBool;
critical = decBool.DecodeDERL(*items->At(1));
}
TASN1DecGeneric& extnVal = items->Count() == 3 ? *items->At(2) : *items->At(1);
if (extnVal.Tag() != EASN1OctetString)
{
User::Leave(OCSP::EMalformedResponse);
}
// Check oid to decide what to do
if (*oidVal == KOCSPOidNonce)
{
iResponse->iNonce.Set(extnVal.GetContentDER());
}
else if (*oidVal == KOCSPOidArchiveCutoff)
{
TASN1DecGeneralizedTime decGT;
TInt pos = 0;
iResponse->iArchiveCutoff = new (ELeave) TTime(decGT.DecodeDERL(extnVal.GetContentDER(), pos));
}
else if (critical)
{
// Didn't understand extension, and it was critical! Erk!
User::Leave(OCSP::EUnknownCriticalExtension);
}
CleanupStack::PopAndDestroy(2, items); // oidVal, items
}
示例5: 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;
}
示例6: ResetL
// -----------------------------------------------------------------------------
// 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;
}
示例7: EditItemL
// -----------------------------------------------------------------------------
// 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 );
}
示例8: 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;
}
示例9: FindEmptySlotL
TInt CJuikIconManagerImpl::FindEmptySlotL()
{
for ( TInt i = 0; i < iIconArray->Count(); i++ )
{
if ( iIconArray->At(i) == NULL )
return i;
}
return KErrNotFound;
}
示例10: ConstructL
void CEncapsulatedContentInfo::ConstructL(const TDesC8& aRawData)
{
const TInt minItems = 1; // Must have OID
const TInt maxItems = 2; // Must have data
CArrayPtr<TASN1DecGeneric>* contentInfo = PKCS7ASN1::DecodeSequenceLC(aRawData, minItems, maxItems);
//Decode Content Type
iContentType=(TCmsContentInfoType)(CmsUtils::DecodeContentTypeL(contentInfo->At(0)));
//Decode Content Data
if(contentInfo->Count() == 2)
{
iIsContentDataPresent=ETrue;
const TASN1DecGeneric* contentInfoAt1 = contentInfo->At(1);
//Decode [0] Explicit
if ( contentInfoAt1->Tag() == 0 || contentInfoAt1->Class() == EContextSpecific )
{
//Decode Wrapper Octet string
TASN1DecGeneric decGen(contentInfoAt1->GetContentDER());
decGen.InitL();
if(decGen.Tag() == EASN1OctetString && decGen.Class() == EUniversal)
{
iContentData.Set(decGen.GetContentDER());
}
else
{
//Wrapper is not an Octect String
User::Leave(KErrArgument);
}
}
else
{
//Not [0] Explicit
User::Leave(KErrArgument);
}
}
else
{
//No optional data
iContentData.Set(KNullDesC8());
}
CleanupStack::PopAndDestroy(contentInfo);
}
示例11: MergeL
// ------------------------------------------------------------------------------------------------
// CNSmlDataModBase::MergeL
// Merges data from old item to new item.
// ------------------------------------------------------------------------------------------------
void CNSmlDataModBase::MergeL( TDes8& aNewItem, const TDesC8& aOldItem,TBool aFieldLevel )
{
TBool modified( EFalse );
CVersitParser* newItemParser = ChildCreateParserLC();
RDesReadStream newStream( aNewItem );
CleanupClosePushL( newStream );
newItemParser->InternalizeL( newStream );
CVersitParser* oldItemParser = ChildCreateParserLC();
RDesReadStream oldStream( aOldItem );
CleanupClosePushL( oldStream );
oldItemParser->InternalizeL( oldStream );
// Now we're ready to start analysis
CArrayPtr<CVersitParser>* newEntities = newItemParser->ArrayOfEntities( EFalse );
CArrayPtr<CVersitParser>* oldEntities = oldItemParser->ArrayOfEntities( ETrue );
if( newEntities && oldEntities )
{
CleanupPtrArrayPushL( oldEntities );
for( TInt i = 0; ( i < newEntities->Count() ) && ( i < oldEntities->Count() ); i++ )
{
MergeEntityL( newEntities->At( i ), oldEntities->At( i ), modified, aFieldLevel );
}
CleanupStack::PopAndDestroy(); // oldEntities
}
else
{
MergeEntityL( newItemParser, oldItemParser, modified, aFieldLevel );
}
// Only update if anything was modified in process
if ( modified )
{
aNewItem.Zero();
RDesWriteStream dws( aNewItem );
CleanupClosePushL( dws );
newItemParser->ExternalizeL( dws );
dws.CommitL();
CleanupStack::PopAndDestroy(); // dws
}
CleanupStack::PopAndDestroy( 4 ); // oldStream, oldItemParser, newStream, newItemParser
}
示例12: DecodeL
// -----------------------------------------------------------------------------
// CCMSOriginatorPublicKey::DecodeL
// Decrypts raw data to this instance
// -----------------------------------------------------------------------------
void CCMSOriginatorPublicKey::DecodeL( const TDesC8& aRawData )
{
TASN1DecGeneric decGen( aRawData );
decGen.InitL();
TASN1DecSequence decSeq;
CArrayPtr< TASN1DecGeneric >* itemsData =
decSeq.DecodeDERLC( decGen );
TInt count = itemsData->Count();
if( count != KNumberOfSubModules )
{
User::Leave( KErrArgument );
}
// we would not get this far if there is not 2 elements
// decoding algorithm identifier
CCMSX509AlgorithmIdentifier* algorithm =
CCMSX509AlgorithmIdentifier::NewL( );
CleanupStack::PushL( algorithm );
algorithm->DecodeL( itemsData->At( 0 )->Encoding() );
CleanupStack::Pop( algorithm );
delete iAlgorithm;
iAlgorithm = algorithm;
// decoding public key
TASN1DecGeneric gen( *itemsData->At( 1 ) );
gen.InitL();
// Symbian decoder can't handle zero length bit strings
if( gen.LengthDERContent() > 1 )
{
TASN1DecBitString bitStringDecoder;
HBufC8* tmp = bitStringDecoder.ExtractOctetStringL( gen );
delete iPublicKey;
iPublicKey = tmp;
}
else
{
HBufC8* tmp = KNullDesC8().AllocL();
delete iPublicKey;
iPublicKey = tmp;
}
CleanupStack::PopAndDestroy( itemsData );
}
示例13: 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);
}
}
示例14: MakeErrorCode
CArrayFix<TInt>& CJuikIconManagerImpl::ProviderIconIndexL(TInt aProviderId) const
{
CALLSTACKITEM_N(_CL("CJuikIconManagerImpl"), _CL("ProviderIconIndexL"));
AssertIndexL( *iProviderIconIndexes, aProviderId );
CArrayFix<TInt>* map = iProviderIconIndexes->At(aProviderId);
if ( map )
return *map;
else
Bug( _L("Trying to get removed provider") ).ErrorCode( MakeErrorCode( CONTEXT_UID_JAIKUUIKIT, KErrNotFound ) ).Raise();
return *map; // to please compiler
}
示例15: DecodeResponsesL
void COCSPResponseDecoder::DecodeResponsesL(const TDesC8& aEncoding)
{
CArrayPtr<TASN1DecGeneric>* items = DecodeSequenceLC(aEncoding);
TInt count = items->Count();
for (TInt index = 0; index < count; ++index)
{
DecodeSingleResponseL(items->At(index)->Encoding());
}
CleanupStack::PopAndDestroy(items);
}