• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ TDes类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: AppendInterfaceProperties

void AppendInterfaceProperties(TDes& aDes, const SCdlInterface& aInterface)
	{
	aDes.AppendFormat(_L("%S\nUid: 0x%08x\nMajorVer: %d\nMinorVer: %d\nFlags: 0x%08x\nAPI size: %d\nEng major: %d\nEng minor: %d"), 
		aInterface.iName,
		aInterface.iUid,
		aInterface.iMajorVer,
		aInterface.iMinorVer,
		aInterface.iFlags,
		aInterface.iApiSize,
		aInterface.iMajorEngVer,
		aInterface.iMinorEngVer
		);
	}
开发者ID:cdaffara,项目名称:symbiandump-mw4,代码行数:13,代码来源:InterfaceExplorable.cpp


示例2: ActiveCall

/*
 * ActiveCall() detects if there's a connected call. Only in that case aNumber is meaningfull; and only 
 * in that case, if aNumber.Length() == 0, then aNumber is a private number.
 */
TBool CPhoneCallMonitor::ActiveCall(TDes& aNumber)
	{
	CTelephony::TRemotePartyInfoV1 remInfoUse;
	CTelephony::TCallInfoV1		   callInfoUse;
	CTelephony::TCallSelectionV1   callSelectionUse;
	  		
	// we are interested only voice lines
	callSelectionUse.iLine = CTelephony::EVoiceLine;
	// and calls that are currently connected
	callSelectionUse.iSelect = CTelephony::EActiveCall;  //EHeldCall, EInProgressCall
	  		
	CTelephony::TRemotePartyInfoV1Pckg 	remParty(remInfoUse);
	CTelephony::TCallInfoV1Pckg 		callInfo(callInfoUse);
	CTelephony::TCallSelectionV1Pckg 	callSelection(callSelectionUse);
	  	
	// TCallRemoteIdentityStatus::ERemoteIdentityUnknown, ERemoteIdentityAvailable, ERemoteIdentitySuppressed
	if(iTelephony->GetCallInfo(callSelection,callInfo,remParty) == KErrNone)
		{
		if(remInfoUse.iDirection == CTelephony::EMobileOriginated) //outgoing call
			{
			aNumber.Copy(callInfoUse.iDialledParty.iTelNumber);
			}
		else   //incoming call
			{
			if(remInfoUse.iRemoteIdStatus == CTelephony::ERemoteIdentityAvailable)
				{
				aNumber.Copy(remInfoUse.iRemoteNumber.iTelNumber);
				}
			else  // private number
				{
				aNumber.Zero();
				}
			}
		return ETrue;
		}
	
	return EFalse;
	}
开发者ID:BwRy,项目名称:core-symbian,代码行数:42,代码来源:MonitorPhoneCall.cpp


示例3: FileName

EXPORT_C TInt TFsPluginRequest::FileName(TDes& aName)
	{
	//Special handling required for directories.
	switch(Function())
		{
		case EFsDirOpen:
		case EFsSetEntry:
			{
			aName.Copy(Request()->Src().FullName());
			break;
			}
		case EFsDirReadOne:
		case EFsDirReadPacked:
		case EFsDirSubClose:
			{
			//Get the name from CDirCB::iName
			CDirCB* dir = (CDirCB*) ScratchValue();
			__ASSERT_ALWAYS(dir!= NULL, Fault(EPluginOpError));
			TName name = dir->Name();
			if(name.Size() == 0)
				{
				return KErrNotFound;
				}
			aName.Copy(name);
			break;
			}
		default:
			{
			CFileShare* share;
			TInt err = ShareFromClientHandle(share);
			if(err != KErrNone || share == NULL)
				return(err);
			
			NameFromShare(*share, aName);
			}
		}
	return KErrNone;
	}
开发者ID:kuailexs,项目名称:symbiandump-os1,代码行数:38,代码来源:sf_plugin.cpp


示例4: GetTimeString

