当前位置: 首页>>代码示例>>C++>>正文


C++ TBuf8::Find方法代码示例

本文整理汇总了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();
}
开发者ID:kuailexs,项目名称:symbiandump-mw1,代码行数:58,代码来源:appfwk_tmsteststep.cpp

示例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);
	
    }
开发者ID:cdaffara,项目名称:symbiandump-ossapps,代码行数:42,代码来源:alldayevents.cpp

示例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
    }
开发者ID:cdaffara,项目名称:symbiandump-mw1,代码行数:44,代码来源:BIPXMLWriter.cpp

示例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;
}
开发者ID:Esclapion,项目名称:qt-mobility,代码行数:24,代码来源:t_vexporttype.cpp


注:本文中的TBuf8::Find方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。