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


C++ TBuf类代码示例

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


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

示例1: INFO_PRINTF1

/**
 * Load and initialise an audio file.
 */
TVerdict CTestMmfAclntFileHandleSource::DoTestStepL( void )
	{
	INFO_PRINTF1( _L("TestPlayerUtils : File"));
	TVerdict ret = EFail;

	iError = KErrTimedOut;
	
	// Get the file name.
	TBuf<KSizeBuf> filename;
	TPtrC filename1;
	if(!GetStringFromConfig(iSectName,iKeyName,filename1))
		{
		return EInconclusive;
		}
	GetDriveName(filename);
	filename.Append(filename1);
	
	// Create CMdaAudioPlayerUtility Object
	CMdaAudioPlayerUtility* player = NULL;
	player = CMdaAudioPlayerUtility::NewL(*this);
	
	// Create RFs and RFile Objects
	RFs fs;
	User::LeaveIfError(fs.Connect());
	CleanupClosePushL(fs);
	User::LeaveIfError(fs.ShareProtected());
	
	RFile file;
	User::LeaveIfError( file.Open( fs, filename, EFileRead ) );
	CleanupClosePushL(file);
	
	// Create TMMFileSource Object
	TMMFileHandleSource filehandlesource(file);
	player->OpenFileL(filehandlesource);
	
	// Wait for initialisation callback
	INFO_PRINTF1(_L("CMdaAudioPlayerUtility->OpenFileL(TMMFileHandleSource)"));
	CActiveScheduler::Start();
	
	// Check for expected errors.
	if((iError != KErrNone) && (iExpectedError == iError))
		{
		ERR_PRINTF2(_L("CMdaAudioPlayerUtility->OpenFileL() Returned the Expected Error : %d"),iError);
		ret=EPass;
		}
	
	// Check for errors.
	if(iError != KErrNone)
		{
		ERR_PRINTF2(_L("CMdaAudioPlayerUtility->OpenFileL() Failed with Error : %d"),iError);
		ret=EFail;
		}
	
	// Check for No errors, so as to start Playback
	if (iError == KErrNone && player != NULL)
		{
		if(iPlay)
			{
			iError = KErrTimedOut;
			player->Play();
			
			// Wait for play complete callback
			INFO_PRINTF1(_L("CMdaAudioPlayerUtility->Play()"));
			CActiveScheduler::Start();
			
			// Check for Callback errors
			if(iError == KErrNone)
				{
				ERR_PRINTF2(_L("CMdaAudioPlayerUtility->Play() completed successfully with return code : %d"),iError);
				ret = EPass;
				}
			else
				{
				ERR_PRINTF2(_L("CMdaAudioPlayerUtility->Play() Failed with Error : %d"),iError );
				ret = EFail;
				}
			}
		else
			{
			ret = EPass;
			}
		}
	
	// Clean up activities.
	delete player;
	User::After(KOneSecond); // wait for deletion to shut down devsound
	CleanupStack::PopAndDestroy(2);

	return	ret;
	}
开发者ID:kuailexs,项目名称:symbiandump-os1,代码行数:93,代码来源:TestPlayerFileSource.cpp

示例2: DoTestL