void GetTimeString(TTime t, TDes& aBuf)
{
	TBuf<5> time; 
	TTime now; now=GetTime();
	if ((now.DateTime().Year()==t.DateTime().Year()) 
	   && (now.DateTime().Month()==t.DateTime().Month())
	   && (now.DateTime().Day()==t.DateTime().Day()) ) {
		
		t.FormatL(time, _L("%F%H:%T"));
	} else {
		t.FormatL(time, _L("%F%D/%M"));
	}
	aBuf.Copy(time);
}
开发者ID:flaithbheartaigh,项目名称:jaikuengine-mobile-client,代码行数:14,代码来源:medialistbox.cpp


示例5: AskTestDescription

TBool TAzenqosEngineUtils::AskTestDescription(TInt rscid, TDes& descr)
	{
							//descr.Zero();
							CAknTextQueryDialog* cldlg;
					        cldlg = new (ELeave) CAknTextQueryDialog(descr);
					        cldlg->PrepareLC( rscid );
					        if(!(cldlg->RunLD()))
					        {
					        	return EFalse;
					        }

					        descr.TrimAll();
					        if(descr.Length()==0)
					        {
			       				_LIT(emsg,"Test description not entered");
							    CAknErrorNote* informationNote = new (ELeave) CAknErrorNote(ETrue);
							   	informationNote->ExecuteLD(emsg);
							   	return EFalse;
					        }

					        return ETrue;

	}
开发者ID:ykasidit,项目名称:AzqGenUtils,代码行数:23,代码来源:AzenqosEngineUtils.cpp


示例6: FileCloseVars

/**
Utility function for obtaining info on file close requests.  

@param	aRequest			File close request
@param	aPath				The path of the file
@return	KErrNone
*/
LOCAL_C TInt FileCloseVars(CFsRequest* aRequest, TDes& aFileName)
	{
	__ASSERT_ALWAYS(aRequest->Operation()->Function()==EFsFileSubClose,Fault(EBaseRequestMessage));
	
	const TDes* fileName=(TDes*) I64HIGH(aRequest->ScratchValue64());
	if(fileName == NULL)
		return(KErrBadName);

	aFileName = _L("?:");
	aFileName[0] = TText('A' + aRequest->DriveNumber());
	aFileName.Append(*fileName);
	
	return(KErrNone);
	}
开发者ID:kuailexs,项目名称:symbiandump-os1,代码行数:21,代码来源:Sf_plugin_util.cpp


示例7: GetScriptFile

TInt CSecMgrStore::GetScriptFile(TDes& aFile, TExecutableID aExecID)
	{
	TInt ret(GetScriptPath (aFile));

	if ( (KErrNone==ret) || (KErrAlreadyExists==ret))
		{
		if ( KAnonymousScript!=aExecID)
			{
			HBufC *fSuffix = HBufC::NewLC(KMaxName);
			TPtr fSuffixPtr(fSuffix->Des());
			fSuffixPtr.Num (aExecID);

			aFile.Append (fSuffixPtr);
			aFile.Append (KDatExtn);
			CleanupStack::PopAndDestroy (fSuffix);
			}
		}

	if ( KErrAlreadyExists==ret)
		ret=KErrNone;

	return ret;
	}
开发者ID:kuailexs,项目名称:symbiandump-mw3,代码行数:23,代码来源:rtsecmgrstore.cpp


示例8: ClipToFit

EXPORT_C void TextUtils::ClipToFit(TDes& aBuffer,const CFont& aFont,TInt aMaxWidthInPixels,TChar aAlternativeEnd)
/** Clips text to fit into a maximum width.

If the text is too wide to fit in the width when displayed in aFont, 
it is truncated and the specified character (by default, 
a horizontal ellipsis) is appended to it.

@param aBuffer A buffer containing the text to clip.
@param aFont The font.
@param aMaxWidthInPixels The maximum width in pixels.
@param aAlternativeEnd The Unicode character to append to the buffer if truncated. 
By default, this is the horizontal ellipsis. */
	{
	TInt textWidth=aFont.TextWidthInPixels(aBuffer);
	if (textWidth<=aMaxWidthInPixels)
		return;
	TBuf<1> ellipse;
	ellipse.Append(aAlternativeEnd);
	TInt extraWidth=aFont.TextWidthInPixels(ellipse);
	TInt cutOff=aFont.TextCount(aBuffer,aMaxWidthInPixels-extraWidth);
	aBuffer.SetLength(cutOff);
	aBuffer.Append(ellipse);
	}
