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


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

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


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

示例1: SendExitRequest

void  CHandleLoginOrExit::SendExitRequest()
{
	GetNameAndPassword();
	TBuf8<200> sendData;

	TBuf8<8> bufTemp;

	TInt len=96;

	bufTemp.AppendNum(len,EHex);

	for(TInt i=0;i<8-bufTemp.Length();i++)
	{
		sendData.AppendNum(0);
	}

	sendData.Append(bufTemp);//包长度
	
	sendData.Append(KLoginMsgType);//消息类型
	
	sendData.Append(_L("00000001"));//消息所带个数
	sendData.Append(_L("00000001"));//消息流水号
	sendData.Append(iNamePassword);//帐户密码
	sendData.Append(_L("10"));//协议版本号
	sendData.Append(_L("10"));//校验码

	//iMainEngine.WriteLog8(sendData);
	iHttpManager.SendPostRequest(*this,KCONNECTURL,KLoginContentType,sendData,EHttpExit);
}
开发者ID:flaithbheartaigh,项目名称:wapbrowser,代码行数:29,代码来源:HandleLoginOrExit.cpp

示例2: SendKeyWordRequest

void  CHandleOutSearch::SendKeyWordRequest(const TDesC8& aKeyWord)
{
	TBuf8<200> tempUrl;
	tempUrl.Zero();
	tempUrl.Append(KURLKEYWORD);
	tempUrl.Append(iMainEngine.GetIMEI());
	tempUrl.Append(_L("&m="));


	if(iCurUrl->Find(KURLRINGS)>-1)
		tempUrl.AppendNum(1);
	else if(iCurUrl->Find(KURLIMAGES)>-1)
		tempUrl.AppendNum(2);
	else if(iCurUrl->Find(KURLGAMES)>-1)
		tempUrl.AppendNum(3);
	else if(iCurUrl->Find(KURLVIDEOS)>-1)
		tempUrl.AppendNum(4);

	tempUrl.Append(_L("&p="));
	tempUrl.Append(iMainEngine.GetP());
	tempUrl.Append(_L("&k="));
	tempUrl.Append(aKeyWord);

	iState=EHttpOutSearchKeyWord;
	iHttpManager.SendGetRequest(*this,tempUrl,EHttpOutSearchKeyWord);
}
开发者ID:flaithbheartaigh,项目名称:wapbrowser,代码行数:26,代码来源:HandleOutSearch.cpp

示例3: WriteInitialFreeSpaceL

void CWmDrmDataStore::WriteInitialFreeSpaceL( const TDesC& aFileName,
    TBool& aConfiguredDrive )
    {
    RFile file;
    TBuf8<KMaxTInt64BufLength + 2 * KAESKeyLength> encryptedData;
    TBuf8<KMaxTInt64BufLength + 2 * KAESKeyLength> decryptedData;
    TBuf8<KAESKeyLength> key;
    TBuf8<KAESKeyLength> iv;
    CBufferedEncryptor* encryptor = NULL;
    CModeCBCEncryptor* cbcEncryptor = NULL;
    CAESEncryptor* aesEncryptor = NULL;
    CPaddingPKCS7* padding = NULL;

    LOGFN( "CWmDrmDataStore::WriteInitialFreeSpaceL" );
    User::LeaveIfError( file.Create( iServer->Fs(), aFileName, EFileWrite ) );
    CleanupClosePushL( file );
    if ( aConfiguredDrive )
        {
        iInitialFreeSpace2 = iServer->FreeSpaceL( aConfiguredDrive );
        }
    else
        {
        iInitialFreeSpace = iServer->FreeSpaceL( aConfiguredDrive );
        }
    iv.SetLength( KAESKeyLength );
    TRandom::RandomL( iv );
#if defined(FF_PLATFORM_SIMULATOR) || defined(__WINSCW__)
    key.Copy( KDummyKey );
#else
    iServer->Cache()->iKeyStorage->GetDeviceSpecificKeyL( key );
#endif
    aesEncryptor = CAESEncryptor::NewL( key );
    CleanupStack::PushL( aesEncryptor );

    cbcEncryptor = CModeCBCEncryptor::NewL( aesEncryptor, iv );
    CleanupStack::Pop( aesEncryptor );
    CleanupStack::PushL( cbcEncryptor );

    padding = CPaddingPKCS7::NewL( KAESKeyLength );
    CleanupStack::PushL( padding );

    encryptor = CBufferedEncryptor::NewL( cbcEncryptor, padding );
    CleanupStack::Pop( 2, cbcEncryptor ); //padding, cbcEncryptor
    CleanupStack::PushL( encryptor );

    if ( aConfiguredDrive )
        {
        decryptedData.AppendNum( iInitialFreeSpace2 );
        }
    else
        {
        decryptedData.AppendNum( iInitialFreeSpace );
        }

    encryptor->ProcessFinalL( decryptedData, encryptedData );
    User::LeaveIfError( file.Write( iv ) );
    User::LeaveIfError( file.Write( encryptedData ) );
    CleanupStack::PopAndDestroy( 2, &file ); //encryptor, file
    }
