本文整理汇总了C++中TLex8::Inc方法的典型用法代码示例。如果您正苦于以下问题:C++ TLex8::Inc方法的具体用法?C++ TLex8::Inc怎么用?C++ TLex8::Inc使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TLex8
的用法示例。
在下文中一共展示了TLex8::Inc方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ChopElementsFromLineL
// ---------------------------------------------------------------------------
// SdpUtil::ChopElementsFromLineL
// Chops all the elements that are divided by delimiter from the string
// ---------------------------------------------------------------------------
//
void SdpUtil::ChopElementsFromLineL(
RArray<TPtrC8>& aArray,
TLex8& aLexer,
TChar aDelimiter,
TInt aErrCode )
{
// Chop the elements to the array from lexer
TBool eofcFound = EFalse;
while (!eofcFound)
{
aLexer.Mark();
// Parse single token, leave other special characters
// to token except aDelimiter | '\r' | '\n' | '\0'
while ( aLexer.Peek() != aDelimiter &&
aLexer.Peek() != KCRChar &&
aLexer.Peek() != KLFChar &&
aLexer.Peek() != KEofChar )
{
aLexer.Inc();
}
if ( aLexer.MarkedToken().Length() > 0 )
{
aArray.AppendL( aLexer.MarkedToken() );
}
if ( aDelimiter == KSPChar &&
aLexer.Peek() == aDelimiter )
{
SkipSpacesUntilNextLineBreak( aLexer );
}
// Check if its end-of-line
if ( aLexer.Peek() == KCRChar )
{
aLexer.Inc();
}
if ( aLexer.Peek() == KLFChar )
{
aLexer.Inc();
if ( aLexer.Peek() != KEofChar )
{
User::Leave( aErrCode );
}
eofcFound = ETrue;
}
else if ( aLexer.Peek() == KEofChar )
{
// EoF character not tolerated at the middle of the string
User::Leave( aErrCode );
}
else
{
aLexer.Inc();
}
}
}
示例2: FindLocalProcessInfoL
// ----------------------------------------------------------------------------------------
// CTerminalControlServer::FindLocalProcessInfoL
// ----------------------------------------------------------------------------------------
CTerminalControlServer::TTcProcessInfo CTerminalControlServer::FindLocalProcessInfoL ( const TDesC8 &aProcessName )
{
RDEBUG("CTerminalControlServer::FindLocalProcessInfoL");
TInt processCount = iProcessInfoArray->Count();
if(processCount == 0)
{
User::Leave( KErrNotFound );
}
if(aProcessName.Length() < KFormatProcessNamePrefix().Length()+1)
{
User::Leave(KErrNotFound);
}
if(aProcessName.Left( KFormatProcessNamePrefix().Length() ).Compare(KFormatProcessNamePrefix) != KErrNone)
{
User::Leave(KErrNotFound);
}
//
// Get process index from the name
//
TInt index;
TLex8 lex;
lex.Assign( aProcessName );
lex.Inc( KFormatProcessNamePrefix().Length() );
User::LeaveIfError( lex.Val(index) );
index --;
if(index < 0 || index >= processCount)
{
User::Leave( KErrNotFound );
}
return iProcessInfoArray->At(index);
}
示例3: SkipToNextLine
void CTestConfig::SkipToNextLine(TLex8& aInput) const
{
const TChar cr('\n');
while (!aInput.Eos() && aInput.Peek() != cr)
{
aInput.Inc();
}
}
示例4: GetTextString
// -----------------------------------------------------------------------------
// CWPPushMessage::GetTextString
// -----------------------------------------------------------------------------
//
TPtrC8 CWPPushMessage::GetTextString( TLex8& aPointer ) const
{
// Text-string can be quoted.
if( aPointer.Peek() == KQuotedTextStringStart )
{
aPointer.Inc();
}
aPointer.Mark();
while( aPointer.Get() != EKeyNull )
{
// Nothing
}
// We don't want to have NULL in the resulting descriptor, so
// back that out.
aPointer.UnGet();
TPtrC8 result( aPointer.MarkedToken() );
aPointer.Inc();
return result;
}
示例5: GetNextElement
TInt CTestConfig::GetNextElement(TLex8& aInput, TChar aDelimiter, TPtrC8& aOutput)
{
if (aInput.Eos())
return KErrNotFound;
//Get to the start of the descriptor
while (!aInput.Eos() && aInput.Peek() != aDelimiter)
aInput.Inc();
aOutput.Set(aInput.MarkedToken());
if (!aInput.Eos())
aInput.SkipAndMark(1);
return KErrNone;
}
示例6: HandleConversionException
// -----------------------------------------------------------------------------
// CUpnpRangeHeaderParser::HandleConversionException
// Handles conversion exceptions
// -----------------------------------------------------------------------------
//
TBool CUpnpRangeHeaderParser::HandleConversionException( TLex8& aNumber, TInt& aRangePos,
TInt aError )
{
if( aError == KErrOverflow )
{
aRangePos = KMaxTInt;
while ( aNumber.Peek().IsDigit() )
{
aNumber.Inc();
}
}
else if ( aError != KErrNone )
{
return EFalse;
}
return ETrue;
}
示例7: GetTextValue
// -----------------------------------------------------------------------------
// CWPPushMessage::GetTextValue
// -----------------------------------------------------------------------------
//
TPtrC8 CWPPushMessage::GetTextValue( TLex8& aPointer ) const
{
// Text-value can be quoted, so skip that first.
if( aPointer.Peek() == KQuotedStringStart )
{
aPointer.Inc();
}
aPointer.Mark();
// It is null-terminated
while( aPointer.Get() != EKeyNull )
{
// Do nothing
}
// We don't want to have NULL in the resulting descriptor, so
// back that out.
TPtrC8 result( aPointer.MarkedToken() );
result.Set( result.Left( Max( 0, result.Length()-1 ) ) );
return result;
}
示例8: CleanupClosePushL
// -----------------------------------------------------------------------------
// SdpUtil::GetElementsFromLineL
// Gets all the elements from a single line
// -----------------------------------------------------------------------------
//
RArray<TPtrC8> SdpUtil::GetElementsFromLineL(
TLex8& aLexer,
TChar aDelimiter,
TInt aErrCode )
{
RArray<TPtrC8> lineArray;
CleanupClosePushL( lineArray );
// Header is special case, because it is joined _without_
// space character with the first attribute, so it must be
// parsed separately
aLexer.Mark();
// curChar must be != KEqualChar at first comparison
for ( TChar curChar( KSPChar ); curChar != KEqualChar; )
{
curChar = aLexer.Peek();
// Syntax check
if ( curChar == KEofChar || curChar == KLFChar ||
curChar == KCRChar )
{
User::Leave( aErrCode );
}
aLexer.Inc();
}
// Append header to array
User::LeaveIfError( lineArray.Append( aLexer.MarkedToken() ) );
// Whitespace MUST NOT be used after the "=" sign
if (aLexer.Peek() == KSPChar)
{
User::Leave( aErrCode );
}
// Get the other elements from the string to the array
ChopElementsFromLineL( lineArray, aLexer, aDelimiter, aErrCode );
CleanupStack::Pop(); // lineArray
return lineArray;
}