本文整理汇总了C++中TChar::Eos方法的典型用法代码示例。如果您正苦于以下问题:C++ TChar::Eos方法的具体用法?C++ TChar::Eos怎么用?C++ TChar::Eos使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TChar
的用法示例。
在下文中一共展示了TChar::Eos方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetL
TPtrC TfrLex::GetL( TLex& aLex, const TChar aChar )
{
// Skip spaces and mark the token's start point.
aLex.SkipSpace();
TLexMark mark;
aLex.Mark(mark);
if (aLex.Peek() == '"' )
{
// Skip the " and do find next " followed by eos, space or aChar.
aLex.Inc();
TChar x;
while ( x = aLex.Get(), !x.Eos() )
{
if ( x == '"' )
{
// Found a " character - but is it the end of the token?
x = aLex.Peek(); // peek the next character
if ( x.Eos() || x.IsSpace() || x == aChar )
// End of token: return token.
return aLex.MarkedToken(mark);
}
}
// Unget and L E A V E because did not find the end " of token.
aLex.UnGetToMark(mark);
User::Leave(KErrArgument);
return aLex.MarkedToken(mark); // never reached (l e a v e).
}
else
{
// Is not a "*" token: find eos or the next space or the aChar
// and return the token.
TChar x;
while ( x = aLex.Peek(), !x.Eos() && !x.IsSpace() && x != aChar )
aLex.Inc();
return aLex.MarkedToken(mark);
}
}
示例2: ParseErrorCode
// ---------------------------------------------------------------------------
// CMceIceErrorTrigger::ParseErrorCode
// ---------------------------------------------------------------------------
//
TInt CMceIceErrorTrigger::ParseErrorCode() const
{
TInt errorCode( 0 );
TLex8 lex( Value() );
TChar ch = lex.Peek();
while ( !ch.IsDigit() && ch != '-' && !ch.Eos() )
{
lex.Get();
ch = lex.Peek();
}
if ( ch.Eos() )
{
errorCode = KErrNotFound;
}
else
{
lex.Val( errorCode );
}
RDebug::Print( _L("ICEPlugin Dummy: ParseErrorCode=%d" ), errorCode );
return errorCode;
}