本文整理汇总了C++中TPtr8::AppendFill方法的典型用法代码示例。如果您正苦于以下问题:C++ TPtr8::AppendFill方法的具体用法?C++ TPtr8::AppendFill怎么用?C++ TPtr8::AppendFill使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TPtr8
的用法示例。
在下文中一共展示了TPtr8::AppendFill方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: TestCRImportL
// -----------------------------------------------------------------------------
// CTestDomCdl::TestCRImportL
// -----------------------------------------------------------------------------
//
TInt CTestDomCdl::TestCRImportL( CStifItemParser& /*aItem*/ )
{
CCdlRefs* cdlRefs = CCdlRefs::NewL();
CleanupStack::PushL( cdlRefs );//push
STIF_ASSERT_NOT_NULL( cdlRefs );
HBufC8* buf8 = HBufC8::NewMaxLC( 32 );//push
TPtr8 ptr = buf8->Des();
TChar theChar = 0;
ptr.Zero();
ptr.AppendFill( theChar, 8 );
cdlRefs->ImportL( *buf8 );
CleanupStack::PopAndDestroy( 2 );
return KErrNone;
}
示例2: TestStepResult
TVerdict CLoopbackTestStep7::doTestStepL()
/**
Test issuing write with too large of a buffer
*/
{
TestErrorCodeL( iCommPort1.Open(iCommServer, KPortName1, ECommExclusive, ECommRoleDCE), _L("Opening comm port 1") );
TestErrorCodeL( iCommPort2.Open(iCommServer, KPortName2, ECommExclusive, ECommRoleDCE), _L("Opening comm port 2") );
// Create the large buffer
HBufC8 *hugeHeapDescriptor = HBufC8::NewLC(KHugeBufferSize);
TPtr8 hugeDescriptor = hugeHeapDescriptor->Des();
hugeDescriptor.AppendFill('a', KHugeBufferSize);
// Issue the write with the buffer that is too large
TRequestStatus writeStatus1, readStatus1;
iCommPort2.Write(writeStatus1, hugeDescriptor);
User::WaitForRequest(writeStatus1);
TestErrorCodeL(writeStatus1.Int(), KErrArgument, _L("Writing to comm port 1"));
// Make sure write still works with normal sized buffer
iCommPort2.Write(writeStatus1, KWriteBuf1);
User::WaitForRequest(writeStatus1);
TestErrorCodeL(writeStatus1.Int(), _L("Writing to comm port 1"));
TBuf8<KRegularBufferSize> readBuf;
iCommPort1.ReadOneOrMore(readStatus1, readBuf);
User::WaitForRequest(readStatus1);
if (readStatus1 != KErrNone)
{
INFO_PRINTF1(_L("Failed read"));
SetTestStepResult(EFail);
}
CleanupStack::PopAndDestroy(hugeHeapDescriptor);
return TestStepResult();
}