Ejemplo n.º 1
0
void CIntRangeTestParameter::Construct(TDes& aValue)
	{
	if(aValue.Find(_L("..")) != KErrNotFound)
		{
		TInt pos = aValue.Find(_L(".."));
		TLex startLex(aValue.Left(pos));
		TLex endLex(aValue.Mid(pos+2));

		if(startLex.Val(iStart)!=KErrNone)
			return;
			// checks if startLex is at end of string, if not there was garbage in the string so throw it out
		else if(!startLex.Eos())
			return;

		if(endLex.Val(iFinish)!=KErrNone)
			return;
			// checks if startLex is at end of string, if not there was garbage in the string so throw it out
		else if(!endLex.Eos())
			return;
		// checks if range is doable
		if(iStart > iFinish)
			return;
		}
	else
		return;
	iValid = ETrue;
	}
// -----------------------------------------------------------------------------
// ModifyClientUid
// -----------------------------------------------------------------------------
//
void CHssIapHandler::ModifyClientUid( TDes& aUid )
    {
    DEBUG("CHssIapHandler::ModifyClientUid");
    TInt indx = aUid.Find( KMark1 );
    if ( KErrNotFound != indx )
        {
        aUid.Delete( indx, 1 );
        indx = aUid.Find( KMark2 );
        if ( KErrNotFound != indx )
            {
            aUid.Delete( indx, 1 );
            }
        }
    }
// -----------------------------------------------------------------------------
// ModifyClientUid
// -----------------------------------------------------------------------------
//
void CHotSpotSession::ModifyClientUid( TDes& aUid )
    {
    DEBUG("CHotSpotSession::ModifyClientUid");
    TInt indx = aUid.Find( KMark1 );
    if ( KErrNotFound != indx )
        {
        aUid.Delete( indx, 1 );
        indx = aUid.Find( KMark2 );
        if ( KErrNotFound != indx )
            {
            aUid.Delete( indx, 1 );
            }
        }
    }
void CCmdTestSsmCommand::StripExtension( TDes& aFilename )
	{
	TInt dot = aFilename.Find( _L(".") );
	
	if( KErrNotFound != dot)
		{
		aFilename.SetLength( dot );
		}
	}	
/**
Helper function to strip extension
*/
void CGsaFlexiMergeManyFilesTest::StripExtension(TDes& aFilename)
	{
	TInt dot = aFilename.Find(_L("."));

	if(KErrNotFound != dot)
		{
		aFilename.SetLength(dot);
		}
	}
// ---------------------------------------------------------------------------
// CAknMemorySelectionModelMultiDrive::GetItem
// ---------------------------------------------------------------------------
//
void CAknMemorySelectionModelMultiDrive::GetItem( TInt aIndex, TDes& aItem )
    {
    aItem = iListBoxArray[ aIndex ]->Des();
    if( iLayout == ELayoutPopupMenu || iLayout == ELayoutDoublePopup )
        {
        // On layout with graphic, delete image index.
        _LIT( KTab, "\t" );
        TInt tabIndex( aItem.Find( KTab ) );
        if( tabIndex >= 0 )
            {
            aItem.Delete( 0, tabIndex + 1 );
            }
        if( iLayout == ELayoutDoublePopup )
            {
            tabIndex = aItem.Find( KTab );
            if( tabIndex >= 0 )
                {
                aItem = aItem.Left( tabIndex );
                }
            }
        }
    }
Ejemplo n.º 7
0
// ---------------------------------------------------------
// Adjust language name
// ---------------------------------------------------------
//
void CGSPenInputModel::AdjustLanguageName(TInt aLangId, TDes& aLangName)
    {
    switch(aLangId)
        {
        case ELangPrcChinese:
        case ELangHongKongChinese:
        case ELangTaiwanChinese:
            {
            TInt index = aLangName.Find(KLeftBracket);
            if( index != KErrNotFound)
                {
                aLangName.SetLength(index);
                }
            }
        }
    }