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


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

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


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

示例1: MakeElementL

// -----------------------------------------------------------------------------
// CapParser::MakeElementL(TDes& aText, TInt aId, const TDesC& aVersion,
// const TDesC& aDate)
// Constructs element with attributes "Version" and "Date"(eg. 
// "<FW Version="2.2"/>").
// -----------------------------------------------------------------------------
//
void CapParser::MakeElementL(TDes& aText, TInt aId, const TDesC& aVersion, 
                            const TDesC& aDate)
    {
    _LIT(KFormat1, "<%S %S=\"%S\" %S=\"%S\"/>");
    _LIT(KFormat2, "<%S %S=\"%S\"/>");

    aText=KNullDesC;
    
    TBuf<KTagSize> element;
    TBuf<KTagSize> versionTag;
    TBuf<KTagSize> dateTag;
    
    GetTagL(element, aId);
    GetTagL(versionTag, EAttVersion);
    GetTagL(dateTag, EAttDate);

    if (aDate.Length()>0)
        {
        aText.Format(KFormat1, &element, &versionTag, &aVersion, &dateTag, 
        &aDate);
        }       
    else
        {
        aText.Format(KFormat2, &element, &versionTag, &aVersion);
        }
    }
开发者ID:cdaffara,项目名称:symbiandump-ossapps,代码行数:33,代码来源:capparser.cpp

示例2: SetFreeSizeText

void ScrShotsGenUtils::SetFreeSizeText(CScrShotsStrLoader* strLoader, TDes& aFreeSizeText, TInt64 aDriveFreeSize)
{
    TPtr formatStrFreeSizeCell = strLoader->GetStringHBuf(EDriveListFreeSizeCellFormatString)->Des();
    if((aDriveFreeSize / (KOneGB)) > 0)
        aFreeSizeText.Format(formatStrFreeSizeCell, &KGBStr,aDriveFreeSize / (KOneGB));
    else if((aDriveFreeSize / (KOneMB)) > 0)
        aFreeSizeText.Format(formatStrFreeSizeCell, &KMBStr,aDriveFreeSize / (KOneMB));
    else if((aDriveFreeSize / (KOneKB)) > 0)
        aFreeSizeText.Format(formatStrFreeSizeCell,&KKBStr, aDriveFreeSize / (KOneKB));
    else
        aFreeSizeText.Format(formatStrFreeSizeCell, &KBytesStr,aDriveFreeSize );

}
开发者ID:eminemence,项目名称:pre-2013-prjs,代码行数:13,代码来源:ScrShotsGenUtils.cpp

示例3: OutputCodeSegmentsL

EXPORT_C void CMemSpyEngineHelperCodeSegment::OutputCodeSegmentsL( TUint aPid, TDes& aLine, const TDesC& aPrefix, TChar aSectionUnderlineCharacter, TBool aLowerCaseSectionHeading)
    {
	_LIT(KHeaderLC, "Code Segments");
	_LIT(KHeaderUC, "CODE SEGMENTS");

	_LIT(KFmtOverflow, "Only first %d code segments displayed");
	_LIT(KFmtMod, "%S%08X-%08X %S");

	const TInt KMaxCount = 256;
	TAny* handles[KMaxCount];
	TInt c = KMaxCount;

	TInt r = iEngine.Driver().GetCodeSegs(aPid, handles, c);
	if  ( r == KErrNone )
    	{
        if  ( c > 0 )
            {
            if  ( aLowerCaseSectionHeading )
                {
                iEngine.Sink().OutputSectionHeadingL( KHeaderLC, aSectionUnderlineCharacter );
                }
            else
                {
            	iEngine.Sink().OutputSectionHeadingL( KHeaderUC, aSectionUnderlineCharacter );
                }

        	if (c > KMaxCount)
        		{
        		c = KMaxCount;
        		aLine.Format(KFmtOverflow, c);
        		iEngine.Sink().OutputLineL( aLine );
        		}

        	TBuf<KMaxFileName> path;
        	TMemSpyDriverCodeSegInfo info;
        	for (TInt i=0; i<c; i++)
        		{
        		r = iEngine.Driver().GetCodeSegInfo(handles[i], aPid, info);
                //
        		if  ( r == KErrNone )
        			{
        			path.Copy( info.iCreateInfo.iFileName );
        			aLine.Format(KFmtMod, &aPrefix, info.iMemoryInfo.iCodeBase,info.iMemoryInfo.iCodeBase + info.iMemoryInfo.iCodeSize, &path);
        			iEngine.Sink().OutputLineL( aLine );
        			}
        		}
            }
        }
   }
