当前位置: 首页>>代码示例>>C++>>正文


C++ TBuf8::AllocL方法代码示例

本文整理汇总了C++中TBuf8::AllocL方法的典型用法代码示例。如果您正苦于以下问题:C++ TBuf8::AllocL方法的具体用法?C++ TBuf8::AllocL怎么用?C++ TBuf8::AllocL使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TBuf8的用法示例。


在下文中一共展示了TBuf8::AllocL方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: SetSessionVersionL

// -----------------------------------------------------------------------------
// CSdpOriginFieldPtrs::SetSessionVersionL
// -----------------------------------------------------------------------------
// 
void CSdpOriginFieldPtrs::SetSessionVersionL( TInt64 aSessionVersion )
	{
	TBuf8< KMaxTInt64Digits > number;
    number.AppendNum( aSessionVersion );
    HBufC8* tmp = number.AllocL();
	delete iSessionVersion;
    iSessionVersion = tmp;
	}
开发者ID:cdaffara,项目名称:symbiandump-os2,代码行数:12,代码来源:sdporiginfieldptrs.cpp

示例2:

/*
Mode:RC4 with weak encryption
Protocol: TLS
Tests covered:
	1.Generation of weak keys are also being tested
	2.MAC computations
	3.Encryption
	4.Decryption
*/
TVerdict CTlsProvTestActive::TestProvider_6_0L( CTlsProvStep* aStep )
	{

	
	CTLSProvider* PtrProvider = 0;
	CTLSSession* PtrSession;
	CTlsCryptoAttributes* PtrTlsCryptoAttributes;

	INFO_PRINTF1(_L("1"));
	InitProviderL(PtrProvider,PtrSession,PtrTlsCryptoAttributes,/*IsTls?*/ETrue,/*IsExport?*/ETrue,aStep);

	//Want client authentication?
	PtrTlsCryptoAttributes->iClientAuthenticate = EFalse;

	//Any dialogs
	PtrTlsCryptoAttributes->iDialogNonAttendedMode = ETrue;

	//Required ciphersuite
	TTLSCipherSuite	 CipherSuite;
	CipherSuite.iHiByte = 0;
	CipherSuite.iLoByte = 0x19;
	PtrTlsCryptoAttributes->iCurrentCipherSuite = CipherSuite;
	PtrTlsCryptoAttributes->iNegotiatedProtocol = KTLS1_0;	

	
	//dummy flag untuill the token panic is resolved
	RFs fs;
	RFile file;
	fs.Connect();

	TBuf8<800> boom;
	file.Open(fs, 
				aStep->iServerCertChain,  
	 			EFileShareAny|EFileRead);
	file.Read(boom);
	
	iStatus = KRequestPending;
	CX509Certificate* serverCert;
	HBufC8* servrc = boom.AllocL();
	PtrProvider->VerifyServerCertificate(servrc->Des(), serverCert, iStatus);
	SetActive();
	CActiveScheduler::Start();
	INFO_PRINTF1(_L("2"));

	CipherSuite.iHiByte = 0;
	CipherSuite.iLoByte = 0x19;
	PtrTlsCryptoAttributes->iCurrentCipherSuite = CipherSuite;

	iStatus = KRequestPending;		
	PtrProvider->CreateL(PtrSession,iStatus);
	SetActive();
	CActiveScheduler::Start();
	INFO_PRINTF1(_L("3"));


	CipherSuite.iHiByte = 0;
	CipherSuite.iLoByte = 3;
	PtrTlsCryptoAttributes->iCurrentCipherSuite = CipherSuite;
	
	iStatus = KRequestPending;
	HBufC8* clntkeyexchang;
	if(!PtrSession)
   {
   	iLogInfo.Copy(_L("	6.1:  !PtrSession"));
		return EFail;
   }


	PtrSession->ClientKeyExchange(clntkeyexchang,iStatus);
	SetActive();
	CActiveScheduler::Start();
	INFO_PRINTF1(_L("4"));

	if(PtrSession)
   {
   	iLogInfo.Copy(_L("	6.1:  EncryptAndDecryptL"));
		TVerdict ver = (EncryptAndDecryptL(PtrSession,aStep));
      delete PtrProvider;
      delete PtrSession;
      return ver;
   }
	else
   {
      delete PtrProvider;
      delete PtrSession;
		return EFail;
   }

	}
开发者ID:cdaffara,项目名称:symbiandump-os2,代码行数:98,代码来源:TlsProviderStep6.cpp

示例3: CheckSubjectNameSyntaxL


//.........这里部分代码省略.........
            {
            equalSignArr->AppendL(i);
            equalArrItemCount++;
            }
        
        if ( aSubj.Mid(i, 1)== KCommaSign )
            {
            commaSignArr->AppendL(i);
            commaArrItemCount++;
            }
        }
    
    CleanupStack::PushL(updateArr);
    
    TInt i=0;
    TInt j=0;
    
    // At least one comma required. Otherwise there is no chance for extra commas
    if ( commaArrItemCount )
        {
        while ( i< equalArrItemCount )
            {
            
            //advance starting position for every iteration
            TInt eqSignStartIndex=i;
            
            TInt cmCount=0;
        
            //check wether there is more than one comma between two adjacent fields.
            while ( commaSignArr->At(j)< equalSignArr->At(eqSignStartIndex) )
                {
                cmCount++;
                
                j++;
                
                if ( j==commaArrItemCount )
                    break;
                }
            
            //at least one extra comma character found. Mark positions for mofifications.
            if (cmCount>1)
                {
                TInt equalPos=equalSignArr->At(eqSignStartIndex-1) + 1;
                updateArr->AppendL(equalPos);
                
                TInt commaPos=commaSignArr->At(j-1);
                updateArr->AppendL(commaPos);
                
                updateArrCount++;
                updateArrCount++;
                }
            i++;    
            }
        }
        
        //Checking also last attribute of Subject Name string
        if ( j<commaArrItemCount )
            {
            updateArr->AppendL(equalSignArr->At(equalArrItemCount-1) + 1);
            updateArr->AppendL(subjLth);
            
            updateArrCount++;
            updateArrCount++;
            }
       
       TBuf8<256> resultBuf;
       resultBuf.Copy(aSubj);
       
       i=0;       
       
       //update subjectname acoording to updateArr array.
       if ( updateArr->Count()>0 )
           {
           while (i<updateArrCount)
               {
               if ( resultBuf.Length()<256 )
                   resultBuf.Insert(updateArr->At(i) + i, KReplacementChar);
               else
                   User::Leave(KErrNotSupported);
               i++;
               }
           }
       
       CleanupStack::Pop(updateArr);
       CleanupStack::Pop(commaSignArr);
       CleanupStack::Pop(equalSignArr);
       
       delete equalSignArr;
       equalSignArr=NULL;
       
       delete commaSignArr;
       commaSignArr=NULL;
       
       delete updateArr;
       updateArr=NULL;
       
       HBufC8* resultHeap = resultBuf.AllocL();
       
       return resultHeap;
    }
开发者ID:cdaffara,项目名称:symbiandump-mw4,代码行数:101,代码来源:policypatcher.cpp


注:本文中的TBuf8::AllocL方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。