本文整理汇总了C++中TLex::Get方法的典型用法代码示例。如果您正苦于以下问题:C++ TLex::Get方法的具体用法?C++ TLex::Get怎么用?C++ TLex::Get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TLex
的用法示例。
在下文中一共展示了TLex::Get方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Eat
TBool TfrLex::Eat( TLex& aLex, const TChar aChar )
{
TLexMark unget;
if ( aChar.IsSpace() )
{
// A space character requires its own logic = go over
// the other space characters - x gets the next char.
TChar x;
aLex.Mark(unget);
while ( x = aLex.Get(), x.IsSpace() && x != aChar )
{};
if ( x == aChar )
return ETrue;
}
else
{
// For other, non-space, characters: skip spaces and
// get the next character x.
aLex.SkipSpace();
aLex.Mark(unget);
if ( aLex.Get() == aChar )
return ETrue;
}
// The character wasn't there, unget to the start point.
aLex.UnGetToMark(unget);
return EFalse;
}
示例2: ReadStructuredListL
// -----------------------------------------------------------------------------
// CStartupAdaptationStubModel::ReadStructuredListL
//
// -----------------------------------------------------------------------------
//
void CStartupAdaptationStubModel::ReadStructuredListL(
const TInt aNumParts,
TLex& aLexer,
CStructuredList& aList )
{
RDEBUG( _L( "CStartupAdaptationStubModel::ReadStructuredListL." ) );
while ( !aLexer.Eos() )
{
aList.AppendL( ReadDurationL( aLexer ) );
TUint val( 0 );
User::LeaveIfError( aLexer.Val( val, EHex ) );
aList.AppendL( val );
for ( TInt i = 0; i < aNumParts - 1; i++ )
{
if ( aLexer.Get() != ',' ) User::Leave( KErrCorrupt );
User::LeaveIfError( aLexer.Val( val, EHex ) );
aList.AppendL( val );
}
if ( !aLexer.Eos() && aLexer.Get() != ';' ) User::Leave( KErrCorrupt );
}
if ( aList.Count() == 0 ) User::Leave( KErrCorrupt );
RDEBUG_1( _L( "CStartupAdaptationStubModel::ReadStructuredListL finished. List length: %d" ), aList.Count() );
}
示例3:
// ----------------------------------------------------
// CheckIPv4Address()
// IPv4address = 1*3DIGIT "." 1*3DIGIT "." 1*3DIGIT "." 1*3DIGIT
// ----------------------------------------------------
//
LOCAL_C TBool CheckIPv4Address( TLex& aLex )
{
return CheckIPv4AddressPart( aLex )
&& aLex.Get() == '.'
&& CheckIPv4AddressPart( aLex )
&& aLex.Get() == '.'
&& CheckIPv4AddressPart( aLex )
&& aLex.Get() == '.'
&& CheckIPv4AddressPart( aLex ) && aLex.Get() == '\0' ;
}
示例4: hexSeq
// ----------------------------------------------------
// CheckIPv6HexPart()
// hexpart = hexseq | hexseq "::" [ hexseq ] | "::" [ hexseq ]
// ----------------------------------------------------
//
LOCAL_C TBool CheckIPv6HexPart( TLex& aLex )
{
TBool hexSeq( DoOrReverse( CheckIPv6HexSeq, aLex ) );
TBool doubleSemiColon( EFalse );
if( aLex.Peek() == ':' )
{
aLex.Inc();
if( aLex.Get() == ':' )
{
doubleSemiColon = ETrue;
DoOrReverse( CheckIPv6HexSeq, aLex );
}
}
return hexSeq || doubleSemiColon;
}
示例5: ValF
TInt TfrLex::ValF( TLex& aLex, const TDesC& aTerm )
{
TLex term( aTerm );
TLexMark mark;
aLex.Mark( mark );
while ( !term.Eos() )
{
if ( aLex.Eos() || User::Fold(term.Get()) != User::Fold(aLex.Get()) )
{
aLex.UnGetToMark( mark );
return KErrNotFound;
}
}
return KErrNone;
}
示例6: ReadDurationL
// -----------------------------------------------------------------------------
// CStartupAdaptationStubModel::ReadDurationL
//
// -----------------------------------------------------------------------------
//
TInt CStartupAdaptationStubModel::ReadDurationL( TLex& aLexer )
{
RDEBUG( _L( "CStartupAdaptationStubModel::ReadDurationL." ) );
TInt val = KDefaultDuration;
if ( aLexer.Peek() == '[' ) // Duration value is written to file
{
aLexer.Inc();
User::LeaveIfError( aLexer.Val( val ) );
if ( aLexer.Get() != ']' )
{
User::Leave( KErrCorrupt );
}
}
RDEBUG_1( _L( "CStartupAdaptationStubModel::ReadDurationL finished with %d." ), val );
return val;
}
示例7: IsAllDigits
// -----------------------------------------------------------------------------
// CSTSPinConverter::IsAllDigits
// Checks, are all values in gived descriptor digits or not.
// Returns: ETrue: All was digits
// EFalse: At least one value was not digit
// -----------------------------------------------------------------------------
TBool CSTSPinConverter::IsAllDigits(const TDesC& aPinValue)
{
//if empty
if (aPinValue.Length() == 0)
{
return EFalse;
}
TLex lex;
lex.Assign(aPinValue);
while (lex.Peek() != 0)
{
if (!(lex.Get()).IsDigit())
{
//if was not digit
return EFalse;
}
}
return ETrue;
}
示例8: 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);
}
}
示例9: SaveSettingsL
TBool CSettingView::SaveSettingsL()
{
// Save settings to the member variables
StoreSettingsL();
// Validate input
TLex lex;
TInt maxPacketCount;
lex.Assign( iMaxPacketCount );
if ( lex.Val( maxPacketCount ) != KErrNone )
{
CEikonEnv::Static()->InfoMsg(_L("Packet count must be numeric"));
return EFalse;
}
TInt packetDataSize;
lex.Assign( iPacketDataSize );
if ( lex.Val( packetDataSize ) != KErrNone )
{
CEikonEnv::Static()->InfoMsg(_L("Packet size must be numeric"));
return EFalse;
}
TInt waitTime;
lex.Assign( iWaitTime );
if ( lex.Val( waitTime ) != KErrNone )
{
CEikonEnv::Static()->InfoMsg(_L("Wait time must be numeric"));
return EFalse;
}
TInt lastWaitTime;
lex.Assign( iLastWaitTime );
if ( lex.Val( lastWaitTime ) != KErrNone )
{
CEikonEnv::Static()->InfoMsg(_L("Last wait time must be numeric"));
return EFalse;
}
lex.Assign( iPattern );
while (!lex.Eos())
{
if (!lex.Get().IsHexDigit())
{
CEikonEnv::Static()->InfoMsg(_L("Pattern must be hexadecimal"));
return EFalse;
}
}
// Validation OK, so save settings to the model
iPingModel->iPackLimit = iLimitPacketCount;
iPingModel->iTotalPackets = maxPacketCount;
iPingModel->iPacketDataSize = packetDataSize;
iPingModel->iSecWait = waitTime;
iPingModel->iLastSecWait = lastWaitTime;
iPingModel->iPattern.Copy(iPattern);
iPingModel->iQuiet = iQuiet;
iPingModel->iVerbose = iVerbose;
iPingModel->iDebug = iDebug;
#ifdef IAPSETTING
TInt iap;
lex.Assign( iIAP );
lex.Val( iap );
iPingModel->iIAP = iap;
#endif
return ETrue;
}