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


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

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

示例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() );
    }
开发者ID:cdaffara,项目名称:symbian-oss_adapt,代码行数:35,代码来源:StartupAdaptationStubModel.cpp

示例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' ;
    }
开发者ID:kuailexs,项目名称:symbiandump-mw3,代码行数:15,代码来源:WPAdapterUtil.cpp

示例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;
    }
开发者ID:kuailexs,项目名称:symbiandump-mw3,代码行数:21,代码来源:WPAdapterUtil.cpp

示例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;
}
开发者ID:kuailexs,项目名称:symbiandump-mw2,代码行数:16,代码来源:TfrLex.cpp

示例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;
    }
开发者ID:cdaffara,项目名称:symbian-oss_adapt,代码行数:23,代码来源:StartupAdaptationStubModel.cpp

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

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

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


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