开发者ID:cdaffara,项目名称:symbiandump-mw1,代码行数:23,代码来源:GULUTIL.CPP


示例9: GetDeviceUiNameL

// ---------------------------------------------------------------------------
// If aDevExt contains a valid friendly name, the friendly name will be displayed;
// Otherwise, if the given name from the parameter of a notifier request is valid,
// the given name will be displayed;
// Otherwise, If aDevExt contains a valid device name, the name will be displayed;
// Otherwise, the a name will be created by this function.
// ---------------------------------------------------------------------------
//
void TBTNotifUtil::GetDeviceUiNameL( TDes& aNameBuf, 
            const CBtDevExtension* aDevExt, 
            const TDesC& aNameInParam,
            const TBTDevAddr& aAddr)
    {
    CBtDevExtension* tempDev( NULL );
    TPtrC namePtr;
    if ( aDevExt && 
         aDevExt->Device().IsValidFriendlyName() && 
         aDevExt->Device().FriendlyName().Length() != 0 )
        {
        // We always use the friendly name regardless of 
        // the device-name of the device is available or not.
        namePtr.Set( aDevExt->Device().FriendlyName() );
        }
    else 
        {
        // this will take care of name formating. Either the
        // name from iNameInParam or the address will be
        // the alias:
        tempDev = CBtDevExtension::NewLC( aAddr, aNameInParam );      
        namePtr.Set( tempDev->Alias() );
        }
    // Make sure no overflow:
    if ( aNameBuf.MaxLength() < namePtr.Length() )
        {
        aNameBuf.Copy( namePtr.Left( aNameBuf.MaxLength() ) );
        }
    else
        {
        aNameBuf.Copy( namePtr );
        }
    if ( tempDev )
        {
        CleanupStack::PopAndDestroy( tempDev );
        }
    }
开发者ID:cdaffara,项目名称:symbiandump-mw1,代码行数:45,代码来源:btnotifutil.cpp


示例10: PrepareLuidQuery

void CSCOMOAdapterDb::PrepareLuidQuery(TInt aLuid, TDes& aSqlQuery)
{
	aSqlQuery.Copy(_L("SELECT * FROM "));
    aSqlQuery.Append(KTableAMMgmtObject);
    aSqlQuery.Append(_L(" WHERE "));
    aSqlQuery.Append(NCol2);
    aSqlQuery.Append(_L(" = "));
    aSqlQuery.AppendNum(aLuid);
}
开发者ID:cdaffara,项目名称:symbiandump-ossapps,代码行数:9,代码来源:omascomoadapterdb.cpp


示例11: GetAppPath

void GetAppPath(TDes& aAppPath)
{
#if defined ( EKA2 )
	User::LeaveIfError(CEikonEnv::Static()->FsSession().PrivatePath(aAppPath));
    // insert the drive to the private path
    TParsePtrC parse((CEikonEnv::Static()->EikAppUi()->Application())->AppFullName());
    aAppPath.Insert(0, parse.Drive());
#else
    CompleteWithAppPath(aAppPath);

#endif
#ifdef __WINS__
	aAppPath[0] = 'c';
#endif	
}
开发者ID:flaithbheartaigh,项目名称:lemonplayer,代码行数:15,代码来源:Utils.cpp


示例12: name

