本文整理汇总了C++中TBuf8::Find方法的典型用法代码示例。如果您正苦于以下问题:C++ TBuf8::Find方法的具体用法?C++ TBuf8::Find怎么用?C++ TBuf8::Find使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TBuf8
的用法示例。
在下文中一共展示了TBuf8::Find方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CleanUpAndWriteResults
void CTmsTestStep::CleanUpAndWriteResults()
{
RFs fs;
fs.Connect();
CleanupClosePushL(fs);
iTestStepPositions.Close();
if (iTestStepNames != NULL)
{
iTestStepNames->Reset();
delete iTestStepNames;
iTestStepNames = NULL;
if (BaflUtils::FolderExists(fs, KLogLocation))
{
RFile file;
if (BaflUtils::FileExists( fs, KLogLocation ))
{
// open the temporary tms log
TInt err = file.Open( fs, KLogLocation, EFileRead|EFileShareAny);
if(err == KErrInUse)
{
CleanupStack::PopAndDestroy();
return;
}
if (err == KErrNone)
{
CleanupClosePushL(file);
TBuf8<256> line;
TBuf<250> testID;
TBuf<6> testResult;
// get a line from the temporary tms log
while (CTmsTestStep::ReadNextLineL(file,line))
{
TInt blankPos = line.Find(KBlankSpace);
// get the ID from the line
testID.Copy(line.Left(blankPos));
//get the pass or fail result from the line
testResult.Copy(line.Mid(blankPos+1,4));
// print into the standard tef log the id and the result in the correct format
// so that they are correctly parsed into the TMS csv file
INFO_PRINTF2(_L("START_TESTCASE %S"),&testID);
INFO_PRINTF2(_L("Line = 1 Command = START_TESTCASE %S"),&testID);
INFO_PRINTF2(_L("END_TESTCASE %S"),&testID);
INFO_PRINTF3(_L("Line = 1 Command = END_TESTCASE %S ***TestCaseResult = %S"),&testID,&testResult);
}
CleanupStack::PopAndDestroy();
}
// remove the temporary tms log
fs.Delete(KLogLocation);
}
}
}
CleanupStack::PopAndDestroy();
}
示例2: TestExportedFile
TBool TestExportedFile(const TDesC& aFilename)
{
//Check for DTSTART and DTEND
//Check it is in DATE-TIME format
TBool DTSTART_patternFound = EFalse;
TBool DTEND_patternFound = EFalse;
RFile fileHandle;
CleanupClosePushL(fileHandle);
fileHandle.Open(calTestLibrary->FileSession(),aFilename, 0);
TBuf8<256> line;
TInt KDateLength = 8;
TInt KColon = 1;
while (fileHandle.Read(line) == KErrNone && line.Length() != 0)
{
TInt pos = line.Find(KDTSTART());
if (pos != KErrNotFound)
{
DTSTART_patternFound = ETrue;
TText time;
time = line[pos + KDTSTART().Length() + KColon + KDateLength ];
test (time == 'T');
}
pos = line.Find(KDTEND());
if ( pos != KErrNotFound)
{
DTEND_patternFound = ETrue;
TText time;
time = line[pos + KDTEND().Length() + KColon + KDateLength ];
test (time == 'T');
if (DTSTART_patternFound && DTEND_patternFound)
break;
}
}
CleanupStack::PopAndDestroy(&fileHandle);
return (DTSTART_patternFound && DTEND_patternFound);
}
示例3: AddXmlAttributeL
// ---------------------------------------------------------
// AddXmlAttributeL()
// ---------------------------------------------------------
//
void CBIPXmlWriter::AddXmlAttributeL( TAttributeType aAttributeType, TDesC8& aAttr )
{
TRACE_FUNC_ENTRY
TBuf8<KBIPImageTypesLength> attribute = KBIPImageTypes();
switch( aAttributeType )
{
case EEncoding:
{
if( attribute.Find( aAttr ) == KErrNotFound )
{
User::LeaveIfError( ifile.Write( KBIPUserSeries60 ) );
User::LeaveIfError( ifile.Write( aAttr ) );
}
else
{
User::LeaveIfError( ifile.Write( aAttr ) );
}
break;
}
case EPixel:
{
User::LeaveIfError( ifile.Write( aAttr ) );
break;
}
case EMaxSize:
{
User::LeaveIfError( ifile.Write( aAttr ) );
break;
}
case ETransformation:
{
break;
}
default:
{
}
}
TRACE_FUNC_EXIT
}
示例4: VersitCheckPatternL
TBool VersitCheckPatternL(const TDesC& aExportFileName, const TDesC8& aExportedPattern)
{
RFile fileHandle;
TBool patternFound = EFalse;
fileHandle.Open(fsSession, aExportFileName, EFileRead|EFileStreamText);
CleanupClosePushL(fileHandle);
// TFileText exportedfile; //Bug in TFileText so not used at the moment
// exportedfile.Set(fileHandle);
// exportedfile.Seek(ESeekStart);
TBuf8<256> line;
while(fileHandle.Read(line) == KErrNone && line.Length() != 0)
{
if (line.Find(aExportedPattern) != KErrNotFound)
{
patternFound = ETrue;
break;
}
}
CleanupStack::PopAndDestroy(&fileHandle);
return patternFound;
}