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


C++ TDes8::Delete方法代码示例

本文整理汇总了C++中TDes8::Delete方法的典型用法代码示例。如果您正苦于以下问题:C++ TDes8::Delete方法的具体用法?C++ TDes8::Delete怎么用?C++ TDes8::Delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TDes8的用法示例。


在下文中一共展示了TDes8::Delete方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: ParseExtension

// -----------------------------------------------------------------------------
// CUpnpHttpChunkParser::ParseL
// Decoding the chunked-encoded buffer
// -----------------------------------------------------------------------------
//
TBool CUpnpHttpChunkParser::ParseExtension( TDes8& aBuffer, TInt& aPos )
    {	
    if ( IsEmpty( aBuffer, aPos ) )
        {	    
        return ETrue;	
        }

    //if '\r\n' exists
    TInt lineFeed = aBuffer.Right( aBuffer.Length() - aPos ).FindF( UpnpString::KLineFeed );
    if ( lineFeed != KErrNotFound )
        {
        aBuffer.Delete( aPos, lineFeed + UpnpString::KLineFeed().Length() );		
        if ( !iChunkSize )
            {
            iContext = ETrailer;
            return EFalse;		
            }
        else
            {
            iContext = EBody;
            return EFalse;
            }		
        }
    else
        {
        //one character left - possible linefeed
        if ( aPos + 1 < aBuffer.Length() )
            {            
            aBuffer.Delete( aPos, aBuffer.Length() - aPos - 1 );
            }
        return ETrue;
        }
    }
开发者ID:cdaffara,项目名称:symbiandump-mw4,代码行数:38,代码来源:upnphttpchunkparser.cpp

示例2: StripSpaces

void CUtils::StripSpaces(TDes8& aText)
	{
	TInt i;
	for (i=0; i<aText.Length(); i++)
		if (aText[i] != ' ')
			break;
	if (i)
		aText.Delete(0,i);
	for (i=aText.Length()-1; i>=0; i--)
		if (aText[i] != ' ')
			break;
	if (i != aText.Length()-1)
		aText.Delete(i+1,aText.Length()-1-i);
	}
开发者ID:fedor4ever,项目名称:testfw,代码行数:14,代码来源:Utils.cpp

示例3: RemoveSlashes

// -----------------------------------------------------------------------------
// UpnpAVCPEngine::RemoveSlashes
// -----------------------------------------------------------------------------
//   
void RemoveSlashes(TDes8& aPath) 
	{
	if (aPath.Length() > 0 && aPath[0] == '/' ) 
		{        
		aPath.Delete(0,1);
		}

	// remove ending '/' 
	TInt length = aPath.Length();                
	if (length > 0 && aPath[length-1] == '/' ) 
		{
		aPath.Delete(length-1,1);   
		}	   
	}
开发者ID:kuailexs,项目名称:symbiandump-mw1,代码行数:18,代码来源:upnpavcpenginehelper.cpp

示例4: ReadString

TUint TInputManager::ReadString(TDes8& aStr)
	{
	TKeyCode key;
	
	aStr.Zero();
	
	while( (key = iConsole.Getch()) != EKeyEnter)
		{
		if (aStr.Length() == aStr.MaxLength())
			return aStr.MaxLength();
		
		if (key == EKeyBackspace)
			{
			if (aStr.Length() > 0)
				{
				aStr.Delete(aStr.Length()-1, 1);
				ConsoleBackspace(1);
				}
			}
		else
			{
			TUint8 keyChar(key);
			aStr.Append(keyChar);
			iConsole.Printf(_L("%c"), keyChar);
			}
		}
	iConsole.Printf(_L("\n"));
	return aStr.Length();
	}
开发者ID:cdaffara,项目名称:symbiandump-os1,代码行数:29,代码来源:hcemulator.cpp

示例5: FormatGUID