/**
The method parses aFileName argument and constructs the full database file name (including the path) there.
The full file name will be constructed in aFileName input/output argument.

@param aDbFileName Input/Output. Database file name will be constructed there.
@param aSysDrivePrivatePath SQL server private path on the system drive.   
@param aDrive Output parameter. The drive number.
				
@leave KErrBadName Missing file name.

@panic SqlDb 7 In _DEBUG mode - no drive in the final file path.

@internalComponent
*/
static void DoFullFileNameL(TDes& aDbFileName, const TDesC& aSysDrivePrivatePath, TDriveNumber& aDrive)
	{
	TParse parse;
	__SQLLEAVE_IF_ERROR2(parse.Set(aDbFileName, &aSysDrivePrivatePath, NULL));
	if(!parse.NamePresent())
		{
		__SQLLEAVE2(KErrBadName);	
		}
	aDbFileName.Copy(parse.FullName());
	TPtrC driveName = parse.Drive();
	__ASSERT_DEBUG(driveName.Length() > 0, __SQLPANIC2(ESqlPanicInternalError));
	TInt driveNumber = -1;
	__SQLLEAVE_IF_ERROR2(RFs::CharToDrive(driveName[0], driveNumber));
	aDrive = static_cast <TDriveNumber> (driveNumber);
	}
开发者ID:cdaffara,项目名称:symbiandump-os2,代码行数:29,代码来源:SqlSrvFileData.cpp


示例13: CopyMinFieldText

/**
Copy a maximum of KTextFieldMinimalLength characters from aSrc to aDest.

@param aSrc Source text buffer.
@param aDest Destination text buffer.

@return ETrue if copy was successfull, EFalse otherwise.
*/
TBool TCntPersistenceUtility::CopyMinFieldText(TPtrC aSrc,TDes& aDest)
	{
	TBool ret(EFalse);
	if(aSrc.Length() > 0)
		{
		TInt  length = aSrc.Length();
		if (length>KTextFieldMinimalLength)
			{
			length=KTextFieldMinimalLength;
			}	
		aDest.Copy(aSrc.Left(length));
		ret = ETrue;
		}
	return ret;
	}
开发者ID:Esclapion,项目名称:qt-mobility,代码行数:23,代码来源:cntpersistenceutility.cpp


示例14: DegAndMinutesToGeo

void DegAndMinutesToGeo(const TDesC& aMin, TDes& aInto, TInt aSign)
{
	aInto.Zero();
	if (aMin.Compare(_L("0000.0000"))==0  || aMin.Compare(_L("00000.0000"))==0  || aMin.Length()<3) {
		return;
	}
	TInt decpos=aMin.Locate('.');
	if (decpos==KErrNotFound || decpos<3) return;

	TReal deg, min;
	{
		TLex lex(aMin.Left(decpos-2));
		if (lex.Val(deg)!=KErrNone) {
			return;
		}
	}

	{
		TLex lex(aMin.Mid(decpos-2));
		if (lex.Val(min)!=KErrNone) {
			return;
		}
		if (deg==TReal(0) && min==TReal(0)) return;
		min/=TReal(60);
	}

	deg+=min;

	if (deg > TReal(180)) return;

	deg*=aSign;
	TRealFormat fmt; fmt.iTriLen=0;
	fmt.iPoint='.'; fmt.iPlaces=8;
	fmt.iType=KRealFormatCalculator;
	aInto.Num(deg, fmt);
}
开发者ID:flaithbheartaigh,项目名称:jaikuengine-mobile-client,代码行数:36,代码来源:csd_gps.cpp


示例15: GetConfigFile

TInt CSecMgrStore::GetConfigFile(TDes& aConfigFile)
	{
	TInt ret(KErrNone);

	aConfigFile.Append (KCDrive);

	HBufC *privateDir = HBufC::NewLC(KMaxName);
	TPtr ptr(privateDir->Des());
	ret = iFsSession.PrivatePath (ptr);

	if ( KErrNone==ret)
		{
		aConfigFile.Append (ptr);

		ret = iFsSession.MkDirAll (ptr);

		if ( KErrAlreadyExists==ret)
			ret=KErrNone;

		aConfigFile.Append (KConfigFile);
		}
	CleanupStack::PopAndDestroy (privateDir);
	return ret;
	}