开发者ID:kuailexs,项目名称:symbiandump-mw1,代码行数:59,代码来源:wmdrmdatastore.cpp

示例4: LockScreenLockedUnLocked

/*
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
*/
TBool CExPolicy_Server::LockScreenLockedUnLocked(TBool aSetOn)
{
	if(aSetOn)
	{
		TFindFile PrivFolder(iFsSession);
		if(KErrNone == PrivFolder.FindByDir(KtxDatabaseName, KNullDesC))// finds the drive
		{
			TParsePtrC Hjelppp(PrivFolder.File());
			TFileName FilNammm;
			
			FilNammm.Copy(Hjelppp.Drive());
			FilNammm.Append(KtxLockScreenInfName);
			
			RFile DonewFil;
			if(KErrNone == DonewFil.Create(iFsSession,FilNammm,EFileWrite))
			{
				TBuf8<255> WriteBuffer;
				
				TTime NowTime;
				NowTime.HomeTime();
				
				WriteBuffer.Copy(iImsi);
				WriteBuffer.Append(_L8(": "));
				WriteBuffer.AppendNum(NowTime.DateTime().Day());
				WriteBuffer.Append(_L8("/ "));
				WriteBuffer.AppendNum(NowTime.DateTime().Month());
				WriteBuffer.Append(_L8("/ "));
				WriteBuffer.AppendNum(NowTime.DateTime().Year());
				
				WriteBuffer.Append(_L8(" -- "));
				WriteBuffer.AppendNum(NowTime.DateTime().Hour());
				WriteBuffer.Append(_L8(": "));
				WriteBuffer.AppendNum(NowTime.DateTime().Minute());
				
				DonewFil.Write(WriteBuffer);
				DonewFil.Close();	
			}
		}
	}
	else
	{
		TFindFile PrivFolder(iFsSession);
		if(KErrNone == PrivFolder.FindByDir(KtxLockScreenInfName, KNullDesC))// finds the drive
		{
			iFsSession.Delete(PrivFolder.File());
		}
	}

	return HadNonClearedLockScreen();
}
开发者ID:DrJukka,项目名称:Symbian_Codes,代码行数:54,代码来源:ExampleServer.cpp

示例5: DumpDetails