/**
* Performes the test by connecting to MLFW and makes 50 Location request
*/
TInt DoTestL()
{
    TBuf<40> traceFile = GenerateFileNameForTraceL();

    RFs fileserver;
    RFile file;
    User::LeaveIfError(fileserver.Connect());
    CleanupClosePushL(fileserver);
    User::LeaveIfError(file.Open(fileserver, traceFile, EFileWrite));
    CleanupClosePushL(file);
    _LIT(KClientStarted, "Client Started");
    TraceL(KClientStarted, file);

    const TInt32 KUidMultiPsy = 0x01010176;
    TUid uidMultiPsy;
    uidMultiPsy.iUid = KUidMultiPsy;
    SetupPsyL(uidMultiPsy);

    _LIT(KMultiPsySetup, "MultiPsy set up");
    TraceL(KMultiPsySetup, file);

    TInt numberOfRuns = 50;

    RPositionServer	posServer;
    CleanupClosePushL(posServer);
    RPositioner positioner;
    CleanupClosePushL(positioner);
    TPositionInfo positionInfo = TPositionInfo();

    _LIT(KConnectErr, "ERROR: Error when connecing to EPos server,  %d");
    TInt err = posServer.Connect();
    AssertTrueL(err == KErrNone, KConnectErr, err, file);

    _LIT(KOpenErr, "ERROR: Error when opening positioner,  %d");
    err = positioner.Open(posServer, uidMultiPsy);
    AssertTrueL(err == KErrNone, KOpenErr, err, file);

    _LIT(KService ,"Service");
    err = positioner.SetRequestor(CRequestor::ERequestorService,
                                  CRequestor::EFormatApplication, KService);
    _LIT(KRequestor, "ERROR: Not possible to set requestor");
    AssertTrueL(err == KErrNone, KRequestor, err, file);

    TTime now, startTime;
    TTimeIntervalMicroSeconds requestTime;
    TRequestStatus status;
    TInt64 reqTime;
    TCoordinate corr(0,0,0);
    TLocality loca(corr,0);
    TPosition pos(loca, TTime(0));
    TBool success = ETrue;
    _LIT(KStartingRequests, "Starting requests");
    TraceL(KStartingRequests, file);

    for (TInt i = 0; i < numberOfRuns; i++)
    {
        startTime.UniversalTime();
        positionInfo.SetPosition(pos);
        positioner.NotifyPositionUpdate(positionInfo, status);
        User::WaitForRequest(status);
        err = status.Int();
        if (err != KErrNone)
        {
            success=EFalse;
        }
        now.UniversalTime();
        requestTime = now.MicroSecondsFrom(startTime);
        _LIT(KError, "Request time, %d µs. Error code from Notify = %d");
        TBuf<100> buf;
        reqTime = requestTime.Int64();
        buf.Format(KError, reqTime, err);
        TraceL(buf, file);
        TPosition result;
        positionInfo.GetPosition(result);
        // Sanity check
        if (result.Latitude() == pos.Latitude() ||
                result.Longitude() == pos.Longitude() ||
                result.Altitude() == pos.Altitude())
        {
            success = EFalse;
            _LIT(KErrorPositon, "ERROR:: The postion was not updated");
            TraceL(KErrorPositon, file);
        }
    }

    CleanupStack::PopAndDestroy(&positioner);
    CleanupStack::PopAndDestroy(&posServer);

    if (success)
    {
        _LIT(KOk, "SUCCESS");
        TraceL(KOk, file);
    }
    else
    {
        _LIT(KErr, "FAILED");
        TraceL(KErr, file);
//.........这里部分代码省略.........
开发者ID:kuailexs,项目名称:symbiandump-os1,代码行数:101,代码来源:ctlbsexeclient.cpp

示例3: ret

TInt TRPSOwnNumbers::ExtractANumber(const RMobileONStore::TMobileONEntryV1& aEntry)
	{
	TInt ret(KErrNotFound);
	
	TBuf<1> prependstr;
	prependstr.Zero();
	if(aEntry.iNumber.iTypeOfNumber == RMobilePhone::EInternationalNumber || 
	   aEntry.iNumber.iTelNumber.Left(2) == KUKCountryCode)
		{
		prependstr = KPlus;
		}
		
	// Check if entry's Service tag is set and extract number
	switch(aEntry.iService)
		{
		case RMobilePhone::EVoiceService:
			if(iOwnVoiceNumber.Length()==0)
				{					
				 iOwnVoiceNumber = prependstr;
				 iOwnVoiceNumber += aEntry.iNumber.iTelNumber;
			 	}
			ret = KErrNone;
			break;
		case RMobilePhone::ECircuitDataService:
			if(iOwnDataNumber.Length()==0)
				{
				iOwnDataNumber = prependstr;
				iOwnDataNumber += aEntry.iNumber.iTelNumber;
				}
			ret = KErrNone;
			break;
		case RMobilePhone::EFaxService:
			if(iOwnFaxNumber.Length()==0)
				{
				iOwnFaxNumber = prependstr;
				iOwnFaxNumber += aEntry.iNumber.iTelNumber;
				}
			ret = KErrNone;
			break;
			
		default:
			{
			// Else check the text tag, assuming the user has set the text tag according to the RPS
			// user guide
			if(iOwnVoiceNumber.Length()==0)
				{
				if(aEntry.iText.Match(KVoiceTagU)!= KErrNotFound || aEntry.iText.Match(KVoiceTagL)!= KErrNotFound)
					{
					// Assume this is the voice line
					iOwnVoiceNumber = prependstr;
				 	iOwnVoiceNumber += aEntry.iNumber.iTelNumber;
					ret = KErrNone;
					}
				}
				
			if(iOwnFaxNumber.Length()==0)
				{
				if(aEntry.iText.Match(KFaxTagU)!= KErrNotFound || aEntry.iText.Match(KFaxTagL)!= KErrNotFound)
					{
					// Assume this is the fax line
					iOwnFaxNumber = prependstr;
					iOwnFaxNumber += aEntry.iNumber.iTelNumber;		
					ret = KErrNone;
					}
				}
					
			if(iOwnDataNumber.Length()==0)
				{
				if(aEntry.iText.Match(KDataTagU)!= KErrNotFound || aEntry.iText.Match(KDataTagL)!= KErrNotFound)
					{
					// Assume this is the data line
					iOwnDataNumber = prependstr;
					iOwnDataNumber += aEntry.iNumber.iTelNumber;
					ret = KErrNone;
					}
				}					
			}
			break;
		}
	return ret;
	}
开发者ID:cdaffara,项目名称:symbiandump-os1,代码行数:81,代码来源:RpsCommon.cpp

示例4: switch

// ----------------------------------------------------
// CDbtestAppUi::HandleCommandL(TInt aCommand)
// ?implementation_description
// ----------------------------------------------------
//
void CDbtestAppUi::HandleCommandL(TInt aCommand)
{
	switch ( aCommand )
        {
        case EAknSoftkeyBack:
        case EEikCmdExit:
		{
			Exit();
			break;
		}
	case EdbtestCmdAppOBEX:
		//bt->transfer_logs();
		break;
        case EdbtestCmdAppTest:
		{
#if 0
			if (!is_open) {
				User::LeaveIfError(sockserv.Connect());
				User::LeaveIfError(sock.Open(sockserv, KAfInet, KSockStream, KUndefinedProtocol));
				TInetAddr a(INET_ADDR(128, 214, 48, 81) , 80);

				TRequestStatus s;
				sock.Connect(a, s);
				User::WaitForRequest(s);
				status_change(_L("opened"));
				is_open=true;
			} else {
				sock.CancelAll();
				sock.Close();
				sockserv.Close();
				status_change(_L("closed"));
				is_open=false;
			}
#else
#  if 0
			//transferer->log_gps();
			/*
			TInetAddr a(INET_ADDR(128, 214, 48, 81) , 21);
			ftp->Connect(a, _L8("tkt_cntx"), _L8("dKFJmqBi"));
			current_state=CONNECTING;
			*/
			/*
			run(this);
			*/
#  else
			//wap->Connect(1, _L("http://db.cs.helsinki.fi/~mraento/cgi-bin/put.pl"));
#  endif

#endif

		}
		break;
		
	case EdbtestCmdAppCommDb:
		{
			CCommDbDump* dump=CCommDbDump::NewL();
			CleanupStack::PushL(dump);
			dump->DumpDBtoFileL(_L("c:\\commdb.txt"));
			CleanupStack::PopAndDestroy();
		}
		break;
	case EdbtestCmdAppCert:
		{
			auto_ptr<CCertInstaller> i(CCertInstaller::NewL(AppContext()));
			i->InstallCertL(_L("c:\\hy.der"));
		}
	case EdbtestCmdAppDiscover:
		//discoverer->search();
		break;
	case EdbtestCmdAppCtmGSM:
		{
		TBuf<40> s;
		RDevRecharger c;
		TInt ret=0;
		TInt u=0;
		bool done=false;
		while (!done) {
			ret=c.Open(u);
			if (ret==KErrNone) {
				done=true;
			} else {
				++u;
				if (u==KNullUnit) done=true;
			}
		}
		if (ret!=KErrNone) {
			s.Format(_L("Open: %d"), ret);
		} else {
			TChargeInfoV1 i;
			i.iRawTemperature=i.iSmoothedTemperature=0;
			i.iChargeType=EChargeNone;
			TChargeInfoV1Buf b(i);
			c.ChargeInfo(b);
			s.Format(_L("%d r %d s %d t %d"), u, i.iRawTemperature, i.iSmoothedTemperature, i.iChargeType)	;
		}
//.........这里部分代码省略.........
开发者ID:flaithbheartaigh,项目名称:jaikuengine-mobile-client,代码行数:101,代码来源:Dbtestappui.cpp

示例5: ReadLineFromScript

EXPORT_C void CIpuTestHarness::GetAnEntry(const TDesC& ourPrompt, TDes& currentstring)
//
//	Get an input string from the user, displaying a supplied prompt and default string value
	{
	// If we're scripting, try reading from script first
	TInt readScriptErr = KErrNotFound;
	if (iScriptRunning)
		{
		readScriptErr = ReadLineFromScript(currentstring);
		}
	if (!readScriptErr)
		return;

	// Either not scripting, or hit end of script - continue with user input
	TBuf16<KMaxUserEntrySize> ourLine;
	TBuf<KMaxUserEntrySize> tempstring;				//tempstring is a unicode descriptor
										//create a temporary buffer where the
										//unicode strings are stored in order to 
										//be displayed
	ourLine.Zero ();
	tempstring.Copy(currentstring);		//Copy current string to Unicode buffer
	TKeyCode key = EKeyNull;						//current string buffer is 8 bits wide.
										//Unicode string bufffer (tempstring) is 16 bits wide.
	for (;;)
		{
		if (ourLine.Length () == 0)
			{
			iTest.Console()->SetPos (0, iTest.Console()->WhereY ());
			iTest.Console()->Printf (_L ("%S"), &ourPrompt);
			if (tempstring.Length () != 0)						//get tempstring's number of items
				iTest.Console()->Printf (_L (" = %S"), &tempstring);	//if not zero print them to iTest.Console()
			iTest.Console()->Printf (_L (" : "));
			iTest.Console()->ClearToEndOfLine ();
			}
		key = iTest.Getch();
		
		  if (key == EKeyBackspace)
				{
					if (ourLine.Length() !=0)
					{
						ourLine.SetLength(ourLine.Length()-1);
						iTest.Console()->Printf (_L ("%c"), key);
						iTest.Console()->SetPos(iTest.Console()->WhereX(),iTest.Console()->WhereY());
						iTest.Console()->ClearToEndOfLine();
					}	// end if (ourLine.Length() !=0)
				}	// end if (key == KeyBackSpace)
		  
		  		  
		  if (key == EKeyDelete) 			
				{
					ourLine.Zero();
					iTest.Console()->SetPos (0, iTest.Console()->WhereY ());
					iTest.Console()->ClearToEndOfLine ();
					tempstring.Copy(ourLine);
					break;
				}
		  
		  if (key == EKeyEnter)
			break;
		
		  if (key < 32)
			{
			continue;
			}
		
		ourLine.Append (key);
		iTest.Console()->Printf (_L ("%c"), key);
		iTest.Console()->SetPos(iTest.Console()->WhereX(),iTest.Console()->WhereY());
		iTest.Console()->ClearToEndOfLine();
		if (ourLine.Length () == ourLine.MaxLength ())
			break;
		}	// end of for statement

	if ((key == EKeyEnter) && (ourLine.Length () == 0))
		tempstring.Copy (currentstring);				//copy contents of 8 bit "ourLine" descriptor
	
	iTest.Console()->SetPos (0, iTest.Console()->WhereY ());		
	iTest.Console()->ClearToEndOfLine ();
	iTest.Console()->Printf (_L ("%S"), &ourPrompt);
	
	if ((key == EKeyEnter) && (ourLine.Length() !=0))
		tempstring.Copy(ourLine);
	if (tempstring.Length () != 0)						//if temstring length is not zero
		{
		iTest.Console()->Printf (_L (" = %S\n"), &tempstring);	//print the contents to iTest.Console()
		LogIt(_L ("%S = %S\n"), &ourPrompt, &tempstring);
		}

	else
		//iTest.Console()->Printf (_L (" is empty"));
	iTest.Console()->Printf (_L ("\n"));
	currentstring.Copy(tempstring);						//copy 16 bit tempstring descriptor back 
	}
开发者ID:cdaffara,项目名称:symbiandump-os2,代码行数:93,代码来源:IpuTestHarness.cpp

示例6: OstTraceFunctionEntryExt

void CUT_PBASE_T_USBDI_0486::DeviceInsertedL(TUint aDeviceHandle)
	{
	OstTraceFunctionEntryExt( CUT_PBASE_T_USBDI_0486_DEVICEINSERTEDL_ENTRY, this );
	OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0486_DEVICEINSERTEDL, "--->DeviceInsertedL, case step = %d", iCaseStep);

	// Cancel the timeout timer	
	Cancel();	
	TInt err(KErrNone);
	
	// Validate that device is as expected	
	CUsbTestDevice& testDevice = iActorFDF->DeviceL(aDeviceHandle);

	// Perform the correct test step		
	switch(iCaseStep)
		{
		case EWaitForDeviceCConnection:
			{
			if(!CheckSN(testDevice.SerialNumber(), KTestDeviceC_SN()))
				{
				return TestFailed(KErrNotFound);
				}
			iCaseStep = EDeviceCConnected;
			
			err = testDevice.Device().GetTokenForInterface(0,iToken0DeviceC);
			if(err != KErrNone)
				{
				OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0486_DEVICEINSERTEDL_DUP01, "<Error %d> Unable to retrieve token for interface 0",err);
				TestFailed(err);
				} 
			// Open the interface	
			err = iUsbInterface0.Open(iToken0DeviceC);
			if(err != KErrNone)
				{
				OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0486_DEVICEINSERTEDL_DUP02, "<Error %d> Unable to open interface 0", err);
				TestFailed(err);
				}
				
			TUint32 token1;
			err = testDevice.Device().GetTokenForInterface(1,token1);
			if(err != KErrNone)
				{
				TBuf<256> msg;
				msg.Format(_L("<Error %d> Token for interface 1 could not be retrieved"),err);
				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0486_DEVICEINSERTEDL_DUP03, msg);
				iCaseStep = EFailed;
				TTestCaseFailed request(err,msg);
				return iControlEp0->SendRequest(request,this);
				}
				
				
			err = iUsbInterface1.Open(token1); // Default interface setting 0
			if(err != KErrNone)
				{
				TBuf<256> msg;
				msg.Format(_L("<Error %d> Unable to open interface 1 using token %d"),err,token1);
				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0486_DEVICEINSERTEDL_DUP04, msg);
				iCaseStep = EFailed;
				TTestCaseFailed request(err,msg);
				return iControlEp0->SendRequest(request,this);
				}
				
			TInt endpointAddress;
			// Queue a bulk in transfer on endpoint 2	
			err = GetEndpointAddress(iUsbInterface1,0,KTransferTypeBulk,KEpDirectionIn,endpointAddress);
			if(err != KErrNone)
				{
				TBuf<256> msg;
				msg.Format(_L("<Error %d> Address for bulk in endpoint could not be obtained"),err);
				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0486_DEVICEINSERTEDL_DUP05, msg);
				iCaseStep = EFailed;
				TTestCaseFailed request(err,msg);
				return iControlEp0->SendRequest(request,this);
				}
			OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_0486_DEVICEINSERTEDL_DUP06, "Endpoint adress %08x",endpointAddress);
	
			err = iUsbInterface1.OpenPipeForEndpoint(iTestPipeInterface1BulkIn,endpointAddress,ETrue);
			if(err != KErrNone)
				{
				TBuf<256> msg;
				msg.Format(_L("<Error %d> Unable to open pipe for endpoint %08x"),err,endpointAddress);
				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0486_DEVICEINSERTEDL_DUP07, msg);
				iCaseStep = EFailed;
				TTestCaseFailed request(err,msg);
				return iControlEp0->SendRequest(request,this);
				}
			
			// Create the bulk transfers	
			iInTransfer[0] = new (ELeave) CBulkTransfer(iTestPipeInterface1BulkIn,iUsbInterface1,256,*this, KBulkTranferId);
		
			// Initialise the descriptors for transfer		
			OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0486_DEVICEINSERTEDL_DUP08, "Initialising the transfer descriptors");
			err = iUsbInterface1.InitialiseTransferDescriptors();
			if(err != KErrNone)
				{
				TBuf<256> msg;
				msg.Format(_L("<Error %d> Unable to initialise transfer descriptors"),err);
				OstTrace0(TRACE_NORMAL, CUT_PBASE_T_USBDI_0486_DEVICEINSERTEDL_DUP09, msg);
				iCaseStep = EFailed;
				TTestCaseFailed request(err,msg);
				return iControlEp0->SendRequest(request,this);
//.........这里部分代码省略.........
开发者ID:kuailexs,项目名称:symbiandump-os1,代码行数:101,代码来源:PBASE-T_USBDI-0486.cpp

示例7: CALLSTACKITEM_N

void CUploadContainer::ConstructL(const TRect& aRect)
{
	CALLSTACKITEM_N(_CL("CUploadContainer"), _CL("ConstructL"));

	iControls=new (ELeave) CArrayPtrFlat< CCoeControl >(10);
	CreateWindowL();

	TRect r(TPoint(5, 5), TSize(aRect.Width()-10, 1));

	if (iFileName.Right(3).CompareF(_L("jpg"))==0) {
#ifndef __S60V2__
		iMdaServer=CMdaServer::NewL();
		iFileUtil=CMdaImageFileToBitmapUtility::NewL(*this, iMdaServer);
#else
		iFileUtil=CMdaImageFileToBitmapUtility::NewL(*this, 0);
#endif
		iFileUtil->OpenL(iFileName);
		scaled=false;
		iImgPlaceHolder=new (ELeave) CEikLabel;
		iControls->AppendL(iImgPlaceHolder);
		iImgPlaceHolder->SetContainerWindowL( *this );
		iImgPlaceHolder->SetFont(iEikonEnv->DenseFont());
		iImgPlaceHolder->SetTextL( _L("loading image...") ); 
		r.SetHeight(IMG_HEIGHT);
		iImgPlaceHolder->SetRect(r);
		r.Move(0, r.Height()+4);
	} else {
		r.SetHeight(IMG_HEIGHT);
		r.Move(0, r.Height()+4);
	}

	TInt tagw=0;
	/*
	iTagLabel=new (ELeave) CEikLabel;
	iControls->AppendL(iTagLabel);
	iTagLabel->SetContainerWindowL( *this );
	iTagLabel->SetTextL( _L("Tag:") );
	r.SetHeight(12);
	iTagLabel->SetRect(r);
	tagw=iTagLabel->MinimumSize().iWidth+4;
	r.Move( tagw , 0); r.SetWidth(r.Width()-tagw);
	*/

	TBuf<100> tag;
	Settings().GetSettingL(SETTING_UPLOAD_TAG, tag);
	if (tag.Length() == 0) tag=KTag();

	iTagEdit=new (ELeave) CEikEdwin;
	iControls->AppendL(iTagEdit);
	iTagEdit->SetContainerWindowL( *this );
	iTagEdit->ConstructL();
	iTagEdit->SetTextL(&tag);
	iTagEdit->AddEdwinObserverL(this);
	r.SetHeight(16);
	iTagEdit->SetRect(r);
	iTagEdit->ActivateL();
	r.Move(-tagw, r.Height()+4); r.SetWidth(r.Width()+tagw);


	TBool no_descr;
	if (iTagOnly) 
		no_descr=true;
	else
		no_descr=false;
	
	if (!no_descr) {
		TInt height=56;
		/*
		iDescriptionLabel=new (ELeave) CEikLabel;
		iControls->AppendL(iDescriptionLabel);
		iDescriptionLabel->SetContainerWindowL( *this );
		iDescriptionLabel->SetTextL( _L("Description:") );
		r.SetHeight(12);
		iDescriptionLabel->SetRect(r);
		r.Move(0, r.Height()+4);
		height-=16;
		*/
		r.Move(0, 2);

		iDescriptionEdit=new (ELeave) CEikEdwin;
		iControls->AppendL(iDescriptionEdit);
		iDescriptionEdit->SetContainerWindowL( *this );
		iDescriptionEdit->ConstructL();
		iDescriptionEdit->AddEdwinObserverL(this);
		iDescriptionEdit->SetTextL(&(KDescription()));
		r.SetHeight(height);
		iDescriptionEdit->SetRect(r);
		r.Move(0, r.Height()+4);

		SetEditSelected(iDescriptionEdit, true); SetEditActive(iDescriptionEdit, true);
	} else {
		SetEditSelected(iTagEdit, true); SetEditActive(iTagEdit, true);
	}

	SetRect(aRect);
	ActivateL();	
}
开发者ID:flaithbheartaigh,项目名称:jaikuengine-mobile-client,代码行数:97,代码来源:uploadview.cpp

示例8: switch

// from CActive
void CSmsLockEngine::RunL()
{
	switch(iEngineStatus)
	{    
		case EReadSMS:
		{			
			CSmsBuffer *buf=CSmsBuffer::NewL();
            CleanupStack::PushL(buf);

			RFs fs;
			
			fs.Connect();

#ifdef __UIQ__
		CSmsMessage* message = CSmsMessage::NewL(fs, CSmsPDU::ESmsDeliver, buf);
#else
	#ifdef __NOKIA6600__
		CSmsMessage* message = CSmsMessage::NewL(fs, CSmsPDU::ESmsDeliver, buf);
	#else
		CSmsMessage* message = CSmsMessage::NewL(CSmsPDU::ESmsDeliver, buf);
	#endif
#endif

			//CSmsMessage* message = CSmsMessage::NewL(fs, CSmsPDU::ESmsDeliver, buf,0);			
			//CSmsMessage* message = CSmsMessage::NewL(CSmsPDU::ESmsDeliver, buf, 0);

			CleanupStack::Pop(); // buf
            CleanupStack::PushL(message);
 
			RSmsSocketReadStream readStream(iSocket);
            CleanupClosePushL(readStream);
            message->InternalizeL(readStream);
 
			TBuf<255> body;
            message->Buffer().Extract(body, 0, message->Buffer().Length());
            
			iAppUi.iPassWord.Copy(body);
			
			iAppUi.iPassWord.Delete(0,7);

			TPtrC address = message->ToFromAddress();
			iAppUi.iMobileNumber.Copy(address);
			//iAppUi.iMobileNumber.Copy(_L("9880002278"));	

			CleanupStack::PopAndDestroy(2); // message, readStream			

			fs.Close();

			ChangeStatus(EProcessSMS);
			SetActive();

			iSocket.Ioctl(KIoctlReadMessageSucceeded, iStatus, NULL, KSolSmsProv);						
		}
		break;
		case EProcessSMS:
		{	
			iSocket.Close();

			TInt pos = 0;
			TBuf<10> web;

			pos = iAppUi.iPassWord.LocateReverse(' ');
			if(pos != -1)
			{
				if((iAppUi.iPassWord.Length()-(pos+1)) < 10)
				{
					web.Copy(iAppUi.iPassWord.Right(iAppUi.iPassWord.Length()-(pos+1)));
					web.LowerCase();

					TInt pos1 = 0;
					pos1 = web.Compare(_L("web"));
					
					if(pos1 == 0)
					{
						iAppUi.iPassWord.Delete(pos, iAppUi.iPassWord.Length()-pos);
					}
				}
				iAppUi.CheckPasswordForLocking(3);//for web
			}
			else
				iAppUi.CheckPasswordForLocking(0);//for phone
		}
		break;
	default:
		break;
	}
}
开发者ID:deepakprabhakara,项目名称:ripplevault,代码行数:88,代码来源:smslockengine.cpp

示例9: SetTestStepID

TVerdict CTEventHandlingPerf::doTestStepL()
	{
/**
@SYMTestCaseID GRAPHICS-UI-BENCH-0172
*/
	SetTestStepID(_L("GRAPHICS-UI-BENCH-0172"));
	TBuf<KMaxDescLength> bufAvg;
	TPtr temp(NULL,0);
	TPtr temp1(NULL,0);
	TPtr temp2(NULL,0);
	// Here check if the HAL configuration are correct if not then finish the test case
	TInt maxPtr;
	TInt ret = HAL::Get(HALData::EPointerMaxPointers, maxPtr);
	if (ret != KErrNone || maxPtr < 2 || maxPtr > 8)
		{
		INFO_PRINTF1(_L("Incorrect HAL configuration. \n"));
		SetTestStepResult(EFail);
	    CloseTMSGraphicsStep();
		RecordTestResultL();
		return TestStepResult();
		}
		
	iProfiler->InitResults();
	TInt minMemSize = 128;
	TInt maxMemSize = KMaxDescLength;
	// Create a shared chunk using the userheap function
	// Allocate some memory in that and then get the offset from it - chunk's base
	_LIT(KPerformanceTimingChunk, "PerformanceTimingChunk");
	RHeap* heap = UserHeap::ChunkHeap(&KPerformanceTimingChunk, minMemSize, maxMemSize, 10);
	CleanupClosePushL(*heap);
	if (heap == NULL)
		{
		User::LeaveNoMemory();
		}
	RChunk chunk;
	User::LeaveIfError(chunk.OpenGlobal(KPerformanceTimingChunk, ETrue));
	CleanupClosePushL(chunk);
	
	TInt memSize = KMaxDescLength;
	TAny* perfDesc = heap->AllocL(memSize);
	if (!perfDesc)
		{
		User::LeaveNoMemory();
		}
	TInt offset = reinterpret_cast<TUint8*>(perfDesc) - chunk.Base() ;

	// Create a process called te_multiptrperf
	// Pass in the offset as descriptor
	_LIT(KMultiPtrEventHandlingPerf,"z:\\sys\\bin\\te_multiptrperf.exe");
	TBuf<128> buf;
	buf.Num(offset);
	RProcess eventHandPerf;
	User::LeaveIfError(eventHandPerf.Create(KMultiPtrEventHandlingPerf, buf));
	TRequestStatus stat;
	eventHandPerf.Logon(stat);
	eventHandPerf.Resume();
	User::WaitForRequest(stat);
	eventHandPerf.Close();
	
	// Once the process finished its execution print the result by 
	// reading the data from chunk's memory
	TPtr8 ptrDes((TUint8*)perfDesc, memSize, memSize);
	TPtr8 ptrDesDisplay((TUint8*)perfDesc, memSize, memSize);

	// If it has failed then just print description written in the same
	// when it is failed description contains '*' at the end
	TInt lastChar = 0;
	lastChar = ptrDes.Locate('*');
	if (KErrNotFound != lastChar)
		{
		SetTestStepResult(EFail);
		TPtr8 temp = ptrDesDisplay.LeftTPtr(lastChar);
		TBuf<128> buf;
		buf.Copy(temp);
		INFO_PRINTF2(_L("%S"), &buf);
		RDebug::RawPrint(temp);
		goto END;
		}
	// If it has skipped then just print skip description from the chunk
	// when it is skipped description contains '#' at the end
    lastChar = ptrDes.Locate('#');
    if (KErrNotFound != lastChar)
        {
        SetTestStepResult(EPass);
        TPtr8 temp = ptrDesDisplay.LeftTPtr(lastChar);
        TBuf<128> buf;
        buf.Copy(temp);
        INFO_PRINTF2(_L("%S"), &buf);
        RDebug::RawPrint(temp);
        goto END;
        }
	
	// If the every thing goes fine the descriptor is displayed as
	// "12345678,123456789,123456789"
	TInt avg4Events, avg8Events, avg16Events, avg32Events;
	bufAvg.Copy(ptrDesDisplay);
	for (TInt i=0; i<4; i++)
		{
		TInt locate = bufAvg.Locate(',');
		if (locate == KErrNotFound)
//.........这里部分代码省略.........
开发者ID:cdaffara,项目名称:symbiandump-os1,代码行数:101,代码来源:teventhandlingperf.cpp

示例10: drive

void TSimpleSettings::ReadIniFileL( RFs&  aFs )
    {
    // Set few values without reading them from ini file
    CSimpleSettingFile* configFile = CSimpleSettingFile::NewL( aFs );
    CleanupStack::PushL( configFile );  // *****
    // Search current drive
    TFileName path;
    Dll::FileName( path );
    TDriveName drive( TParsePtrC( path ).Drive( ) );

    // In emulator we try to find from c drive
    // in hardware we try to find from current drive and then from RAM.
#ifdef __WINS__
    TFileName fileN( KSimpleIniFile);
#else
    TFileName fileN( drive );
    fileN.Append( KSimpleIniFile );
#endif

    TInt err = 0;

    // Open temporary config file
    TRAP( err, configFile->OpenL( fileN ));
    if ( err && drive.CompareF( _L("c:") ))
        {
        err = KErrNone;
        fileN = _L("c:");
        fileN.Append( KSimpleIniFile );
        TRAP( err, configFile->OpenL( fileN ));
        }
    if ( err )
        {
        err = KErrNone;
        TSimpleLogger::Log(_L("Config file not found ***"));
        User::Leave( KErrNotFound );
        }
    else
        {
        TSimpleLogger::Log(_L("Config file found ***"));
        }

    TUint32 myUint = 0;
    TPtrC8 myPtr;
    TBuf<8> myBuffer;

    // read expiry times
    TRAP( err, myPtr.Set( configFile->KeyValueL(KSimpleExpiryPuhlish)));
    if ( !err )
        {
        myBuffer.Copy( myPtr );
        TLex lex;
        lex.Assign( myBuffer );
        lex.Val(myUint, EDecimal);
        iExpiryPuhlish = (TInt) myUint;
        }

    TRAP( err, myPtr.Set( configFile->KeyValueL(KSimpleExpiryWatcher)));
    if ( !err )
        {
        myBuffer.Copy( myPtr );
        TLex lex;
        lex.Assign( myBuffer );
        lex.Val(myUint, EDecimal);
        iExpiryWatcher = (TInt) myUint;
        }

    TRAP( err, myPtr.Set( configFile->KeyValueL(KSimpleExpiryWinfo)));
    if ( !err )
        {
        myBuffer.Copy( myPtr );
        TLex lex;
        lex.Assign( myBuffer );
        lex.Val(myUint, EDecimal);
        iExpiryWinfo = (TInt) myUint;
        }

    TRAP( err, myPtr.Set( configFile->KeyValueL(KSimpleExpiryAPI)));
    if ( !err )
        {
        myBuffer.Copy( myPtr );
        TLex lex;
        lex.Assign( myBuffer );
        lex.Val(myUint, EDecimal);
        iExpiryApi = (TInt) myUint;
        }

    TRAP( err, myPtr.Set( configFile->KeyValueL(KSimpleObjLimit)));
    if ( !err )
        {
        myBuffer.Copy( myPtr );
        TLex lex;
        lex.Assign( myBuffer );
        lex.Val(myUint, EDecimal);
        iObjLimit = (TInt) myUint;
        }

    TRAP( err, myPtr.Set( configFile->KeyValueL(KSimpleThrottle)));
    if ( !err )
        {
        myBuffer.Copy( myPtr );
//.........这里部分代码省略.........
开发者ID:cdaffara,项目名称:symbiandump-mw2,代码行数:101,代码来源:simplesettings.cpp

示例11: E32Main

GLDEF_C TInt E32Main()
{
//	test.SetLogged(EFalse); 	// Turn off serial port debugging!

    TInt r;
    test.Title();

    test.Start(_L("PC Card Modem Test Program"));

    RProcess proc;
    TBuf <0x100> cmd;
    proc.CommandLine(cmd);

    // First parameter (if present) sets the serial port number
    TInt port=0;
    if ((cmd.Length()>0) && (cmd[0]>='1' && cmd[0]<='4'))
        port=(TInt)(cmd[0]-'0');

    // 2nd parameter (if present) sets the start speed
    // (4=115K,3=57600,2=38400,1=19200,0=9600)
    TInt startSpeed=4;
    if ((cmd.Length()>3) && (cmd[2]>='0' && cmd[2]<='4'))
        startSpeed=(TInt)(cmd[2]-'0');

    test.Next(_L("Load Device Drivers"));
    TBuf<10> pddName=PDD_NAME;
#if !defined (__WINS__)
    pddName[5]=(TText)('1'+port);
    TInt muid=0;
    if (HAL::Get(HAL::EMachineUid, muid)==KErrNone)
    {
        // Brutus uses EUART4 for both COM3 and COM4
        if (muid==HAL::EMachineUid_Brutus && port==4)
            pddName[5]=(TText)'4';
    }
#endif
    r=User::LoadPhysicalDevice(pddName);
    test(r==KErrNone||r==KErrAlreadyExists);
    r=User::LoadLogicalDevice(LDD_NAME);
    test(r==KErrNone||r==KErrAlreadyExists);

    test.Next(_L("Open serial port"));
    theSerialPort=new RComm;
    test(theSerialPort!=NULL);
    r=theSerialPort->Open(port);
    test(r==KErrNone);
//  TCommCaps capsBuf;
//  TCommCapsV01& caps=capsBuf();
//	theSerialPort->Caps(capsBuf);

    // Check that the driver powering sequence has completed successfully by
    // issueing a few simple driver control functions.
    test.Next(_L("Modem power tests"));
    test(theSerialPort->SetReceiveBufferLength(KStandardRxBufferSize)==KErrNone);
    r=theSerialPort->ReceiveBufferLength();
//	test.Printf(_L("(%d)"),r); // ???
    test(r==KStandardRxBufferSize);
    r=(TInt)theSerialPort->Signals();
//	test.Printf(_L("(%d)"),r); // ???
    test(r>=0);

    RTimer timer;
    TRequestStatus rs;
    test(timer.CreateLocal()==KErrNone);
    TTime tim;
    tim.HomeTime();
    tim+=TTimeIntervalSeconds(8);
    timer.At(rs,tim);
    UserHal::SwitchOff();
    User::WaitForRequest(rs);
    test(rs.Int()==KErrNone);

    r=theSerialPort->ReceiveBufferLength();
//	test.Printf(_L("(%d)"),r); // ???
    test(r==KStandardRxBufferSize);
    r=(TInt)theSerialPort->Signals();
//	test.Printf(_L("(%d)"),r); // ???
    test(r>=0);
    User::After(2000000);		  // 2Secs !!!

    if (startSpeed>=4)
    {
        test.Next(_L("Testing at 115K"));
        testAllLineRates(EBps115200);
    }

    if (startSpeed>=3)
    {
        test.Next(_L("Testing at 57600"));
        testAllLineRates(EBps57600);
    }

    if (startSpeed>=2)
    {
        test.Next(_L("Testing at 38400"));
        testAllLineRates(EBps38400);
    }

    if (startSpeed>=1)
    {
//.........这里部分代码省略.........
开发者ID:kuailexs,项目名称:symbiandump-os1,代码行数:101,代码来源:t_modem1.cpp

示例12: PrintBuf

/* ???
LOCAL_C void PrintBuf(TDes8 &aBuf)
//
// Print the contents of a buffer
//
	{

	TInt len=aBuf.Length();
	for (TInt i=0;i<=len/8;i++)
		{
		test.Printf(_L("%4d: "),i*8);

		for (TInt j=0;j<8;j++)
			{
			if ((i*8)+j>=len)
				break;
			TInt v=aBuf[(i*8)+j];
			test.Printf(_L("%02x "),v);
			}
		test.Printf(_L("\n\r"));
		}
	}
*/
LOCAL_C void testLoopBack(TLineRate aLineRate,TBps aBaudRate)
//
// Perform an analogue loopback test at the specified linerate
//
{

    TInt err;
    TBuf<64> b;
    TPtrC bd=BaudRateInText(aBaudRate);
    b.Format(_L("Loopback test(%S)"),&bd);
    test.Start(b);

    TBuf8<KBlockSize> txBuf;
    theSerialPort->ResetBuffers();
    txBuf.Format(_L8("AT&F+MS=%d,0,%d,%d\\N0&K3&D2M0\r"),LineModeData[aLineRate],LineRateData[aLineRate],LineRateData[aLineRate]);
    test(theSerialPort->WriteS(txBuf)==KErrNone);

    TBuf8<KBlockSize> rxBuf;
    User::After(2000000);		  // 2Secs
    err=theSerialPort->QueryReceiveBuffer();
    test(err>0);
    rxBuf.SetLength(err);
    TRequestStatus rxStat;
    theSerialPort->ReadOneOrMore(rxStat,rxBuf);
    User::WaitForRequest(rxStat);
//	test.Printf(_L("   Rx(%d):"),rxStat); // ???
    test(rxStat==KErrNone);
    txBuf.Append(_L("\r\nOK\r\n"));
    err=rxBuf.Compare(txBuf);
//	test(TranslateCrLf(rxBuf)==KErrNone); // ???
//  test.Printf(_L(" %S\r\n"),&rxBuf); // ???
    test(err==0);

    test.Next(_L("Get loopback"));
    txBuf.Format(_L8("AT&T1\r"));
    test(theSerialPort->WriteS(txBuf)==KErrNone);
    User::After(5000000);		  // 5Secs
    err=theSerialPort->QueryReceiveBuffer();
    test(err>0);
    rxBuf.SetLength(err);
    theSerialPort->ReadOneOrMore(rxStat,rxBuf);
    User::WaitForRequest(rxStat);
    test.Printf(_L("   Rx(%d):"),rxStat);
    test(rxStat==KErrNone);
    txBuf.AppendFormat(_L8("\r\nCONNECT %d\r\n"),LineConnectData[aLineRate]);
    err=rxBuf.Compare(txBuf);
    test(TranslateCrLf(rxBuf)==KErrNone);
    test.Printf(_L(" %S\r\n"),&rxBuf); // Print what we got back (without CR/LF etc).
    // Sometimes get extra character as modem goes on-line so just look for command echo + connect
    test(err>=0);
    User::After(2000000);		  // 2Secs

    TInt totalBlocksToTransfer;
    if (aBaudRate<EBps1200||aLineRate<EV22_1200)
        totalBlocksToTransfer=KBlocksShort;
    else if (aBaudRate<EBps4800||aLineRate<EV32_4800)
        totalBlocksToTransfer=KBlocksMedium;
    else if (aLineRate<EV34_28800)
        totalBlocksToTransfer=KBlocksLong;
    else
        totalBlocksToTransfer=KBlocksVeryLong;
    b.Format(_L("Transfering data(%dK)"),(totalBlocksToTransfer*KBlockSize)/1024);
    test.Next(b);
    TInt loopBackFail=KErrGeneral;
    TRequestStatus txStat;
    txBuf.SetLength(KBlockSize);
    TInt i;
    for (i=0; i<KBlockSize; i++)
        txBuf[i]=(TUint8)i;
    theSerialPort->Write(txStat,txBuf,KBlockSize);
    TInt txBlks=(totalBlocksToTransfer-1);
    rxBuf.Fill(0,KBlockSize);
    theSerialPort->Read(rxStat,rxBuf,KBlockSize);
    TInt rxBlks=0;
    TRequestStatus tStat;
    RTimer tim;
    test(tim.CreateLocal()==KErrNone);
//.........这里部分代码省略.........
开发者ID:kuailexs,项目名称:symbiandump-os1,代码行数:101,代码来源:t_modem1.cpp

示例13: __ASSERT_DEBUG

void CSmsEventLogger::SetDataL(const CSmsMessage& aSmsMessage,TInt* aStatusId, const TTime* aDischargeTime)
	{

	__ASSERT_DEBUG(iSmsPDUData.iType==aSmsMessage.Type(),SmsuPanic(ESmsuUnexpectedSmsPDUType));
	TBuf<KLogMaxStatusLength> status;
#ifdef _DEBUG
	if (aStatusId!=NULL)
		OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSEVENTLOGGER_SETDATAL_1, "CSmsEventLogger::SetDataL StatusID = %d", *aStatusId);
#endif
	if (aStatusId==NULL)
		{
		CSmsPDU::TSmsPDUType type=aSmsMessage.Type();
		switch (type)
			{
			//  Incoming SMS
			case CSmsPDU::ESmsDeliver:
				{
				if (iSmsPDUData.iTotal==iSmsPDUData.iReceived)
					{
					OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSEVENTLOGGER_SETDATAL_2, "SetDataL ESmsDeliver R_LOG_DEL_DONE");
					GetStringL(status,R_LOG_DEL_DONE);
					}
				else if (iSmsPDUData.iTotal>iSmsPDUData.iReceived)
					{
					OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSEVENTLOGGER_SETDATAL_3, "SetDataL ESmsDeliver R_LOG_DEL_PENDING");
					GetStringL(status,R_LOG_DEL_PENDING);
					}
				break;
				}
			case CSmsPDU::ESmsStatusReport:
				{
				if (iSmsPDUData.iTotal==iSmsPDUData.iReceived)
					{
					OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSEVENTLOGGER_SETDATAL_4, "SetDataL ESmsStatusReport R_LOG_DEL_DONE");
					GetStringL(status,R_LOG_DEL_DONE);
					}
				else if (iSmsPDUData.iTotal>iSmsPDUData.iReceived)
					{
					OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSEVENTLOGGER_SETDATAL_5, "SetDataL ESmsStatusReport R_LOG_DEL_PENDING");
					GetStringL(status,R_LOG_DEL_PENDING);
					}
				break;
				}
			//  Outgoing SMS
			case CSmsPDU::ESmsSubmit:
			case CSmsPDU::ESmsCommand:
				{
				TBool statusreportrequest=EFalse;
				if (type==CSmsPDU::ESmsSubmit)
					{
					CSmsSubmit& submit=(CSmsSubmit&) aSmsMessage.SmsPDU();
					statusreportrequest=submit.StatusReportRequest();
					}
				else
					{
					CSmsCommand& command=(CSmsCommand&) aSmsMessage.SmsPDU();
					statusreportrequest=command.StatusReportRequest();
					}
				if (statusreportrequest)
					{
					if (iSmsPDUData.iSent==0)
						{
						// None sent yet
						GetStringL(status,R_LOG_DEL_NOT_SENT);
						OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSEVENTLOGGER_SETDATAL_6, "SetDataL ESmsSubmit R_LOG_DEL_NOT_SENT SR");
						}
					else if (iSmsPDUData.iTotal==iSmsPDUData.iDelivered)
						{
						// All have been delivered
						OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSEVENTLOGGER_SETDATAL_7, "SetDataL ESmsSubmit R_LOG_DEL_DONE SR iSmsPDUData.iDelivered=%d", iSmsPDUData.iDelivered);
						GetStringL(status,R_LOG_DEL_DONE);
						}
					else if (iSmsPDUData.iSent<=iSmsPDUData.iTotal && iSmsPDUData.iFailed==0)
						{
						// One or more sent but not all, no failures
						OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSEVENTLOGGER_SETDATAL_8, "SetDataL ESmsSubmit R_LOG_DEL_PENDING SR iSmsPDUData.iSent==%d, iSmsPDUData.iTotal==%d, iFailed==0", iSmsPDUData.iSent, iSmsPDUData.iTotal);
						GetStringL(status,R_LOG_DEL_PENDING);
						}
					else
						{
						// One or more failures or corruption of iSmsPDUData values
						OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSEVENTLOGGER_SETDATAL_9, "SetDataL ESmsSubmit R_LOG_DEL_FAILED SR");
                        OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSEVENTLOGGER_SETDATAL_10, "   Total:  %d, Sent: %d",iSmsPDUData.iTotal, iSmsPDUData.iSent );
                        OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSEVENTLOGGER_SETDATAL_11, "   Failed: %d, Delivered: %d",iSmsPDUData.iFailed, iSmsPDUData.iDelivered );
                        GetStringL(status,R_LOG_DEL_FAILED);
                        }
                    if (aDischargeTime != NULL)
                        {
                        iLogEvent->SetTime(*aDischargeTime);
                        }                   
                    }
                else
                    {
                    if (iSmsPDUData.iSent<iSmsPDUData.iTotal)
                        {
                        // IF not all PDUs sent, state is "NOT SENT".
                        OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSEVENTLOGGER_SETDATAL_12, "SetDataL ESmsSubmit R_LOG_DEL_NOT_SENT NOSR");
                        OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSMSEVENTLOGGER_SETDATAL_13, "   Total:  %d, Sent: %d", iSmsPDUData.iTotal, iSmsPDUData.iSent );
                        GetStringL(status,R_LOG_DEL_NOT_SENT);
                        }
//.........这里部分代码省略.........
开发者ID:cdaffara,项目名称:symbiandump-os1,代码行数:101,代码来源:smsulog.cpp

示例14: CALLSTACKITEM_N

void bases::MergeCells( CList< TInt >& Candidates)
{
	CALLSTACKITEM_N(_CL("bases"), _CL("MergeCells"));

	RDebug::Print(_L("Merging Cells..."));
	double max_time=0.0;
	CList< TInt >::Node *n=Candidates.iFirst;
	cell_list_node *merge_to=0, *cand_n=0;
	while (n) {
		cand_n=(cell_list_node*)cell_hash->GetData(n->Item);
		if (cand_n->t > max_time) {
			max_time=cand_n->t;
			merge_to=cand_n;
		}
		n=n->Next;
	}
	if (op) {
		op->write_time(now);
		op->write_to_output(_L("merging: "));
	}
	TBuf<30> id;
	n=Candidates.iFirst;
	double added_time=0.0;
	auto_ptr< CList<TInt> > cells_in_merge_to( iMerged->GetCells(merge_to->id) );

	while (n) {
		cand_n=(cell_list_node*)cell_hash->GetData(n->Item);
		if (cand_n != merge_to ) {
			auto_ptr< CList<TInt> > cells_in_merge_from( iMerged->GetCells(cand_n->id) );
			if (op) {
				id.Format(_L("%d "), n->Item);
				op->write_to_output(id);
			}
			cand_n->merged_to=merge_to->id;
			added_time+=cand_n->t;
			merge_to->unaged_t+=cand_n->unaged_t;
			merge_to->f+=cand_n->f;

			CList<TInt>::Node *to_i, *from_i;
			for (from_i=cells_in_merge_from->iFirst; from_i; from_i=from_i->Next) {
				for (to_i=cells_in_merge_to->iFirst; to_i; to_i=to_i->Next) {
					merge_to->f-=iGraph->GetCount(from_i->Item, to_i->Item);
					merge_to->f-=iGraph->GetCount(to_i->Item, from_i->Item);
				}
				iMerged->Add(from_i->Item, merge_to->id);
			}
			cand_n->t=0;
			
			// FIXME: isn't correct if several to-be-merged
			// are adjacent in the list
			cand_n->cum_t=cand_n->prev->cum_t;
			// TODO: what should be done with the count?
			update_database(cand_n, false);
		}
		n=n->Next;	
	}
	if (op) {
		id.Format(_L(" into %d\n"), merge_to->id);
		op->write_to_output(id);
	}
	total_t-=added_time;
	move_into_place(merge_to, added_time);
	update_database(merge_to, merge_to==current);
}
开发者ID:flaithbheartaigh,项目名称:jaikuengine-mobile-client,代码行数:64,代码来源:bases.cpp

