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


C++ TDes::Left方法代码示例

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


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

示例1: Construct

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

示例2: MakeNameUniqueL

// Make profile name unique. Must already be a legal filename
void CProfileListDialog::MakeNameUniqueL(TDes &aName) {
    HBufC *fileNameBuf = HBufC::NewLC(KMaxFileName);
    TPtr fileName = fileNameBuf->Des();
    HBufC *newNameBuf = HBufC::NewLC(KMaxFileName);
    TPtr newName = newNameBuf->Des();

    newName = aName;
        
    TBool done = EFalse;
    TInt num = 2;
    while ( !done ) {
        fileName = iProfileDirectory;
        fileName.Append(newName);
        TEntry dummy;
        TInt err = CEikonEnv::Static()->FsSession().Entry(fileName, dummy);
        if ( err == KErrNotFound ) {
            // Have a unique name
            aName = newName;
            break;
        }
        User::LeaveIfError(err);

        // Start adding numbers to the end of the name
        if ( aName.Length() > (KMaxFileName + 14) ) {
            aName = aName.Left(KMaxFileName + 14);
        }
        newName.Format(KUniqueProfileFormat, &aName, num);
        num++;
    }

    CleanupStack::PopAndDestroy(2); //fileNameBuf, newNameBuf;
}
开发者ID:0x0all,项目名称:s2putty,代码行数:33,代码来源:profilelistdialog.cpp

示例3: readConsoleLineBuf

LOCAL_C TInt readConsoleLineBuf(const TDesC& aPrompt, TDes& aBuf)
	{
	test.Printf(_L("\n "));
	TBool quit = EFalse;
	_LIT(KDeleteChar, "\b \b");

	test.Printf(aPrompt);
	while (!quit)
		{
		TKeyCode k = test.Getch();
		TChar key = k;
		switch (key)
			{
		case EKeyBackspace:
			if (aBuf.Length() > 0)
				{
				test.Printf(KDeleteChar);
				aBuf = aBuf.Left(aBuf.Length() - 1);
				}
			break;
		case EKeyEnter:
			if (aBuf.Length())
				quit = ETrue;
			else
				test.Printf(_L("\nLogin, password and server address cannot be zero length "));
			break;
		default:
			test.Printf(_L("%c"), key);
			aBuf.Append(key);
			break;
			}
		}
	return(KErrNone);
	}
开发者ID:cdaffara,项目名称:symbiandump-ossapps,代码行数:34,代码来源:T_pops6.cpp

示例4: GetItem

// ---------------------------------------------------------------------------
// 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 );
                }
            }
        }
    }
开发者ID:cdaffara,项目名称:symbiandump-mw1,代码行数:26,代码来源:caknmemoryselectionmodelmultidrive.cpp


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