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


C++ TLex::NextToken方法代码示例

本文整理汇总了C++中TLex::NextToken方法的典型用法代码示例。如果您正苦于以下问题:C++ TLex::NextToken方法的具体用法?C++ TLex::NextToken怎么用?C++ TLex::NextToken使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TLex的用法示例。


在下文中一共展示了TLex::NextToken方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: OkToExitL

TBool CEmTubeVideoUploadDialog::OkToExitL(TInt aButtonId)
	{
	if (aButtonId == EAknSoftkeyDone)
		{
		SaveFormDataL();

	    if( iQueueEntry->Title().Length() == 0 )
	    	{
			HBufC* message = StringLoader::LoadLC( R_DIALOG_TITLE_AND_DESCRIPTION_NEEDED_TXT );
            CAknInformationNote* informationNote = new (ELeave) CAknInformationNote;
            informationNote->ExecuteLD( *message );                    
			CleanupStack::PopAndDestroy( message );
    	    return EFalse;    	    
		    }
		
	    if( iQueueEntry->Description().Length() == 0 )
	    	{
			HBufC* message = StringLoader::LoadLC( R_DIALOG_TITLE_AND_DESCRIPTION_NEEDED_TXT );
            CAknInformationNote* informationNote = new (ELeave) CAknInformationNote;
            informationNote->ExecuteLD( *message );                    
			CleanupStack::PopAndDestroy( message );
    	    return EFalse;    	    
		    }

		TBool res = ETrue;

	    if( iQueueEntry->Tags().Length() == 0 )
	        res = EFalse;
    
	    TLex lex = TLex( iQueueEntry->Tags() );            
	    TPtrC16 ptr( lex.NextToken() );
	    TInt tokenCount = 0;
    
	    while( ptr.Length() && (tokenCount < 2) )
    	    {
        	tokenCount++;
	        ptr.Set( lex.NextToken() );
    	    }

		if( tokenCount < 2 )
			res = EFalse;
		
		if( !res )
			{
			HBufC* message = StringLoader::LoadLC( R_DIALOG_TWO_TAGS_NEEDED_TXT );
            CAknInformationNote* informationNote = new (ELeave) CAknInformationNote;
            informationNote->ExecuteLD( *message );                    
			CleanupStack::PopAndDestroy( message );
    	    return EFalse;    	    
			}

  		return ETrue;
		}
	else
		{
		return CAknForm::OkToExitL(aButtonId);
		}
	}
开发者ID:Yelinson,项目名称:OpenVideoHub,代码行数:58,代码来源:emTubeVideoUploadDialog.cpp

示例2: GotoEndOfLine

/*
-------------------------------------------------------------------------------

    Class: CStifSectionParser

    Method: GotoEndOfLine

    Description: Goes end of the line.

    Parameters: TLex& lex: inout: Parsed line.

    Return Values: TInt: Last item's end position.

    Errors/Exceptions: None

    Status: Proposal

-------------------------------------------------------------------------------
*/
TInt CStifSectionParser::GotoEndOfLine( TLex& lex )
    {
    // End position of the last token(Initialized with current position)
    TInt lastItemPosition( lex.Offset() );

    // LINE BREAK NOTE:
    // Line break in SOS, WIN:  '\r\n'
    // Line break in UNIX:      '\n'

    do
        {
        // Peek next character(10 or '\n' in UNIX style )
        if( lex.Peek() == 0x0A )
            {
            lex.Inc();
            break;
            }

        // Peek next character(13 or '\r' in Symbian OS)
        if ( lex.Peek() == 0x0D )
            {
            // Increment the lex position
            lex.Inc();
            // Peek next character(10 or '\n' in Symbian OS)
            if ( lex.Peek() == 0x0A )
                {
                // End of the section is found and increment the lex position
                lex.Inc();
                break;
                }
            // 0x0A not found, decrement position
            lex.UnGet();
            }
        // Peek for tabulator(0x09) and space(0x20)
        else if ( lex.Peek() == 0x09 || lex.Peek() == 0x20 )
            {
            // Increment the lex position
            lex.Inc();
            continue;
            }
        
        // If white spaces not found take next token
        lex.NextToken();
        lastItemPosition = lex.Offset();    
        
        } while ( !lex.Eos() );
        
    return lastItemPosition;

    }
开发者ID:fedor4ever,项目名称:testfw,代码行数:69,代码来源:StifSectionParser.cpp

示例3: CreateCfgDataFromFileL

/**
 * Read the Cfg File data into a heap buffer
 * And populate the arrays of selective test case IDs and 
 * Ranges to be used by the state machine
 * NOTE: we do not support nested cfgs...
 */
LOCAL_C void CreateCfgDataFromFileL(TPtrC& aCfgFilePath,RArray<TRange>& aSelectiveCaseRange, TDesC*& aSelTestCfgFileData)
	{
	
	RFs fS;
	User::LeaveIfError(fS.Connect());
	CleanupClosePushL(fS);
	RFile cfgFile;
	User::LeaveIfError(cfgFile.Open(fS,aCfgFilePath,EFileRead | EFileShareAny));
	CleanupClosePushL(cfgFile);
	TInt fileSize;
	User::LeaveIfError(cfgFile.Size(fileSize));
	// Create a 16bit heap buffer
	HBufC* cfgData = HBufC::NewL(fileSize);
	CleanupStack::PushL(cfgData);
	HBufC8* narrowData = HBufC8::NewL(fileSize);
	CleanupStack::PushL(narrowData);
	TPtr8 narrowPtr=narrowData->Des();
	// Read the file into an 8bit heap buffer
	User::LeaveIfError(cfgFile.Read(narrowPtr));
	TPtr widePtr(cfgData->Des());
	// Copy it to the 16bit buffer
	widePtr.Copy(narrowData->Des());
	CleanupStack::PopAndDestroy(narrowData);
	CleanupStack::Pop(cfgData);
	CleanupStack::Pop(2);
	cfgFile.Close();
	fS.Close();
	// Set up the instance token parser
	TLex cfgLex = cfgData->Des();
	aSelTestCfgFileData = cfgData; // to preserve the pointer of cfgdata and transfer the ownership to aSelTestCfgFileData 
	cfgData = NULL; // relinquish the ownership
	while(!cfgLex.Eos())
		{
		DistinguishElement(cfgLex.NextToken(),aSelectiveCaseRange) ; 
		}
	
	}
开发者ID:cdaffara,项目名称:symbiandump-os2,代码行数:43,代码来源:testexecute.cpp


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