开发者ID:RomanSaveljev,项目名称:osrndtools,代码行数:49,代码来源:MemSpyEngineHelperCodeSegment.cpp

示例4: LocationRequestThreadMainPartL

/**
 * Connection is opened to location server,and closed
 *
 * If anything fails during the execution of this test, then function
 * leaves with proper error code.
 *
 * Parameters:
 **/
void LocationRequestThreadMainPartL(TDes& aErrorBuf)
    {
    // Open connection to Location server
    RPositionServer server;

    TInt err = server.Connect(); 

    if (err != KErrNone)
        {
        _LIT(KErrOpen, "Server open failed with code %d\r\n");
        aErrorBuf.Format(KErrOpen, err);
        }
    else
        {
        _LIT(KOkOpen, "Server open ok\r\n");
        aErrorBuf.Copy(KOkOpen);
        }

    User::LeaveIfError(err);

    CleanupClosePushL(server);


    CleanupStack::PopAndDestroy(1); // server, positioner

    _LIT(KInfTestComplet, "Test completed ok for this thread\r\n");
    aErrorBuf.Append(KInfTestComplet);
    }
开发者ID:kuailexs,项目名称:symbiandump-os1,代码行数:36,代码来源:ctlbsclientpostp208.cpp

示例5: FormatTimeSimple

void MemSpyEngineUtils::FormatTimeSimple( TDes& aBuf, const TTime& aTime )
    {
    const TDateTime dt = aTime.DateTime();
    //
    _LIT( KTimeFormatSpec, "%04d%02d%02d %02d:%02d:%02d" );
    aBuf.Format( KTimeFormatSpec, dt.Year(), dt.Month()+1, dt.Day()+1, dt.Hour(), dt.Minute(), dt.Second() );
    }
开发者ID:RomanSaveljev,项目名称:osrndtools,代码行数:7,代码来源:MemSpyEngineUtils.cpp

示例6: GetCommandListPathL

// ---------------------------------------------------------------------------
// CSsmShutdownPolicy::GetCommandListPathL
// ---------------------------------------------------------------------------
//
void CSsmShutdownPolicy::GetCommandListPathL( TDes& aCmdListPath )
    {
    FUNC_LOG;

	aCmdListPath.Format( KCommandListPath );
	iUtil->GetCommandListPath( aCmdListPath );
    }
开发者ID:cdaffara,项目名称:symbiandump-os1,代码行数:11,代码来源:ssmshutdownpolicy.cpp

示例7: CreateListBoxItemL

/**
 *	Create a list box item with the given column values.
 */
void CSettingList::CreateListBoxItemL( TDes& aBuffer, 
		const TDesC& aMainText,
		const TDesC& aSecondaryText )
	{
	_LIT ( KStringHeader, "\t%S\t%S" );
	
	aBuffer.Format( KStringHeader(), &aMainText, &aSecondaryText );
	} 
开发者ID:kolayuk,项目名称:ActiveJack,代码行数:11,代码来源:SettingList.cpp

示例8: ClientAppFolder

// -----------------------------------------------------------------------------
// CHttpDownloadManagerServerEngine::ClientAppFolder
// ?implementation_description
// (other items were commented in a header).
// -----------------------------------------------------------------------------
//
void CHttpDownloadManagerServerEngine::ClientAppFolder( 
                                                    const CHttpClientApp* aClientApp, 
                                                    TDes& aFolder )
    {
    _LIT( KClientAppFolderFormat, "%S%x\\" );

    aFolder.Format( KClientAppFolderFormat, &KDmDefaultDir, aClientApp->AppUid() );
    }