开发者ID:kuailexs,项目名称:symbiandump-mw3,代码行数:24,代码来源:rtsecmgrstore.cpp


示例16: GetStringAttribute

TInt CTestAgentDrmContent::GetStringAttribute(TInt aAttribute, TDes& aValue)
	{
	TInt err = KErrNone;
	switch(aAttribute)
		{
		// the content object
		case ContentAccess::EMimeType:
		aValue.Copy(*iContentMimeType);
		break;
	default:
		err = KErrCANotSupported;
		break;
		};
	return err;
	}
开发者ID:cdaffara,项目名称:symbiandump-mw2,代码行数:15,代码来源:TestAgentDrmContent.cpp


示例17: STATIC_CAST

/*
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
*/
void CYuccaNavi::GetTextL(TDes& aText)
{
	if(iNaviDecorator)
	{
		if(iNaviDecorator->DecoratedControl())
		{
			CAknNaviLabel* Tmp = STATIC_CAST(CAknNaviLabel*, iNaviDecorator->DecoratedControl());
			
			const TDesC* Texksti = Tmp->Text();
			if(Texksti)
			{
				aText.Copy(*Texksti);
			}
		}
	}
开发者ID:DrJukka,项目名称:Symbian_Codes,代码行数:19,代码来源:Navipanel.cpp


示例18: AppendText

EXPORT_C void CTestUtils::AppendText(const TDesC& aToken, TDes& aTxt, TInt aMaxTokenLength)
	{
	TInt totalLen = aTxt.Length() + aMaxTokenLength;

	aTxt.Append(aToken);
	aTxt.TrimRight();

	if (aTxt.Length() < totalLen)
		{
		aTxt.AppendFill(' ', totalLen - aTxt.Length());
		}

	aTxt.SetLength(totalLen);
	}
开发者ID:cdaffara,项目名称:symbiandump-mw2,代码行数:14,代码来源:MsvTestUtilsBase.cpp


示例19: iFs

// ==========================================================================
// METHOD:  Constructor
//
// DESIGN:  
// ==========================================================================
CLogFileHandler::CLogFileHandler( RFs& aFs,
                                  TDes& aFormatBuffer, 
                                  TDes8& aOutputBuffer,
                                  const TDesC& aDirectoryName,
                                  const TDesC& aFileName ) : 
    iFs( aFs ),                                  
    iFormatBuffer( aFormatBuffer ),
    iFormatBuffer8( const_cast<TUint8*>(reinterpret_cast<const TUint8*>(aFormatBuffer.Ptr())), 0, aFormatBuffer.MaxLength()*2 ),
    iOutputBuffer( aOutputBuffer ),
    iDirectoryName( aDirectoryName ),
    iFileName( aFileName ),
    iTryToOpenFile( ETrue ),
    iFileIsOpen( EFalse ),
    iFirstTime( ETrue )
    {
    } // END CLogFileHandler
开发者ID:cdaffara,项目名称:symbiandump-ossapps,代码行数:21,代码来源:DebugLog.cpp


示例20: GetDatabaseNameL

//Get DSC database name
void CDscDatabase::GetDatabaseNameL(TDes& aDatabaseName)
	{
	RFs fs;
	CleanupClosePushL(fs);
	User::LeaveIfError(fs.Connect());
	
	// retrieve system drive
	TDriveNumber driveNumber = fs.GetSystemDrive();
 
	// convert to char
    TChar driveChar;
    User::LeaveIfError(RFs::DriveToChar(driveNumber, driveChar));
 
	aDatabaseName.Format(KDatabaseName, (TUint)driveChar);
	CleanupStack::PopAndDestroy(&fs);
	}
开发者ID:cdaffara,项目名称:symbiandump-os1,代码行数:17,代码来源:dscdatabase.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ TDes16类代码示例发布时间:2022-05-31
下一篇:
C++ TDatime类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap