本文整理汇总了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);
}
示例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 );
}
示例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);
}
示例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();
//.........这里部分代码省略.........
示例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();
}
}