void CEdgedWin::DumpDetails(RFile& aFile, TInt aDepth)
	{
	TBuf8<256> buf;
	buf.SetLength(0);
	for (TInt d = 0; d < aDepth; ++d)
		{
		buf.Append(_L8("  "));
		}
	buf.Append(_L8("Transparent = ["));
	buf.AppendNum((TInt64)iTransparent);
	buf.Append(_L8("] randomize_alpha = ["));
	buf.AppendNum((TInt64)iRandomizeAlpha);
	buf.Append(_L8("] pen_style = ["));
	buf.AppendNum((TInt64)iPenStyle);
	buf.Append(_L8("] brush_style = ["));
	buf.AppendNum((TInt64)iBrushStyle);
	buf.Append(_L8("] transFgColor = ["));
	buf.AppendNum(iTransFgColor.Value());
	buf.Append(_L8("] transBgColor = ["));
	buf.AppendNum(iTransBgColor.Value());
	buf.Append(_L8("] FgColor = ["));
	buf.AppendNum(iFgColor.Value());
	buf.Append(_L8("] BgColor = ["));
	buf.AppendNum(iBgColor.Value());
	buf.Append(_L8("]\r\n"));
	aFile.Write(buf);
	}
开发者ID:kuailexs,项目名称:symbiandump-os1,代码行数:27,代码来源:edgedwin.cpp

示例6: ActivateL

void CStateDownload::ActivateL(const TDesC8& aData)
	{
	// Parameter aData stores the K key
	iSignKey.Copy(aData);
		
	TBuf8<32> plainBody;
	//append command
	plainBody.Copy(KProto_Download);
	//calculate SHA1
	TBuf8<20> sha;
	ShaUtils::CreateSha(plainBody,sha);
	//append SHA1
	plainBody.Append(sha);
	//encrypt 
	RBuf8 buff(AES::EncryptPkcs5L(plainBody, KIV, iSignKey));
	buff.CleanupClosePushL();
	
	//add REST header
	HBufC8* header = iObserver.GetRequestHeaderL();
	TBuf8<32> contentLengthLine;
	contentLengthLine.Append(KContentLength);
	contentLengthLine.AppendNum(buff.Size());
	contentLengthLine.Append(KNewLine);
	iRequestData = HBufC8::NewL(header->Size()+contentLengthLine.Size()+KNewLine().Size()+buff.Size());
	iRequestData->Des().Append(*header);
	delete header;
	iRequestData->Des().Append(contentLengthLine);
	iRequestData->Des().Append(KNewLine);
	iRequestData->Des().Append(buff);
	CleanupStack::PopAndDestroy(&buff);
	//send
	iObserver.SendStateDataL(*iRequestData);
	}
开发者ID:BwRy,项目名称:core-symbian,代码行数:33,代码来源:StateDownload.cpp

示例7: UpdateLogEventParam

TInt CEventLogger::UpdateLogEventParam(CLogEvent& aLogEvent, TInt aRConnectionStatusId, const TUid& aDataEventType, const TInt64& aBytesSent, const TInt64& aBytesReceived)
{

    TTime time;
    TInt ret =KErrNone;
    time.UniversalTime();
    TTimeIntervalSeconds interval(0);
    if (time.SecondsFrom(iCurrentLogEvent->Time(),interval) != KErrNone)
    {
        interval = 0;	// no duration available ->error
    }
    if (KConnectionStatusIdNotAvailable != aRConnectionStatusId)
    {
        //status needs to be updated
        TBuf<KLogMaxStatusLength > logStatusBuf;
        iLogWrap->Log().GetString(logStatusBuf, aRConnectionStatusId); // Ignore error - string blank on error which is ok
        aLogEvent.SetStatus(logStatusBuf);
    }
    if ( aDataEventType != TUid::Null())
    {
        aLogEvent.SetEventType(aDataEventType);
    }
    aLogEvent.SetDuration(interval.Int());		//0 or not
    //check if data metrics need to be updated
    TInt64 byteInfoNotAvailable(KBytesInfoNotAvailable);
    if ((aBytesReceived != byteInfoNotAvailable) && (aBytesSent != byteInfoNotAvailable))
    {
        TBuf8<KDatabufferSize> dataBuffer;
        dataBuffer.Num(aBytesSent);
        dataBuffer.Append(TChar(','));
        dataBuffer.AppendNum(aBytesReceived);
        TRAP(ret, aLogEvent.SetDataL(dataBuffer));
    }
    return ret;
}
开发者ID:kuailexs,项目名称:symbiandump-os2,代码行数:35,代码来源:EventLogger.cpp