// -----------------------------------------------------------------------------
// CAsf::FormatGUID
// -----------------------------------------------------------------------------
//
void CAsf::FormatGUID( TDes8 &aGUID )
    {
    LOGFN( "CAsf::FormatGUID" );

    TBuf8<16> copyGUID( aGUID );
    TInt i;
    for( i = 0; i < 4; i++ )
        {
        copyGUID[i] = aGUID[3-i];
        }
    for( i = 4; i < 6; i++ )
        {
        copyGUID[i] = aGUID[9 - i];
        }
    for ( i = 6; i < 8; i++ )
        {
        copyGUID[i] = aGUID[13 - i];
        }
    for( i = 8; i < 16 ; i++ )
        {
        copyGUID[i] = aGUID[i];
        }
    aGUID.Delete( 0, 32 );
    for( i = 0; i < 16; i++ )
        {
        aGUID.AppendNumFixedWidthUC( copyGUID[i], EHex, 2 );
        }
    }
开发者ID:kuailexs,项目名称:symbiandump-mw1,代码行数:32,代码来源:asf.cpp

示例6: DeleteBlank

void DeleteBlank(TDes8& aData){
  if(aData.Length()<=0) return;
  _LIT8(KBlank," ");
  TInt pos=aData.FindF(KBlank);
  if(-1!=pos){
    aData.Delete(pos,KBlank().Length());
    DeleteBlank(aData);
  }
}
开发者ID:rusteer,项目名称:symbian,代码行数:9,代码来源:SocketEngine.cpp

示例7: RemoveForbiddenCharacters

// -----------------------------------------------------------------------------
// CUpnpContentHandlersController::RemoveForbiddenCharacters
// Removes forbidden characters
// -----------------------------------------------------------------------------
//
void CUpnpContentHandlersController::RemoveForbiddenCharacters( TDes8& aDescription )
    {    
    for( TInt i=0; i<aDescription.Length(); i++ )
        {
        if ( ( aDescription[i] <= KUtfLowMax ) ||
            ( aDescription[i] >= KUtfHighMin && aDescription[i] <= KUtfHighMax ) )
            {
            aDescription.Delete( i, 1 );
            i--;
            }
        }
    }
开发者ID:cdaffara,项目名称:symbiandump-mw4,代码行数:17,代码来源:upnpcontenthandlerscontroller.cpp

示例8: ParseTrailer

// -----------------------------------------------------------------------------
// CUpnpHttpChunkParser::ParseL
// Decoding the chunked-encoded buffer
// -----------------------------------------------------------------------------
//
TBool CUpnpHttpChunkParser::ParseTrailer( TDes8& aBuffer, TInt& aPos )
	{		
    if ( IsEmpty( aBuffer, aPos ) )
        {	    
        return ETrue;
        }
    //if double '\r\n' exists
    TInt doublelineFeed = aBuffer.Right( aBuffer.Length() - aPos ).FindF( UpnpString::KDoubleLineFeed );
    if (doublelineFeed != KErrNotFound ) 
        {
        aBuffer.Delete( aPos, doublelineFeed + UpnpString::KDoubleLineFeed().Length() );		
        iContext = EFinish;
        return ETrue;	
        }
    else
        {
        //waiting,3 characters reserved for double linefeed
        if ( aPos + UpnpString::KCRLFCRLength < aBuffer.Length() )
            {            
            aBuffer.Delete( aPos, aBuffer.Length() - aPos - UpnpString::KCRLFCRLength );
            }
        return ETrue;	
        }
    }
开发者ID:cdaffara,项目名称:symbiandump-mw4,代码行数:29,代码来源:upnphttpchunkparser.cpp

示例9: ParseBody

// -----------------------------------------------------------------------------
// CUpnpHttpChunkParser::ParseL
// Decoding the chunked-encoded buffer
// -----------------------------------------------------------------------------
//
TBool CUpnpHttpChunkParser::ParseBody( TDes8& aBuffer, TInt& aPos )
	{	
    if ( IsEmpty( aBuffer, aPos ) )
        {	    
        return ETrue;
        }

    TPtrC8 pointer( aBuffer.Right( aBuffer.Length() - aPos ) );	

    if ( iBytesAppended + pointer.Length() >= iChunkSize )
        {	
        aPos += ( iChunkSize - iBytesAppended );		
        pointer.Set( aBuffer.Right( aBuffer.Length() - aPos ) );
        TInt lineFeed = pointer.FindF(UpnpString::KLineFeed());		
        //linefeed found
        if ( !lineFeed )
            {			
            aBuffer.Delete( aPos, UpnpString::KLineFeed().Length() );
            iContext = EEndChunkBody;	
            return ( aPos == aBuffer.Length() );
            }
        //linefeed not found, end of buffer	
        else if ( lineFeed == KErrNotFound && 
                ( ( aPos + UpnpString::KLineFeed().Length() ) > aBuffer.Length() )
                )
            {			
            iBytesAppended = iChunkSize; 				
            return ETrue;
            }
        //size doesn't comply with the header value
        iError = KErrGeneral;	
        iContext = EError;	
        return EFalse;	
        }
    else
        {
        iBytesAppended += pointer.Length();
        aPos = aBuffer.Length();
        return ETrue;
        }		
    }