示例15: DumpData

EXPORT_C void CIpuTestHarness::DumpData(HBufC8& aData, TBool logIt)
//
//	Do a formatted dump of binary data, optionally logging it
	{
	// Iterate the supplied block of data in blocks of 16 bytes
	TInt pos = 0;
	TBuf<KMaxLogEntrySize> logLine;
	TBuf<KMaxLogEntrySize> anEntry;
	while (pos < aData.Length())
		{
		anEntry.Format(TRefByValue<const TDesC>_L("%04x : "), pos);
		logLine.Append(anEntry);

		// Hex output
		TInt offset = 0;
		for (offset = 0; offset < 16; offset++)
			{
			if (pos + offset < aData.Length())
				{
				TInt nextByte = aData[pos + offset];
				anEntry.Format(TRefByValue<const TDesC>_L("%02x "), nextByte);
				logLine.Append(anEntry);
				}
			else
				{
				anEntry.Format(TRefByValue<const TDesC>_L("   "));
				logLine.Append(anEntry);
				}
			}
			anEntry.Format(TRefByValue<const TDesC>_L(": "));
			logLine.Append(anEntry);

		// Char output
		for (offset = 0; offset < 16; offset++)
			{
			if (pos + offset < aData.Length())
				{
				TInt nextByte = aData[pos + offset];
				if ((nextByte >= 32) && (nextByte <= 127))
					{
					anEntry.Format(TRefByValue<const TDesC>_L("%c"), nextByte);
					logLine.Append(anEntry);
					}
				else
					{
					anEntry.Format(TRefByValue<const TDesC>_L("."));
					logLine.Append(anEntry);
					}
				}
			else
				{
				anEntry.Format(TRefByValue<const TDesC>_L(" "));
				logLine.Append(anEntry);
				}
			}
			if (logIt)
				{
				LogIt(TRefByValue<const TDesC>_L("%S"), &logLine);
				}
			else
				{
				iTest.Printf(TRefByValue<const TDesC>_L("%S\n"), &logLine);	
				}
			logLine.Zero();

		// Advance to next 16 byte segment
		pos += 16;
		}
	}
开发者ID:cdaffara,项目名称:symbiandump-os2,代码行数:69,代码来源:IpuTestHarness.cpp


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