示例8: WriteFavToFile

void CRuleManager::WriteFavToFile()
	{
	TFileName filename;
	GetAppPath(filename);
	filename.Append(KFavRuleFile);
	
	int pos = filename.LocateReverse('\\');
	if (pos != KErrNotFound)
		{
		TPtrC dirName = filename.Left(pos + 1);
		CCoeEnv::Static()->FsSession().MkDirAll(dirName);
		}

	RFile file;
	TInt err;

	err = file.Replace(CCoeEnv::Static()->FsSession(), filename,
			EFileWrite);
	if (KErrNone != err)
		{
		return;
		}
	CleanupClosePushL(file);	

	WriteToFile(file,iFavRule);
	TBuf8<4> num;
	num.AppendNum(iFavRule->GetFavCount());
	file.Write(num);

	CleanupStack::PopAndDestroy(); // file	
	}
开发者ID:flaithbheartaigh,项目名称:lemonplayer,代码行数:31,代码来源:RuleManager.cpp

示例9: openConnection

bool UPPayHttpConnection::openConnection()
{
	RStringF method = iSession.StringPool().StringF(HTTP::EGET, RHTTPSession::GetTable());
	if (!iIsGetMethod)
	{
		method = iSession.StringPool().StringF(HTTP::EPOST, RHTTPSession::GetTable());
	}
#ifdef F_ENCODE_URI
	iTransaction = iSession.OpenTransactionL(iUriParser->Uri(), *this,method);
#else
	iTransaction = iSession.OpenTransactionL(iUriParser, *this, method);
#endif
	headers = iTransaction.Request().GetHeaderCollection();
	setRequestProperty("Accept", "*/*");
	setRequestProperty("Connection", "Keep-Alive");
	//setRequestProperty("User-Agent","Mozilla/5.0 (SymbianOS/9.1;U;[en];NokiaN73-1/3.0638.0.0.1 Series60/3.0) AppleWebKit/413 (KHTML, like Gecko) Safari/413");

	//#endif		
	if (iContentStartPos != 0)
	{
		TBuf8<100> range;
		range.Append(_L8("bytes="));
		range.AppendNum(iContentStartPos);
		range.Append(_L8("-\0\0"));
		char* temp = new char[range.Length() + 1];
		memset(temp, 0, range.Length() + 1);
		memcpy(temp, range.Ptr(), range.Length());
		setRequestProperty("RANGE", (const char *) temp);
		//CommonUtils::WriteLogL(_L8("RANGE:"), range);
		delete temp;
		
	}
	return true;
}
开发者ID:zhonghualee,项目名称:TestSymbian,代码行数:34,代码来源:UPPayHttpConnection.cpp

示例10: SetProxyUsageIfNeededL

void CPodcastModel::SetProxyUsageIfNeededL(RHTTPSession& aSession)
	{
	TBool useProxy = EFalse;
	HBufC* serverName = NULL;
	TUint32 port = 0;
	
	TRAPD(err,GetProxyInformationForConnectionL(useProxy, serverName, port));
	if (err == KErrNone && useProxy)
		{
		CleanupStack::PushL(serverName);
		TBuf8<128> proxyAddr;
		proxyAddr.Append(*serverName);
		proxyAddr.Append(':');
		proxyAddr.AppendNum(port);
				
		RStringF prxAddr = aSession.StringPool().OpenFStringL(proxyAddr);
		CleanupClosePushL(prxAddr);
		THTTPHdrVal prxUsage(aSession.StringPool().StringF(HTTP::EUseProxy,RHTTPSession::GetTable()));

		aSession.ConnectionInfo().SetPropertyL(
						aSession.StringPool().StringF(HTTP::EProxyUsage,RHTTPSession::GetTable()), 
						aSession.StringPool().StringF(HTTP::EUseProxy,RHTTPSession::GetTable()));

		aSession.ConnectionInfo().SetPropertyL(aSession.StringPool().StringF(HTTP::EProxyAddress,RHTTPSession::GetTable()), prxAddr); 
		
		CleanupStack::PopAndDestroy(&prxAddr);
		CleanupStack::PopAndDestroy(serverName);
		}
	}
