本文整理汇总了C++中TBuf16::Insert方法的典型用法代码示例。如果您正苦于以下问题:C++ TBuf16::Insert方法的具体用法?C++ TBuf16::Insert怎么用?C++ TBuf16::Insert使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TBuf16
的用法示例。
在下文中一共展示了TBuf16::Insert方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: doTestStepL
TVerdict CSysUtilsGetLangSWVersionNoNewLinesStep::doTestStepL()
{
TInt err = SetTestPath(ETrue);
if( err != KErrNone )
{
ERR_PRINTF2(_L("Could not turn test path on. Error = %d"), err);
SetTestStepResult(EAbort);
return TestStepResult();
}
INFO_PRINTF1(_L("Test path turned on."));
err = DeletePSProperties();
if( err != KErrNone )
{
ERR_PRINTF2(_L("Could not delete P&S properties. Error = %d"), err);
SetTestStepResult(EAbort);
return TestStepResult();
}
INFO_PRINTF1(_L("Deleted P&S properties successfully."));
_LIT16(KDummy,"xxxxx");
TBuf16<KSysUtilVersionTextLength> version;
version.Insert(0,KDummy);
err = SysUtil::GetLangSWVersion( version );
if ( err == KErrNone)
{
_LIT(KLangSw, "LangSW");
TPtrC16 line;
TESTL( GetStringFromConfig(ConfigSection(), KLangSw, line) );
TBuf16<KSysUtilVersionTextLength> testBuf(line);
if (version.Compare(testBuf)==0)
{
INFO_PRINTF1(_L("Got version "));
INFO_PRINTF1(version);
}
else
{
ERR_PRINTF1(_L("Version not correct"));
INFO_PRINTF1(version);
SetTestStepResult(EFail);
}
}
else
{
ERR_PRINTF2(_L("Error code = %d"), err);
SetTestStepResult(EFail);
}
return TestStepResult();
}
示例2: doTestStepL
/**
@SYMTestCaseID SYSLIB-BAFL-CT-4022
@SYMREQ REQ8170
@SYMDEF DEF141094
@SYMTestCaseDesc GetVersionInsufficientBuffer
@SYMTestPriority HIGH
@SYMTestStatus Implemented
@SYMTestActions Use the SysUtil::GetSWVersion method with its descriptor
@SYMTestActions parameter’s size smaller than the length of the software version text
@SYMTestActions Repeat for SysUtil::GetLangSWVersion
@SYMTestExpectedResults KErrTooBig is returned because not all the software version text can
@SYMTestExpectedResults be read into the buffer supplied.
*/
TVerdict CSysUtilsGetVersionInsufficienBufferStep::doTestStepL()
{
TInt err=KErrNone;
const TInt bufSize = 6;
_LIT16(kDummy,"xxxxx");
TBuf16<bufSize> version;
version.Insert(0,kDummy);
err = SysUtil::GetSWVersion( version );
ProcessError(err);
err = SysUtil::GetLangSWVersion( version );
ProcessError(err);
err = SysUtil::GetPRInformation( version );
ProcessError(err);
return TestStepResult();
}
示例3: doTestStepL
TVerdict CSysUtilsGetLangSWVersionUnreadableStep::doTestStepL()
{
TInt err = SetTestPath(ETrue);
if( err != KErrNone )
{
ERR_PRINTF2(_L("Could not turn test path on. Error = %d"), err);
SetTestStepResult(EAbort);
return TestStepResult();
}
INFO_PRINTF1(_L("Test path turned on."));
err = DeletePSProperties();
if( err != KErrNone )
{
ERR_PRINTF2(_L("Could not delete P&S properties. Error = %d"), err);
SetTestStepResult(EAbort);
return TestStepResult();
}
INFO_PRINTF1(_L("Deleted P&S properties successfully."));
_LIT16(KDummy,"xxxxx");
TBuf16<KSysUtilVersionTextLength> version;
version.Insert(0,KDummy);
err = SysUtil::GetLangSWVersion( version );
if ( err == KErrCorrupt)
{
INFO_PRINTF1(_L("KErrCorrupt returned this is expected"));
}
else
{
ERR_PRINTF2(_L("Other error code = %d"), err);
SetTestStepResult(EFail);
}
return TestStepResult();
}
示例4: doTestStepL
TVerdict CSysUtilsGetPRInformationStep::doTestStepL()
{
TInt err=KErrNone;
_LIT16(KDummy,"xxxxx");
TBuf16<KSysUtilVersionTextLength> version;
version.Insert(0,KDummy);
TInt fileErr = CheckIsFileExist( _L("C:\\versions\\purpose.txt"));
if(fileErr == KErrNone)
{
err = DeletePSProperties();
if(err != KErrNone)
{
ERR_PRINTF2(_L("Could not delete P&S properties. Error = %d"), err);
SetTestStepResult(EAbort);
return TestStepResult();
}
INFO_PRINTF1(_L("Deleted P&S properties successfully."));
err = SetTestPath(ETrue);
if( err != KErrNone )
{
ERR_PRINTF2(_L("Could not turn test path off. Error = %d"), err);
SetTestStepResult(EAbort);
return TestStepResult();
}
INFO_PRINTF1(_L("Test path turned off."));
err = SysUtil::GetPRInformation( version );
if ( err != KErrNone )
{
ERR_PRINTF2(_L("Get PR Information failed. Error = %d"), err);
SetTestStepResult(EFail);
}
else
{
//Get the information from the ini file
_LIT(KPRInfo, "PRInfo");
TPtrC16 line;
TESTL( GetStringFromConfig(ConfigSection(), KPRInfo, line) );
TBuf16<KSysUtilVersionTextLength> testBuf(line);
//Parse the information from the ini file
//Replace new-line patterns with real ones
_LIT(KNewLinePattern, "\\n");
_LIT( KNewline, "\n" );
err = testBuf.Find(KNewLinePattern);
while (err != KErrNotFound)
{
// err is a position
testBuf.Replace(err, KNewLinePattern().Length(), KNewline );
err = testBuf.Find(KNewLinePattern);
}
if (version.Compare(testBuf)!=0)
{
ERR_PRINTF1(_L("PR Information formatted incorrectly"));
INFO_PRINTF1(_L("From ini file: "));
INFO_PRINTF1(testBuf);
INFO_PRINTF1(_L("From txt file: "));
INFO_PRINTF1(version);
INFO_PRINTF2(_L("Comparison returned value %d"), version.Compare(testBuf));
SetTestStepResult(EFail);
}
else
{
INFO_PRINTF1(_L("PR Information formatted correctly"));
INFO_PRINTF1(_L("from ini file "));
INFO_PRINTF1(testBuf);
INFO_PRINTF1(_L("from txt file "));
INFO_PRINTF1(version);
}
}
}
else
{
ERR_PRINTF1(_L("purpose.txt is missing, should be included to base packets"));
SetTestStepResult(EFail);
}
err = SetTestPath(EFalse);
return TestStepResult();
}