本文整理汇总了C++中TLex8::NextToken方法的典型用法代码示例。如果您正苦于以下问题:C++ TLex8::NextToken方法的具体用法?C++ TLex8::NextToken怎么用?C++ TLex8::NextToken使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TLex8
的用法示例。
在下文中一共展示了TLex8::NextToken方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetNextTokenAndCheck
TInt CIniFileParser::GetNextTokenAndCheck(TLex8& lex, TPtr8& tempPtr)
/*
Gets next token and ensures the token is simply not the EOF or a linefeed.
lex is the lexical string to get the next token from.
tempPtr points to the next token
Returns KErrGeneral if token is bad or if we've already read past the end.
*/
{
TUint8 ch;
TInt len;
if (lex.Eos())
{
return KErrGeneral;
}
tempPtr = lex.NextToken();
len = tempPtr.Length();
if (len == 0)
{
// lex has figured out what is left is just the EOF
return KErrGeneral;
}
// this next part may be superfluous but we've had so much strife with
// the parser thus far that for now we're leaving it in
ch = tempPtr[0];
if (ch == KCarriageReturn || ch == KLineFeed)
{
return KErrGeneral;
}
if (tempPtr.Length() < 2)
{
return KErrNone;
}
ch = tempPtr[1];
if (ch == KCarriageReturn || ch == KLineFeed)
{
return KErrGeneral;
}
return KErrNone;
}
示例2: SendCurrentValuesL
// -----------------------------------------------------------------------------
// CEcmtPanPlugin::SendCurrentValues
//
// -----------------------------------------------------------------------------
//
void CEcmtPanPlugin::SendCurrentValuesL( )
{
#ifdef ECMT_RDEBUG
RDebug::Print( _L( "EcmtPanPlugin::SendCurrentValuesL" ) );
#endif
TBuf<KMaxWin32Path> buf;
TBuf8<KMaxPanMsgLen> msg;
TPtrC8 line;
TLex8 lexer;
/*
* Handle bt.esk
*/
GetBtEskFilename( buf );
REcmtFile btFile( buf );
btFile.Read();
if ( !btFile.IsGood() )
{
return;
}
line.Set( btFile.FindLine( KBtPort ) );
if ( line.Length() == 0 )
{
return;
}
msg.Append( KBtCom );
msg.Append( ' ' );
lexer.Assign( line );
lexer.SkipCharacters();
msg.Append( lexer.NextToken() );
msg.Append( ' ' );
line.Set( btFile.FindLine( KHciDll ) );
if ( line.Length() == 0 )
{
return;
}
msg.Append( KHci );
msg.Append( ' ' );
lexer.Assign( line );
lexer.SkipCharacters();
TPtrC8 dll( lexer.NextToken() );
if ( dll.CompareF( KHciDllBcsp ) == 0 )
{
msg.Append( '0' );
}
else if ( dll.CompareF( KHciDllH4 ) == 0 )
{
msg.Append( '1' );
}
else if ( dll.CompareF( KHciDllUsb ) == 0 )
{
msg.Append( '2' );
}
else
{
msg.Append( '-1' );
}
/*
* Handle irda.esk
*/
GetIrdaEskFilename( buf );
REcmtFile irdaFile( buf );
irdaFile.Read();
if ( !irdaFile.IsGood() )
{
return;
}
line.Set( irdaFile.FindLine( KIrdaPort ) );
if ( line.Length() == 0 )
{
return;
}
msg.Append( ' ' );
msg.Append( KIrdaCom );
msg.Append( ' ' );
lexer.Assign( line );
lexer.SkipCharacters();
msg.Append( lexer.NextToken() );
/*
* Send values
*/
CEcmtMessageEvent* m = iMessaging->NewMessageEvent( iTargetUid, msg );
if ( m )
//.........这里部分代码省略.........