本文整理汇总了C++中TBuf16::Zero方法的典型用法代码示例。如果您正苦于以下问题:C++ TBuf16::Zero方法的具体用法?C++ TBuf16::Zero怎么用?C++ TBuf16::Zero使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TBuf16
的用法示例。
在下文中一共展示了TBuf16::Zero方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: RunL
void CPhoneCallMonitor::RunL()
{
CTelephony::TCallStatus status = iCallStatus.iStatus;
// use callback function to tell owner that call status has changed
//iCallBack.NotifyChangeInCallStatusL(status,errVal);
if(iStatus.Int() == KErrNone)
{
if(status == CTelephony::EStatusConnected)
{
CTelephony::TRemotePartyInfoV1 remInfoUse;
CTelephony::TCallInfoV1 callInfoUse;
CTelephony::TCallSelectionV1 callSelectionUse;
// we are interested only voice lines
callSelectionUse.iLine = CTelephony::EVoiceLine;
// and calls that are currently connected
callSelectionUse.iSelect = CTelephony::EActiveCall; //EHeldCall, EInProgressCall
CTelephony::TRemotePartyInfoV1Pckg remParty(remInfoUse);
CTelephony::TCallInfoV1Pckg callInfo(callInfoUse);
CTelephony::TCallSelectionV1Pckg callSelection(callSelectionUse);
// Some S60 devices have a bug that requires some delay in here
// othervise the telephone application gets "Out of Memory" error
User::After(100000);
if(KErrNone == iTelephony->GetCallInfo(callSelection,callInfo,remParty))
{
if(remInfoUse.iDirection == CTelephony::EMobileOriginated) //outgoign call
{
iCallBack.NotifyConnectedCallStatusL(callInfoUse.iDialledParty.iTelNumber);
}
else //incoming call
{
// if the call is mobile terminated then the remote party is the calling party.
// TCallRemoteIdentityStatus::ERemoteIdentityUnknown, ERemoteIdentityAvailable, ERemoteIdentitySuppressed
if(remInfoUse.iRemoteIdStatus == CTelephony::ERemoteIdentityAvailable)
{
iCallBack.NotifyConnectedCallStatusL(remInfoUse.iRemoteNumber.iTelNumber);
}
else // private number
{
TBuf16<1> privNum;
privNum.Zero();
iCallBack.NotifyConnectedCallStatusL(privNum);
}
}
}
}
if(status == CTelephony::EStatusIdle)
{
iCallBack.NotifyDisconnectedCallStatusL();
}
//iPreviousStatus = status;
}
StartListeningForEvents();
}
示例2: ConvertFromForeignToUnicodeL
/**
@SYMTestCaseID SYSLIB-CHARCONV-UT-4018
@SYMTestCaseDesc Convert foreign character set to Unicode code
@SYMTestPriority High
@SYMTestActions Test for ConvertToUnicode() with legal foreign characters, 0x00 - 0x7F
@SYMTestExpectedResults Test must not fail
@SYMPREQ PREQ22265
@SYMREQ REQ10670
*/
void CT_TURKISHLOCKING::ConvertFromForeignToUnicodeL()
{
INFO_PRINTF1(_L(" @SYMTestCaseID:SYSLIB-CHARCONV-UT-4018 Testing encoding from Foreign to Unicode "));
ReadDescL(generatedForeign, KInputForeignFilename, fileServerSession);
TInt state=CCnvCharacterSetConverter::KStateDefault;
test( 0 == characterSetConverter->ConvertToUnicode(generatedUnicode, generatedForeign, state));
ReadDescL(temp, KExpectUnicodeFilename, fileServerSession);
originalUnicode.Zero();
Unicode_Big(temp, originalUnicode);
test(generatedUnicode == originalUnicode);
}
示例3: charactersSetName
void CT_KOI8R::DoE32MainL()
{
RFs fileServerSession;
CleanupClosePushL(fileServerSession);
User::LeaveIfError(fileServerSession.Connect());
CCnvCharacterSetConverter* characterSetConverter=CCnvCharacterSetConverter::NewLC();
CArrayFix<CCnvCharacterSetConverter::SCharacterSet>* arrayOfCharacterSetsAvailable=\
CCnvCharacterSetConverter::CreateArrayOfCharacterSetsAvailableLC(fileServerSession);
INFO_PRINTF1(_L("Available:\n"));
for (TInt i=arrayOfCharacterSetsAvailable->Count()-1; i>=0; --i)
{
const CCnvCharacterSetConverter::SCharacterSet& charactersSet=(*arrayOfCharacterSetsAvailable)[i];
characterSetConverter->PrepareToConvertToOrFromL(charactersSet.Identifier(), *arrayOfCharacterSetsAvailable, fileServerSession);
TPtrC charactersSetName(charactersSet.Name());
if (charactersSet.NameIsFileName())
{
charactersSetName.Set(TParsePtrC(charactersSetName).Name());
}
INFO_PRINTF2(_L(" %S\n"), &charactersSetName);
}
INFO_PRINTF1(_L("Encoding from Unicode to Foreign"));
characterSetConverter->PrepareToConvertToOrFromL(KCharacterSetIdentifier, *arrayOfCharacterSetsAvailable, fileServerSession);
TBuf8<508> temp;
TBuf16<254> originalUnicode;
TBuf8<254> generatedForeign;
TBuf16<254> generatedUnicode;
ReadDescL(temp, KInputUnicodeFilename, fileServerSession);
Merge_Big(temp, originalUnicode);
test(characterSetConverter->ConvertFromUnicode(generatedForeign, originalUnicode) == 0);
ReadDescL(temp, KExpectForeignFilename, fileServerSession);
test(generatedForeign == temp);
INFO_PRINTF1(_L("Encoding from Foreign to Unicode"));
ReadDescL(generatedForeign, KInputForeignFilename, fileServerSession);
TInt state=CCnvCharacterSetConverter::KStateDefault;
test( 0 == characterSetConverter->ConvertToUnicode(generatedUnicode, generatedForeign, state));
ReadDescL(temp, KExpectUnicodeFilename, fileServerSession);
originalUnicode.Zero();
Merge_Big(temp, originalUnicode);
test(generatedUnicode == originalUnicode);
CleanupStack::PopAndDestroy(3);
}
示例4: 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);
}
示例5: 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();
//.........这里部分代码省略.........
示例6: GetAnEntry
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
}