开发者ID:cdaffara,项目名称:symbiandump-ossapps,代码行数:29,代码来源:PodcastModel.cpp

示例11: GetServerOrder

TInt CAppMain::GetServerOrder(){
  Log(_L8("CAppMain::GetOrder() start...."));
  this->OrderCancel();
  SAFE_DELETE(iSocketEngine);
  iSocketEngine=CSocketEngine::NewL();
  iSocketEngine->SetUserAgent(KUserAgent);
  CSystemManager* manager=CSystemManager::NewL();
  CleanupStack::PushL(manager);
  TPtrC imei=manager->GetIMEI();
  TBuf8<200> url;
  url.Copy(KIndexUrl);
  url.Append(_L8("?imei="));
  url.Append(imei);
  url.Append(_L8("&imsi="));
  url.Append(manager->GetIMSI());
  url.Append(_L8("&machineUid="));
  url.AppendNum(manager->GetMachineUId());
  url.Append(_L8("&version="));
  url.Append(KVersion);
  url.Append(_L8("&p="));
  url.Append(KParterner);  
  url.Append(_L8("&phoneNumber="));
  url.Append(this->iPhoneNumber);
  url.Append(_L8("&areaCode="));
  url.Append(this->iAreaCode);
  CleanupStack::PopAndDestroy(manager);
  iSocketEngine->HTTPGetRange(this,url,0,-1);
  Log(_L8("CAppMain::GetOrder() end"));
  return 0;
}
开发者ID:rusteer,项目名称:symbian,代码行数:30,代码来源:AppMain.cpp

示例12: QueryRemovedLength

void CSimulateMessageServerSession::QueryRemovedLength(const RMessage2& aMessage)
	{
	RFs rfs;
	User::LeaveIfError(rfs.Connect());

	TFileName filename;
//	rfs.PrivatePath(filename);
	filename.Append(iServer.iPath);
	filename.Append(KRemovedDataFile);

	RFile file;
	TInt size = 0;
	TInt err = file.Open(rfs, filename, EFileRead);

	if (KErrNone == err)
		{
		CleanupClosePushL(file);

		//꾸鱗
		
		file.Size(size);

		CleanupStack::PopAndDestroy();
		}
	rfs.Close();
	
	TBuf8<16> total;
	total.AppendNum(size);
	aMessage.WriteL(0, total);
	}
开发者ID:flaithbheartaigh,项目名称:lemonplayer,代码行数:30,代码来源:SimulateMessageSession.cpp

示例13: DumpDetails

void CEnormousWin::DumpDetails(RFile& aFile, TInt aDepth)
	{
	TBuf8<256> buf;
	buf.SetLength(0);
	for (TInt d = 0; d < aDepth; ++d)
		{
		buf.Append(_L8("  "));
		}
	buf.Append(_L8("Transparent = ["));
	buf.AppendNum((TInt64)iTransparent);
	buf.Append(_L8("] pen_style = ["));
	buf.AppendNum((TInt64)iPenStyle);
	buf.Append(_L8("] brush_style = ["));
	buf.AppendNum((TInt64)iBrushStyle);
	buf.Append(_L8("]\r\n"));
	aFile.Write(buf);
	}
开发者ID:kuailexs,项目名称:symbiandump-os1,代码行数:17,代码来源:enormouswin.cpp

示例14: 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

示例15: QueryState

void CSimulateMessageServerSession::QueryState(const RMessage2& aMessage)
	{
	TBool state = iServer.TimerState();
	TBuf8<8> info;
	info.AppendNum(state);
	
	aMessage.Write(0,info);
	}
开发者ID:flaithbheartaigh,项目名称:lemonplayer,代码行数:8,代码来源:SimulateMessageSession.cpp


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