开发者ID:cdaffara,项目名称:symbiandump-mw4,代码行数:14,代码来源:HttpDownloadManagerServerEngine.cpp

示例9: MakeTimeStrMilli

void TAzenqosEngineUtils::MakeTimeStrMilli(TTime &time,TDes& str) //str should be at least 19 in length
{

	const TInt KThousand = 1000;

	TDateTime date = time.DateTime();
	str.Format(KTimeStampMillisecFormat,date.Year()%2000,date.Month()+1,date.Day()+1,date.Hour(),date.Minute(),date.Second(),date.MicroSecond()*KThousand);

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

示例10: SetTotalSizeText

void CScrShotsDriveGrid::SetTotalSizeText(TDes& aTotalSizeText, TInt64 aDriveTotalSize)
{
    TPtr formatStr = iParentControl->GetAppView()->GetAppUi().GetStrLoader()->GetStringHBuf(EDriveTotalSizeFormatString)->Des();

    if((aDriveTotalSize / (KOneGB)) > 0){
        aTotalSizeText.Format(formatStr,&KGBStr,aDriveTotalSize / (KOneGB));
    }
    else if((aDriveTotalSize / (KOneMB)) > 0){
        aTotalSizeText.Format(formatStr,&KMBStr,aDriveTotalSize / (KOneMB));
    }
    else if((aDriveTotalSize / (KOneKB)) > 0){
        aTotalSizeText.Format(formatStr,&KKBStr, aDriveTotalSize / (KOneKB));
    }
    else{
        aTotalSizeText.Format(formatStr,&KBytesStr,aDriveTotalSize );
    }

}
开发者ID:eminemence,项目名称:pre-2013-prjs,代码行数:18,代码来源:ScrShotsDriveGrid.cpp

示例11: GetErrorTextL

void CPodcastAppUi::GetErrorTextL(TDes &aErrorMessage, TInt aErrorCode)
	{
	switch (aErrorCode)
		{
		case KErrNotFound:
			{
			HBufC* error = iCoeEnv->AllocReadResourceLC(R_ERROR_INVALID_ADDRESS);
			aErrorMessage.Copy(*error);
			CleanupStack::PopAndDestroy(error);
			}
			break;
		case KErrDiskFull:
			{
			HBufC* error = iCoeEnv->AllocReadResourceLC(R_ERROR_DISK_FULL);
			aErrorMessage.Copy(*error);
			CleanupStack::PopAndDestroy(error);
			}
			break;
		case 404:
			{
			HBufC* error = iCoeEnv->AllocReadResourceLC(R_ERROR_NOTFOUND);
			aErrorMessage.Copy(*error);
			CleanupStack::PopAndDestroy(error);
			}
			break;
		default:
			{
			if (aErrorCode > 200)
				{
				HBufC* error = iCoeEnv->AllocReadResourceLC(R_ERROR_HTTP);
				aErrorMessage.Format(*error, aErrorCode);
				CleanupStack::PopAndDestroy(error);
				}
			else
				{
				HBufC* error = iCoeEnv->AllocReadResourceLC(R_ERROR_GENERAL);
				aErrorMessage.Format(*error, aErrorCode);
				CleanupStack::PopAndDestroy(error);
				}
			}
			break;
		}
	}
开发者ID:cdaffara,项目名称:symbiandump-ossapps,代码行数:43,代码来源:PodcastAppui.cpp

示例12: DoOutputChunkInfoForObjectL

void CMemSpyEngineHelperChunk::DoOutputChunkInfoForObjectL( TUint aId, TDes& aLineBuffer, TType aType )
    {
    TFullName ownerName;
	//
    RArray<TAny*> handles( 128 );
    CleanupClosePushL( handles );
    //
    GetChunkHandlesL( handles, aType, aId );
    CMemSpyEngineChunkList* list = CreateListFromHandlesL( handles );
    //
    CleanupStack::PopAndDestroy( &handles );
    CleanupStack::PushL( list );
    //
    const TInt count = list->Count();
    for (TInt i=0; i<count; i++)
    	{
        const CMemSpyEngineChunkEntry& entry = list->At( i );
        //
        _LIT(KLine1, "Name");
        iEngine.Sink().OutputItemAndValueL( KLine1, entry.Name() );
        //
        _LIT(KLine2, "Owner");
        entry.OwnerName( ownerName );
        iEngine.Sink().OutputItemAndValueL( KLine2, ownerName );
        //
        _LIT(KLine3, "Address");
        _LIT(KLine3Format, "0x%08x - 0x%08x");
        aLineBuffer.Format(KLine3Format, entry.BaseAddress(), entry.UpperAddress() );
        iEngine.Sink().OutputItemAndValueL( KLine3, aLineBuffer );
        //
        _LIT(KLine4, "Size (max)");
        _LIT(KLine4Format, "%d (%d)");
        aLineBuffer.Format(KLine4Format, entry.Size(), entry.MaxSize());
        iEngine.Sink().OutputItemAndValueL( KLine4, aLineBuffer );
        //
        if  ( i < count - 1 )
            {
            iEngine.Sink().OutputBlankLineL();
    		}
        }
    //
    CleanupStack::PopAndDestroy( list );
    }
开发者ID:RomanSaveljev,项目名称:osrndtools,代码行数:43,代码来源:MemSpyEngineHelperChunk.cpp

示例13: CodFolder

// -----------------------------------------------------------------------------
// CHttpDownloadManagerServerEngine::DownloadInfoFolder
// ?implementation_description
// (other items were commented in a header).
// -----------------------------------------------------------------------------
//
void CHttpDownloadManagerServerEngine::CodFolder( 
                                                const CHttpClientApp* aClientApp, 
                                                TDes& aFolder ) const
    {
    _LIT( KDownloadFolderFormat, "%S%x\\%S\\" );

    aFolder.Format( KDownloadFolderFormat, 
                        &KDmDefaultDir, 
                        aClientApp->AppUid(),
                        &KCodsDirName );
    }
开发者ID:cdaffara,项目名称:symbiandump-mw4,代码行数:17,代码来源:HttpDownloadManagerServerEngine.cpp

示例14: ClientAppFolderWithoutDriveLetter

// -----------------------------------------------------------------------------
// CHttpDownloadManagerServerEngine::ClientAppFolder
// ?implementation_description
// (other items were commented in a header).
// -----------------------------------------------------------------------------
//
void CHttpDownloadManagerServerEngine::ClientAppFolderWithoutDriveLetter( 
                                        const CHttpClientApp* aClientApp, 
                                        TDes& aFolder )
    {
    _LIT( KClientAppFolderFormat, "%s%x\\" );

    // [3] cut off the drive letter + ':\\' part
    aFolder.Format( KClientAppFolderFormat, 
                    &KDmDefaultDir()[3], 
                    aClientApp->AppUid() );
    }
开发者ID:cdaffara,项目名称:symbiandump-mw4,代码行数:17,代码来源:HttpDownloadManagerServerEngine.cpp

示例15: GetCommandListPath

/*
Helper function to create command list path for start-up.
Implements fallback mechanism to launch 'sysstart.exe' if static command list for 'start-up' state is not found.
This temporary implementation is required during migration from existing 'sysstart' to 'ssma start-up'.
*/
void CGsaStatePolicyStartup::GetCommandListPath(TUint aBootMode, TDes& aCmdListPath)
	{
	aCmdListPath.Format(KCommandListPath, aBootMode);
	TBool found = BaflUtils::FolderExists(iFs, aCmdListPath);

	// This Fallback mechanism is used internally during migration from 'sysstart' to 'ssma start-up' and is not required otherwise.
	if (!found)
		{
		aCmdListPath.Copy(KFallbackCmdListPath());
		iLaunchSysStart = ETrue;	// launch 'sysstart.exe'
		}
	}
开发者ID:cdaffara,项目名称:symbiandump-os1,代码行数:17,代码来源:gsastatepolicystartup.cpp


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