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


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

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


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

示例1: RunL

void CMobilePhone::RunL(void)
{
  TBuf16<128> string;
  if(iStatus==KErrNone)
  {
    string.Append(_L("Success."));
  }
  else
  {
    string.Append(_L("Error ("));
    string.AppendNum(iStatus.Int());
    string.Append(_L(")."));
  }
  ShowResult(string);
}
开发者ID:flaithbheartaigh,项目名称:almalert,代码行数:15,代码来源:NetmonPhone.cpp

示例2: ReleaseDisk

// -----------------------------------------------------------------------------
// CSdDisk::ReleaseFiles
// This method deletes files created for filling the drive C
// 
// -----------------------------------------------------------------------------
void CSdDisk::ReleaseDisk(RFs& aFs)
    {
	// RDebug::Print(_L("Shareddatatest ## ReleaseDisk"));
	TInt i = 0;
	TInt err = KErrNone;
		
	do
	    {
		TBuf16<35> str;
		str.Copy(KFileName);
		str.AppendNum(i,EDecimal);
		
		err = aFs.Delete (str) ;
		
		i++;
	    }
	while ( err == KErrNone );
}
开发者ID:cdaffara,项目名称:symbiandump-os1,代码行数:23,代码来源:Tfdosshareddatatc.cpp

示例3: SetNextPoint

TBool CTe_LbsIniFileReader::SetNextPoint()
{
    iIndex++;

    TBuf16<128> findText;

    findText.Zero();
    findText.Append(_L("["));
    findText.AppendNum(iIndex);
    findText.Append(_L("]"));

    iPoint = iPtr.Find(findText);

    if (iPoint == KErrNotFound)
    {
        return(EFalse);
    }

    return(ETrue);
}
开发者ID:kuailexs,项目名称:symbiandump-os1,代码行数:20,代码来源:te_lbsinifilereader.cpp

示例4: HandleCommandL

// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
//
void CPixelMetricsMapperAppUi::HandleCommandL( TInt aCommand )
    {
    switch ( aCommand )
        {
        case EAknSoftkeyExit:
        case EEikCmdExit:
            Exit();
            break;
        case ECmdSwitchOutput:
            {
            HBufC* buffer = HBufC::NewLC( 100 );
            TPtr bufferPtr = buffer->Des();
            TBool last = ETrue;
            bufferPtr.Append(_L("Output switched to "));
            iFileOutputOn = !iFileOutputOn;
            if (iFileOutputOn)
                bufferPtr.Append(_L("file."));
            else
                bufferPtr.Append(_L("screen."));
            ShowL( *buffer, last );
            CleanupStack::PopAndDestroy( buffer );
            }
            break;
        case ECmdStatus:
            {
            ClearL();

            // layout
            HBufC* buffer = HBufC::NewLC( 100 );
            TPtr bufferPtr = buffer->Des();
            TBool last = ETrue;

            // Orientation
            bufferPtr.Append(_L("Orientation: "));
            bufferPtr.AppendNum((TInt)iAvkonAppUi->Orientation());
            ShowL( *buffer, last );
            bufferPtr.Zero();

            // Output
            bufferPtr.Append(_L("Output: "));
            if (iFileOutputOn) bufferPtr.Append(_L("File"));
            else bufferPtr.Append(_L("Screen"));
            ShowL( *buffer, last );
            bufferPtr.Zero();

            CAknLayoutConfig::TScreenMode localAppScreenMode = CAknSgcClient::ScreenMode();
            TInt hashValue = localAppScreenMode.ScreenStyleHash();
            TPixelsTwipsAndRotation pixels = CAknSgcClient::PixelsAndRotation();
            TSize pixelSize = pixels.iPixelSize;

            bufferPtr.Append(_L("LayoutName: "));

            if ( (pixelSize.iWidth == 320 || pixelSize.iWidth == 240 )&&
                 (pixelSize.iHeight == 320 || pixelSize.iHeight == 240 ))
                 {
                if (hashValue==0x996F7AA7)
                    bufferPtr.Append(_L("QVGA2"));
                else
                    bufferPtr.Append(_L("QVGA1"));
                }
            else if ((pixelSize.iWidth == 640 || pixelSize.iWidth == 360 )&&
                    (pixelSize.iHeight == 360 || pixelSize.iHeight == 640 ))
                {
                bufferPtr.Append(_L("nHD"));
                }
            else if ((pixelSize.iWidth == 640 || pixelSize.iWidth == 480 )&&
                    (pixelSize.iHeight == 480 || pixelSize.iHeight == 640 ))
                {
                bufferPtr.Append(_L("VGA"));
                }
            else if ((pixelSize.iWidth == 352 || pixelSize.iWidth == 800 )&&
                    (pixelSize.iHeight == 800 || pixelSize.iHeight == 352 ))
                {
                bufferPtr.Append(_L("E90"));
                }
            else if ((pixelSize.iWidth == 320 || pixelSize.iWidth == 480 ||
                      pixelSize.iWidth == 240 || pixelSize.iWidth == 640 )&&
                    (pixelSize.iHeight == 320 || pixelSize.iHeight == 480 ||
                     pixelSize.iHeight == 240 || pixelSize.iHeight == 640))
                {
                bufferPtr.Append(_L("HVGA"));
                }
            else if ((pixelSize.iWidth == 480 || pixelSize.iWidth == 854 ||
                      pixelSize.iWidth == 848 || pixelSize.iWidth == 800 )&&
                    (pixelSize.iHeight == 800 || pixelSize.iHeight == 480 ||
                     pixelSize.iHeight == 848 || pixelSize.iHeight == 854))
                {
                bufferPtr.Append(_L("WVGA"));
                }
            else
                {
                bufferPtr.Append(_L("Unknown"));
                }

            ShowL( *buffer, last );
            bufferPtr.Zero();
//.........这里部分代码省略.........
开发者ID:mpvader,项目名称:qt,代码行数:101,代码来源:pm_mapperapp.cpp

示例5: FillDisk

// -----------------------------------------------------------------------------
// CSdDisk::FillDisk()
// Fills the diskspace 
// 
// -----------------------------------------------------------------------------
void CSdDisk::FillDisk(RFs& aFs, TInt& aFreeDiskSpaceToLeave)
    {
	RFile iEaterFile;
	TInt fileSize(0);	
	TInt err(KErrNone);
	
	TReal64 diskFree = CheckDiskSpace(aFs);
	// RDebug::Print(_L("Shareddatatest ## Eat disk space") );
	
	// For loop to create eaterfiles
	for ( TInt i = 0 ; diskFree != 0 ; i++ )
	    {	
		TBuf16<30> str;
		str.Copy(KFileName);
		str.AppendNum(i,EDecimal);
			
		// RDebug::Print(_L("Shareddatatest ## Open file %s"), &str);
	
		err = iEaterFile.Open( aFs, str, EFileShareAny | EFileWrite );

		if ( err == KErrNotFound )	// file does not exist - create it
		    {
			err = iEaterFile.Create( aFs, str, EFileShareAny | EFileWrite );
		    }

		if ( err == KErrNone )
		    {
			// Create maximum size eaterfile if there is more disk space available than the maximum file size
			if ( diskFree > TReal64(KMaxTInt) )
			    {
				// RDebug::Print( _L("Shareddatatest ## Creating %d. EaterFile"), i+1);
				err = iEaterFile.SetSize( KMaxTInt );
				
				diskFree = diskFree - TReal64(KMaxTInt);
			    }
			
			// ... And if available disk space is less than maximum file size
			else
			    {
				// If aFreeDiskSpaceToLeave parameter says we have to leave some free disk
				if ( aFreeDiskSpaceToLeave != 0 )
				    {
					// RDebug::Print( _L("Shareddatatest ## Creating %d. EaterFile"), i+1);
					TInt sizeToSet = STATIC_CAST(TInt, I64INT(diskFree));
					err = iEaterFile.SetSize( sizeToSet - aFreeDiskSpaceToLeave * 1024 );
					iEaterFile.Size( fileSize );
					// RDebug::Print( _L("Shareddatatest ## Last EaterFileSize: %d"), fileSize);
					diskFree = 0;	
				    }
				
				// Otherwise try to eat all the disk space
				else
				    {
					// RDebug::Print( _L("Shareddatatest ## Creating %d. EaterFile"), i+1);
					TInt sizeToSet = STATIC_CAST(TInt, I64INT(diskFree));
					// RDebug::Print( _L("Shareddatatest ## Filesize in the end should be around %d bytes"), sizeToSet);
					
					for ( TInt j = 64 ; err != KErrDiskFull ; j-- )
					    {	
						err = iEaterFile.SetSize( sizeToSet - j * 1024 );
					    }
					iEaterFile.Size( fileSize );
					// RDebug::Print( _L("Shareddatatest ## Last EaterFileSize: %d bytes"), fileSize);
					// RDebug::Print( _L("Shareddatatest ## There should be %d bytes of free disk"),sizeToSet - fileSize);
					diskFree = 0;
				    }
			    }
		    }
		
		else
		    {
			RDebug::Print(_L("Shareddatatest ## Error = %d"), err);
			diskFree = 0;
		    }

		// RDebug::Print(_L("Shareddatatest ## Close file"));
		iEaterFile.Close();
	    }
    }
开发者ID:cdaffara,项目名称:symbiandump-os1,代码行数:84,代码来源:Tfdosshareddatatc.cpp


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