开发者ID:cdaffara,项目名称:symbiandump-mw4,代码行数:46,代码来源:upnphttpchunkparser.cpp

示例10: ParseLastChunk

// -----------------------------------------------------------------------------
// CUpnpHttpChunkParser::ParseL
// Decoding the chunked-encoded buffer
// -----------------------------------------------------------------------------
//
TBool CUpnpHttpChunkParser::ParseLastChunk( TDes8& aBuffer, TInt& aPos )
    {		
    //if empty or only one character present
    if ( (aBuffer.Length() - aPos) < UpnpString::KLineFeedLength )
        {	    
        return ETrue;
        }
    //if '\r\n' exists
    TInt lineFeed = aBuffer.Right( aBuffer.Length() - aPos ).FindF( UpnpString::KLineFeed );
    if ( !lineFeed )
        {
        aBuffer.Delete( aPos, lineFeed + UpnpString::KLineFeed().Length() );		
        iContext = EFinish;
        return ETrue;		
        }
    else
        {
        iContext = ETrailer;
        return EFalse;		
        }		

    }	
开发者ID:cdaffara,项目名称:symbiandump-mw4,代码行数:27,代码来源:upnphttpchunkparser.cpp

示例11: ParseHeader

// -----------------------------------------------------------------------------
// CUpnpHttpChunkParser::ParseL
// Decoding the chunked-encoded buffer
// -----------------------------------------------------------------------------
//
TBool CUpnpHttpChunkParser::ParseHeader( TDes8& aBuffer, TInt& aPos )
	{
    if ( IsEmpty( aBuffer, aPos ) )
        {	    
        return ETrue;
        }
    iChunkSize = KErrNotFound;
    iBytesAppended = 0;
    TPtrC8 pointer(NULL,0);
    //if '\r\n' exists
    TInt lineFeed = aBuffer.Right( aBuffer.Length() - aPos ).FindF( UpnpString::KLineFeed );
    //if ';' exists
    TInt semiColon = aBuffer.Right( aBuffer.Length() - aPos ).FindF( UpnpString::KSemiColon );
    //semicolon ignored if occurs after the linefeed
    if ( semiColon !=KErrNotFound && lineFeed !=KErrNotFound && lineFeed<semiColon )
        {
        semiColon = KErrNotFound;
        }
    if ( semiColon !=KErrNotFound )
        {		
        pointer.Set(aBuffer.Right( aBuffer.Length() - aPos ).Mid( 0,semiColon ) );		
        }
    else if ( lineFeed !=KErrNotFound )
        {
        pointer.Set( aBuffer.Right( aBuffer.Length() - aPos ).Mid( 0,lineFeed ) );		
        }
    else
        {
        pointer.Set( aBuffer.Right( aBuffer.Length() - aPos ) );		
        }

    TLex8 lex( pointer );	
    //skip white spaces	
    lex.SkipSpace();
    TUint size;
    //neither semicolon nor linefeed found
    if ( lineFeed == KErrNotFound && semiColon == KErrNotFound )
        {
        //remember the num of cut spaces
        TInt len = lex.Offset();
        if ( !lex.Eos() )
            {
            //check the chunk header size for the limit
            TInt error = lex.Val( size, EHex );			
            if ( error!= KErrNone || size > KMaxTInt )	
                {
                //size too big
                iError = ( error ) ? error: EHttpInsufficientStorage;
                iContext = EError;
                return EFalse;
                }			
            }

        aBuffer.Delete( aPos,len );
        return ETrue;
        }
			
    //get size	
    TInt error = lex.Val( size, EHex );
    if ( error!= KErrNone || size > KMaxTInt )
        {
        //unexpected characters or size too big
        iError = ( error ) ? error: EHttpInsufficientStorage ;
        iContext = EError;
        return EFalse;
        }	
    iChunkSize = size;	
    //skip white spaces	
    lex.SkipSpace();	
    if ( !lex.Eos() )
        {
        //unexpected characters
        iError = KErrGeneral;
        iContext = EError;
        return EFalse;
        }
    if ( lineFeed != KErrNotFound )
        {
        //the whole chunk header is parsed
        aBuffer.Delete( aPos, lineFeed + UpnpString::KLineFeed().Length() );
        //chunk size == 0
        if ( !iChunkSize )
            {        
            iContext = ELastChunk;
            }
        else
            {        
            iContext = EBody;
            }
        return ( aPos == aBuffer.Length() );
        }
    else if ( semiColon != KErrNotFound )
        {
        //extension found, 
        //one character left - possible linefeed
//.........这里部分代码省略.........
开发者ID:cdaffara,项目名称:symbiandump-mw4,代码行数:101,代码来源:upnphttpchunkparser.cpp

示例12: ParseMixedBinaryAsciiDataL

TInt ParseMixedBinaryAsciiDataL(TDes8& aTextToConvert)
/**
Parses aTextToConvert based on the following rules:
'\\' (double backslash) is used to denote a single '\'
(single backslash)
'\xnn' denote a byte of binary data where nn is in hex-decimal.
The '\xnn' in aTextToConvert is replaced by the binary byte
that it represents.

For example: If aTextToConvert contains "abc\\def\xFF",
after parsing, it will contain "abc\def?" where ? = 0xFF.

@param aTextToConvert Modifiable buffer which will be parsed. 

@return KErrNone if aTextToConvert is in valid
        EAdditionalParamDataFormatMixedBinaryAndAscii format.
        KErrArgument if aTextToConvert is in an incorrect format.

@panic KErrNoMemory if there is not enough memory to do the parsing.
*/
	{
	// Pointer to unparsed portion of additionalParamDataBuffer
	HBufC8* resultBuffer = HBufC8::NewLC(aTextToConvert.Length());

	__ASSERT_ALWAYS(resultBuffer, PanicClient(KErrNoMemory));
	
	TPtr8 result(resultBuffer->Des());
	
	// Position of backslash
	TInt pos = 0;

	while ((pos = aTextToConvert.Locate('\\')) != KErrNotFound)
		{
		// Check that the backslash is followed by at least one more character
		if ((pos+1) >= aTextToConvert.Length())
			{
			return KErrArgument;
			}

		TUint8 modifier = aTextToConvert[pos+1];

		// Parse depending on character after the backslash
		switch (modifier)
			{
		case '\\':
			// Next character after the '\' is another '\'.
			// Replace it with a single '\' and move
			// on.
			result.Append(aTextToConvert.Left(pos+1));
			aTextToConvert.Delete(0, pos+2);
			break;
		case 'x':
			// Next character is an 'x' so check that there are three 
			// characters after the backslash (one for the x and two
			// characters of HEX.
			if ((pos+3) >= aTextToConvert.Length()) 
				{
				return KErrArgument;
				}
			// Convert those to HEX and replace '\xNN' with this.
			result.Append(aTextToConvert.Left(pos));
			TUint8 hexAsInt;
			if (AsciiHexToNum(aTextToConvert.MidTPtr(pos+2,2), hexAsInt) != KErrNone)
				{
				return KErrArgument;
				}
			// Append the raw byte to the result
			result.SetLength(result.Length()+1);
			result[result.Length()-1] = hexAsInt;
			aTextToConvert.Delete(0, pos+4);
			break;		
			}
		} // End while
	aTextToConvert.Insert(0, result);
	
	CleanupStack::PopAndDestroy(resultBuffer);
	return KErrNone;
	}
开发者ID:cdaffara,项目名称:symbiandump-os1,代码行数:78,代码来源:utils.cpp


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